Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106425
b: refs/heads/master
c: 62090a0
h: refs/heads/master
i:
  106423: fb7cacf
v: v3
  • Loading branch information
Håvard Skinnemoen authored and David Woodhouse committed Jun 7, 2008
1 parent 4c5f35d commit 26fbb51
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1677ce4e41a7c1bbc35a0dee27d5c7e7d223a4b
refs/heads/master: 62090a08aba579e6c69319fac4d4a1f806f26400
52 changes: 52 additions & 0 deletions trunk/arch/avr32/mach-at32ap/at32ap700x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,58 @@ at32_add_device_cf(unsigned int id, unsigned int extint,
}
#endif

/* --------------------------------------------------------------------
* NAND Flash / SmartMedia
* -------------------------------------------------------------------- */
static struct resource smc_cs3_resource[] __initdata = {
{
.start = 0x0c000000,
.end = 0x0fffffff,
.flags = IORESOURCE_MEM,
}, {
.start = 0xfff03c00,
.end = 0xfff03fff,
.flags = IORESOURCE_MEM,
},
};

struct platform_device *__init
at32_add_device_nand(unsigned int id, struct atmel_nand_data *data)
{
struct platform_device *pdev;

if (id != 0 || !data)
return NULL;

pdev = platform_device_alloc("atmel_nand", id);
if (!pdev)
goto fail;

if (platform_device_add_resources(pdev, smc_cs3_resource,
ARRAY_SIZE(smc_cs3_resource)))
goto fail;

if (platform_device_add_data(pdev, data,
sizeof(struct atmel_nand_data)))
goto fail;

set_ebi_sfr_bits(HMATRIX_BIT(CS3A));
if (data->enable_pin)
at32_select_gpio(data->enable_pin,
AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
if (data->rdy_pin)
at32_select_gpio(data->rdy_pin, 0);
if (data->det_pin)
at32_select_gpio(data->det_pin, 0);

platform_device_add(pdev);
return pdev;

fail:
platform_device_put(pdev);
return NULL;
}

/* --------------------------------------------------------------------
* AC97C
* -------------------------------------------------------------------- */
Expand Down
13 changes: 13 additions & 0 deletions trunk/include/asm-avr32/arch-at32ap/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,17 @@ struct platform_device *
at32_add_device_cf(unsigned int id, unsigned int extint,
struct cf_platform_data *data);

/* NAND / SmartMedia */
struct atmel_nand_data {
int enable_pin; /* chip enable */
int det_pin; /* card detect */
int rdy_pin; /* ready/busy */
u8 ale; /* address line number connected to ALE */
u8 cle; /* address line number connected to CLE */
u8 bus_width_16; /* buswidth is 16 bit */
struct mtd_partition *(*partition_info)(int size, int *num_partitions);
};
struct platform_device *
at32_add_device_nand(unsigned int id, struct atmel_nand_data *data);

#endif /* __ASM_ARCH_BOARD_H */

0 comments on commit 26fbb51

Please sign in to comment.