diff options
author | Franck Jullien <franck.jullien@gmail.com> | 2011-07-26 22:07:54 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-27 10:54:13 +0200 |
commit | 8545b4b38627a4a91400ee25e601b1aa4a993e66 (patch) | |
tree | 6f4fd00792626334b73e997e6a04facc5a82fe07 /arch/nios2 | |
parent | 5998165c1aa39f6b74ec1e58506e15bf9ff2be67 (diff) | |
download | barebox-8545b4b38627a4a91400ee25e601b1aa4a993e66.tar.gz barebox-8545b4b38627a4a91400ee25e601b1aa4a993e66.tar.xz |
nios2/generic.c: Add resources for altera TSE
This patch adds resources for the Altera TSE driver as
this driver has been moved to resources usage.
The serial device also uses resources declared with the helps
of add_generic_device.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/nios2')
-rw-r--r-- | arch/nios2/boards/generic/generic.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c index 089715b749..49c1d7cd6a 100644 --- a/arch/nios2/boards/generic/generic.c +++ b/arch/nios2/boards/generic/generic.c @@ -6,20 +6,32 @@ static int phy_address = 1; +static struct resource mac_resources[] = { + [0] = { + .start = NIOS_SOPC_TSE_BASE, + .size = 0x400, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = NIOS_SOPC_SGDMA_RX_BASE, + .size = 0x40, + .flags = IORESOURCE_MEM, + }, + [2] = { + .start = NIOS_SOPC_SGDMA_TX_BASE, + .size = 0x40, + .flags = IORESOURCE_MEM, + }, +}; + static struct device_d mac_dev = { .id = -1, .name = "altera_tse", - .map_base = NIOS_SOPC_TSE_BASE, - .size = 0x00000400, + .num_resources = ARRAY_SIZE(mac_resources), + .resource = mac_resources, .platform_data = &phy_address, }; -static struct device_d altera_serial_device = { - .id = -1, - .name = "altera_serial", - .map_base = NIOS_SOPC_UART_BASE, -}; - /* static struct device_d epcs_flash_device = { .id = -1, @@ -49,7 +61,8 @@ device_initcall(generic_devices_init); static int altera_console_init(void) { - register_device(&altera_serial_device); + add_generic_device("altera_serial", -1, NULL, NIOS_SOPC_UART_BASE, 0x20, + IORESOURCE_MEM, NULL); return 0; } |