From a11c0b85dc3664bb3c1e781137118730c8f619ab Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Sun, 27 May 2007 16:51:48 +0200 Subject: Motion-PRO: Add LED support. Signed-off-by: Jan Wrobel Signed-off-by: Marian Balakowicz Acked-by: Bartlomiej Sieka --- board/motionpro/motionpro.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'board/motionpro') diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index 887aadeeed..98357c7f42 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -33,6 +33,10 @@ #include #endif +#if defined(CONFIG_STATUS_LED) +#include +#endif /* CONFIG_STATUS_LED */ + /* Kollmorgen DPR initialization data */ struct init_elem { unsigned long addr; @@ -180,3 +184,29 @@ void ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); } #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */ + + +#if defined(CONFIG_STATUS_LED) +void __led_init (led_id_t regaddr, int state) +{ + *((vu_long *) regaddr) |= ENABLE_GPIO_OUT; + + if (state == STATUS_LED_ON) + *((vu_long *) regaddr) |= LED_ON; + else + *((vu_long *) regaddr) &= ~LED_ON; +} + +void __led_set (led_id_t regaddr, int state) +{ + if (state == STATUS_LED_ON) + *((vu_long *) regaddr) |= LED_ON; + else + *((vu_long *) regaddr) &= ~LED_ON; +} + +void __led_toggle (led_id_t regaddr) +{ + *((vu_long *) regaddr) ^= LED_ON; +} +#endif /* CONFIG_STATUS_LED */ -- cgit v1.2.1 From c75e639630cc132dc19cd1ecda5922c0db0bfbba Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Sun, 27 May 2007 16:55:23 +0200 Subject: Motion-PRO: Add displaying of CPLD revision information during boot. Signed-off-by: Jan Wrobel Acked-by: Bartlomiej Sieka --- board/motionpro/motionpro.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'board/motionpro') diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index 98357c7f42..1729ae7416 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -173,7 +173,8 @@ long int initdram (int board_type) int checkboard (void) { - puts("Board: Promess Motion-PRO board\n"); + uchar rev = *(vu_char *)CPLD_REV_REGISTER; + printf("Board: Promess Motion-PRO board (CPLD rev. 0x%02x)\n", rev); return 0; } -- cgit v1.2.1 From c00125e07c1ebc125bab40e1e18bceed8be0c162 Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Sun, 27 May 2007 16:58:45 +0200 Subject: MPC5XXX, Motion-PRO: Fix PHY initialization problem. After being reset in mpc5xxx_fec_init_phy(), PHY goes into FX mode, in which networking does not function. This commit switches PHY to TX mode by clearing the FX_SEL bit of Mode Control Register. It also reverses commit 008861a2f3ef2c062744d733787c7e530a1b8761, i.e., a temporary workaround. Signed-off-by: Grzegorz Bernacki Acked-by: Bartlomiej Sieka --- board/motionpro/motionpro.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'board/motionpro') diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index 1729ae7416..b05e2ab1cd 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -28,7 +28,7 @@ #include #include - +#include #if defined(CONFIG_OF_FLAT_TREE) #include #endif @@ -82,6 +82,22 @@ int board_early_init_r(void) } +/* + * Additional PHY intialization. After being reset in mpc5xxx_fec_init_phy(), + * PHY goes into FX mode. To take it out of the FX mode and switch into + * desired TX operation, one needs to clear the FX_SEL bit of Mode Control + * Register. + */ +void reset_phy(void) +{ + unsigned short mode_control; + + miiphy_read("FEC ETHERNET", CONFIG_PHY_ADDR, 0x15, &mode_control); + miiphy_write("FEC ETHERNET", CONFIG_PHY_ADDR, 0x15, + mode_control & 0xfffe); + return; +} + #ifndef CFG_RAMBOOT /* * Helper function to initialize SDRAM controller. -- cgit v1.2.1 From 7049288fb1f16f1b317140226cdebd07bd416395 Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Sun, 27 May 2007 17:26:46 +0200 Subject: Motion-PRO: Code cleanup, fix of a typo in OF_STDOUT_PATH. Signed-off-by: Bartlomiej Sieka --- board/motionpro/motionpro.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'board/motionpro') diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index b05e2ab1cd..40d304b7cc 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -102,7 +102,7 @@ void reset_phy(void) /* * Helper function to initialize SDRAM controller. */ -static void sdram_start (int hi_addr) +static void sdram_start(int hi_addr) { long hi_addr_bit = hi_addr ? 0x01000000 : 0; @@ -134,7 +134,7 @@ static void sdram_start (int hi_addr) /* * Initalize SDRAM - configure SDRAM controller, detect memory size. */ -long int initdram (int board_type) +long int initdram(int board_type) { ulong dramsize = 0; #ifndef CFG_RAMBOOT @@ -187,7 +187,7 @@ long int initdram (int board_type) } -int checkboard (void) +int checkboard(void) { uchar rev = *(vu_char *)CPLD_REV_REGISTER; printf("Board: Promess Motion-PRO board (CPLD rev. 0x%02x)\n", rev); @@ -204,7 +204,7 @@ void ft_board_setup(void *blob, bd_t *bd) #if defined(CONFIG_STATUS_LED) -void __led_init (led_id_t regaddr, int state) +void __led_init(led_id_t regaddr, int state) { *((vu_long *) regaddr) |= ENABLE_GPIO_OUT; @@ -214,7 +214,7 @@ void __led_init (led_id_t regaddr, int state) *((vu_long *) regaddr) &= ~LED_ON; } -void __led_set (led_id_t regaddr, int state) +void __led_set(led_id_t regaddr, int state) { if (state == STATUS_LED_ON) *((vu_long *) regaddr) |= LED_ON; @@ -222,7 +222,7 @@ void __led_set (led_id_t regaddr, int state) *((vu_long *) regaddr) &= ~LED_ON; } -void __led_toggle (led_id_t regaddr) +void __led_toggle(led_id_t regaddr) { *((vu_long *) regaddr) ^= LED_ON; } -- cgit v1.2.1