From 044f6c7c449ae8ba0353b032706b098a7ad5e304 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Tue, 22 Apr 2008 05:37:12 +0200 Subject: [ARM] Orion: move EHCI/I2C/UART peripheral init into board code This patch moves initialisation of EHCI/I2C/UART platform devices from the common orion5x_init() into the board support code. The rationale behind this is that only the board support code knows whether certain peripherals have been brought out on the board, and not initialising peripherals that haven't been brought out is desirable for example: - to reduce user confusion (e.g. seeing both 'eth0' and 'eth1' appear while there is only one ethernet port on the board); and - to allow for future power savings (peripherals that have not been brought out can be clock gated off entirely). Signed-off-by: Lennert Buytenhek Acked-by: Russell King --- arch/arm/mach-orion5x/db88f5281-setup.c | 39 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'arch/arm/mach-orion5x/db88f5281-setup.c') diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c index 4ee695028254..eca76b3348bc 100644 --- a/arch/arm/mach-orion5x/db88f5281-setup.c +++ b/arch/arm/mach-orion5x/db88f5281-setup.c @@ -298,13 +298,6 @@ static struct i2c_board_info __initdata db88f5281_i2c_rtc = { /***************************************************************************** * General Setup ****************************************************************************/ - -static struct platform_device *db88f5281_devs[] __initdata = { - &db88f5281_boot_flash, - &db88f5281_nor_flash, - &db88f5281_nand_flash, -}; - static void __init db88f5281_init(void) { /* @@ -312,15 +305,6 @@ static void __init db88f5281_init(void) */ orion5x_init(); - /* - * Setup the CPU address decode windows for our on-board devices - */ - orion5x_setup_dev_boot_win(DB88F5281_NOR_BOOT_BASE, - DB88F5281_NOR_BOOT_SIZE); - orion5x_setup_dev0_win(DB88F5281_7SEG_BASE, DB88F5281_7SEG_SIZE); - orion5x_setup_dev1_win(DB88F5281_NOR_BASE, DB88F5281_NOR_SIZE); - orion5x_setup_dev2_win(DB88F5281_NAND_BASE, DB88F5281_NAND_SIZE); - /* * Setup Multiplexing Pins: * MPP0: GPIO (USB Over Current) MPP1: GPIO (USB Vbat input) @@ -342,9 +326,28 @@ static void __init db88f5281_init(void) orion5x_gpio_set_valid_pins(0x00003fc3); - platform_add_devices(db88f5281_devs, ARRAY_SIZE(db88f5281_devs)); - i2c_register_board_info(0, &db88f5281_i2c_rtc, 1); + /* + * Configure peripherals. + */ + orion5x_ehci0_init(); orion5x_eth_init(&db88f5281_eth_data); + orion5x_i2c_init(); + orion5x_uart0_init(); + orion5x_uart1_init(); + + orion5x_setup_dev_boot_win(DB88F5281_NOR_BOOT_BASE, + DB88F5281_NOR_BOOT_SIZE); + platform_device_register(&db88f5281_boot_flash); + + orion5x_setup_dev0_win(DB88F5281_7SEG_BASE, DB88F5281_7SEG_SIZE); + + orion5x_setup_dev1_win(DB88F5281_NOR_BASE, DB88F5281_NOR_SIZE); + platform_device_register(&db88f5281_nor_flash); + + orion5x_setup_dev2_win(DB88F5281_NAND_BASE, DB88F5281_NAND_SIZE); + platform_device_register(&db88f5281_nand_flash); + + i2c_register_board_info(0, &db88f5281_i2c_rtc, 1); } MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board") -- cgit v1.2.3