From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tky4T-0001ic-40 for barebox@lists.infradead.org; Tue, 18 Dec 2012 14:23:20 +0000 From: Jan Luebbe Date: Tue, 18 Dec 2012 15:22:35 +0100 Message-Id: <1355840561-11552-14-git-send-email-jlu@pengutronix.de> In-Reply-To: <1355840561-11552-1-git-send-email-jlu@pengutronix.de> References: <1355840561-11552-1-git-send-email-jlu@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 13/19] ARM omap4: Use device register functions in boards To: barebox@lists.infradead.org From: Sascha Hauer Signed-off-by: Sascha Hauer --- arch/arm/boards/archosg9/board.c | 17 +++++------------ arch/arm/boards/panda/board.c | 18 ++++-------------- arch/arm/boards/pcm049/board.c | 17 ++++------------- arch/arm/boards/phycard-a-xl2/pca-a-xl2.c | 16 ++++------------ 4 files changed, 17 insertions(+), 51 deletions(-) diff --git a/arch/arm/boards/archosg9/board.c b/arch/arm/boards/archosg9/board.c index dab0a36..5f62748 100644 --- a/arch/arm/boards/archosg9/board.c +++ b/arch/arm/boards/archosg9/board.c @@ -16,14 +16,11 @@ #include #include #include +#include #include #include #include -static struct NS16550_plat serial_plat = { - .clock = 48000000, /* 48MHz (APLL96/2) */ - .shift = 2, -}; static int archosg9_console_init(void){ if (IS_ENABLED(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT)) add_generic_device("serial_omap4_usbboot", DEVICE_ID_DYNAMIC @@ -31,8 +28,7 @@ static int archosg9_console_init(void){ if (IS_ENABLED(CONFIG_DRIVER_SERIAL_NS16550)) { gpio_direction_output(41, 0); /* gps_disable */ gpio_direction_output(34, 1); /* 1v8_pwron */ - add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART1_BASE, 1024, - IORESOURCE_MEM_8BIT, &serial_plat); + omap44xx_add_uart1(); } return 0; } @@ -50,12 +46,9 @@ static struct i2c_board_info i2c_devices[] = { static int archosg9_devices_init(void){ i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); - add_generic_device("i2c-omap" , DEVICE_ID_DYNAMIC, NULL, - OMAP44XX_I2C1_BASE, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, - OMAP44XX_MMC1_BASE, SZ_4K, IORESOURCE_MEM, NULL); - add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, - OMAP44XX_MMC2_BASE, SZ_4K, IORESOURCE_MEM, NULL); + omap44xx_add_i2c1(NULL); + omap44xx_add_mmc1(NULL); + omap44xx_add_mmc2(NULL); armlinux_set_bootparams((void *)0x80000100); /* diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c index 99222d2..5b27f46 100644 --- a/arch/arm/boards/panda/board.c +++ b/arch/arm/boards/panda/board.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -33,16 +34,9 @@ static int board_revision; #define GPIO_BOARD_ID1 101 #define GPIO_BOARD_ID2 171 -static struct NS16550_plat serial_plat = { - .clock = 48000000, /* 48MHz (APLL96/2) */ - .shift = 2, -}; - static int panda_console_init(void) { - /* Register the serial port */ - add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART3_BASE, 1024, - IORESOURCE_MEM_8BIT, &serial_plat); + omap44xx_add_uart3(); return 0; } @@ -160,13 +154,9 @@ static int panda_devices_init(void) } i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); - add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC, - NULL, 0x48070000, 0x1000, - IORESOURCE_MEM, NULL); - + omap44xx_add_i2c1(NULL); + omap44xx_add_mmc1(NULL); - add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K, - IORESOURCE_MEM, NULL); panda_ehci_init(); panda_led_init(); diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c index 859ce3b..ca3f906 100644 --- a/arch/arm/boards/pcm049/board.c +++ b/arch/arm/boards/pcm049/board.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -38,16 +39,9 @@ #include #include -static struct NS16550_plat serial_plat = { - .clock = 48000000, /* 48MHz (APLL96/2) */ - .shift = 2, -}; - static int pcm049_console_init(void) { - /* Register the serial port */ - add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART3_BASE, 1024, - IORESOURCE_MEM_8BIT, &serial_plat); + omap44xx_add_uart3(); return 0; } @@ -99,11 +93,8 @@ static struct gpmc_nand_platform_data nand_plat = { static int pcm049_devices_init(void) { i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); - add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC, NULL, 0x48070000, 0x1000, - IORESOURCE_MEM, NULL); - - add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K, - IORESOURCE_MEM, NULL); + omap44xx_add_i2c1(NULL); + omap44xx_add_mmc1(NULL); gpmc_generic_init(0x10); diff --git a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c index 26b31dd..3931f57 100644 --- a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c +++ b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c @@ -37,18 +37,12 @@ #include #include #include +#include #include -static struct NS16550_plat serial_plat = { - .clock = 48000000, /* 48MHz (APLL96/2) */ - .shift = 2, -}; - static int pcaaxl2_console_init(void) { - /* Register the serial port */ - add_ns16550_device(DEVICE_ID_DYNAMIC, OMAP44XX_UART3_BASE, 1024, - IORESOURCE_MEM_8BIT, &serial_plat); + omap44xx_add_uart3(); return 0; } @@ -111,16 +105,14 @@ static int pcaaxl2_devices_init(void) u32 value; i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); - add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC, NULL, 0x48070000, 0x1000, - IORESOURCE_MEM, NULL); + omap44xx_add_i2c1(NULL); value = readl(OMAP4_CONTROL_PBIASLITE); value &= ~OMAP4_MMC1_PBIASLITE_VMODE; value |= (OMAP4_MMC1_PBIASLITE_PWRDNZ | OMAP4_MMC1_PWRDNZ); writel(value, OMAP4_CONTROL_PBIASLITE); - add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K, - IORESOURCE_MEM, &mmc_device); + omap44xx_add_mmc1(&mmc_device); gpmc_generic_init(0x10); -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox