diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-16 13:44:28 +0800 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-18 07:57:50 +0800 |
commit | 643b2f620f25ef814ea711ad59bb8fe5f0f7c183 (patch) | |
tree | d4541cef337b4d19a6ad93bad866dac7e79912ce /arch/arm/mach-at91/at91sam9260_devices.c | |
parent | 126c9b69cf6241673e0ccecc542ed3b9935308df (diff) | |
download | barebox-643b2f620f25ef814ea711ad59bb8fe5f0f7c183.tar.gz barebox-643b2f620f25ef814ea711ad59bb8fe5f0f7c183.tar.xz |
at91: switch to all resource declaration to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 121 |
1 files changed, 99 insertions, 22 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index d44e280907..85f7578cf4 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c @@ -21,6 +21,12 @@ #include "generic.h" +static struct resource sdram_dev_resources[] = { + [0] = { + .start = AT91_CHIPSELECT_1, + }, +}; + static struct memory_platform_data sram_pdata = { .name = "sram0", .flags = DEVFS_RDWR, @@ -29,23 +35,31 @@ static struct memory_platform_data sram_pdata = { static struct device_d sdram_dev = { .id = -1, .name = "mem", - .map_base = AT91_CHIPSELECT_1, + .num_resources = ARRAY_SIZE(sdram_dev_resources), + .resource = sdram_dev_resources, .platform_data = &sram_pdata, }; void at91_add_device_sdram(u32 size) { - sdram_dev.size = size; + sdram_dev_resources[0].size = size; register_device(&sdram_dev); armlinux_add_dram(&sdram_dev); } #if defined(CONFIG_DRIVER_NET_MACB) +static struct resource eth_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_EMAC, + .size = 0x1000, + }, +}; + static struct device_d macb_dev = { .id = -1, .name = "macb", - .map_base = AT91SAM9260_BASE_EMAC, - .size = 0x1000, + .resource = eth_resources, + .num_resources = ARRAY_SIZE(eth_resources), }; void at91_add_device_eth(struct at91_ether_platform_data *data) @@ -84,11 +98,18 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {} #endif #if defined(CONFIG_NAND_ATMEL) +static struct resource nand_resources[] = { + [0] = { + .start = AT91_CHIPSELECT_3, + .size = 0x10, + }, +}; + static struct device_d nand_dev = { .id = -1, .name = "atmel_nand", - .map_base = AT91_CHIPSELECT_3, - .size = 0x10, + .resource = nand_resources, + .num_resources = ARRAY_SIZE(nand_resources), }; void at91_add_device_nand(struct atmel_nand_data *data) @@ -120,11 +141,18 @@ void at91_add_device_nand(struct atmel_nand_data *data) void at91_add_device_nand(struct atmel_nand_data *data) {} #endif +static struct resource dbgu_resources[] = { + [0] = { + .start = AT91_BASE_SYS + AT91_DBGU, + .size = 4096, + }, +}; + static struct device_d dbgu_serial_device = { .id = 0, .name = "atmel_serial", - .map_base = AT91_BASE_SYS + AT91_DBGU, - .size = 4096, + .resource = dbgu_resources, + .num_resources = ARRAY_SIZE(dbgu_resources), }; static inline void configure_dbgu_pins(void) @@ -133,11 +161,18 @@ static inline void configure_dbgu_pins(void) at91_set_A_periph(AT91_PIN_PB15, 1); /* DTXD */ } +static struct resource uart0_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_US0, + .size = 4096, + }, +}; + static struct device_d uart0_serial_device = { .id = 1, .name = "atmel_serial", - .map_base = AT91SAM9260_BASE_US0, - .size = 4096, + .resource = uart0_resources, + .num_resources = ARRAY_SIZE(uart0_resources), }; static inline void configure_usart0_pins(unsigned pins) @@ -159,11 +194,18 @@ static inline void configure_usart0_pins(unsigned pins) at91_set_A_periph(AT91_PIN_PB25, 0); /* RI0 */ } +static struct resource uart1_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_US1, + .size = 4096, + }, +}; + static struct device_d uart1_serial_device = { .id = 2, .name = "atmel_serial", - .map_base = AT91SAM9260_BASE_US1, - .size = 4096, + .resource = uart1_resources, + .num_resources = ARRAY_SIZE(uart1_resources), }; static inline void configure_usart1_pins(unsigned pins) @@ -177,11 +219,18 @@ static inline void configure_usart1_pins(unsigned pins) at91_set_A_periph(AT91_PIN_PB29, 0); /* CTS1 */ } +static struct resource uart2_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_US2, + .size = 4096, + }, +}; + static struct device_d uart2_serial_device = { .id = 3, .name = "atmel_serial", - .map_base = AT91SAM9260_BASE_US2, - .size = 4096, + .resource = uart2_resources, + .num_resources = ARRAY_SIZE(uart2_resources), }; static inline void configure_usart2_pins(unsigned pins) @@ -195,11 +244,18 @@ static inline void configure_usart2_pins(unsigned pins) at91_set_A_periph(AT91_PIN_PA5, 0); /* CTS2 */ } +static struct resource uart3_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_US3, + .size = 4096, + }, +}; + static struct device_d uart3_serial_device = { .id = 4, .name = "atmel_serial", - .map_base = AT91SAM9260_BASE_US3, - .size = 4096, + .resource = uart3_resources, + .num_resources = ARRAY_SIZE(uart3_resources), }; static inline void configure_usart3_pins(unsigned pins) @@ -213,11 +269,18 @@ static inline void configure_usart3_pins(unsigned pins) at91_set_B_periph(AT91_PIN_PC10, 0); /* CTS3 */ } +static struct resource uart4_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_US4, + .size = 4096, + }, +}; + static struct device_d uart4_serial_device = { .id = 5, .name = "atmel_serial", - .map_base = AT91SAM9260_BASE_US4, - .size = 4096, + .resource = uart4_resources, + .num_resources = ARRAY_SIZE(uart4_resources), }; static inline void configure_usart4_pins(void) @@ -226,11 +289,18 @@ static inline void configure_usart4_pins(void) at91_set_B_periph(AT91_PIN_PA30, 0); /* RXD4 */ } +static struct resource uart5_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_US5, + .size = 4096, + }, +}; + static struct device_d uart5_serial_device = { .id = 6, .name = "atmel_serial", - .map_base = AT91SAM9260_BASE_US5, - .size = 4096, + .resource = uart5_resources, + .num_resources = ARRAY_SIZE(uart5_resources), }; static inline void configure_usart5_pins(void) @@ -283,11 +353,18 @@ void at91_register_uart(unsigned id, unsigned pins) } #if defined(CONFIG_MCI_ATMEL) +static struct resource mci_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_MCI, + .size = SZ_16K, + }, +}; + static struct device_d mci_device = { .id = -1, .name = "atmel_mci", - .map_base = AT91SAM9260_BASE_MCI, - .size = SZ_16K, + .num_resources = ARRAY_SIZE(mci_resources), + .resource = mci_resources, }; /* Consider only one slot : slot 0 */ |