From be0db3e3141c6c6b4e232b51091f35a284cc54e5 Mon Sep 17 00:00:00 2001 From: Matthias Fuchs Date: Mon, 26 Oct 2009 09:58:45 +0100 Subject: ppc4xx: Initialize magnetic couplers in PLU405 This patch fixes an ugly behavior of the IL712 magnetic couplers as used on PLU405. These parts will remember their last state over a power cycle which might cause unwanted behavior. Signed-off-by: Matthias Fuchs Signed-off-by: Stefan Roese --- board/esd/plu405/plu405.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'board') diff --git a/board/esd/plu405/plu405.c b/board/esd/plu405/plu405.c index f14ef7a20..c733587b2 100644 --- a/board/esd/plu405/plu405.c +++ b/board/esd/plu405/plu405.c @@ -26,6 +26,7 @@ #include #include #include +#include #undef FPGA_DEBUG @@ -61,6 +62,34 @@ au_image_t au_image[] = { int N_AU_IMAGES = (sizeof(au_image) / sizeof(au_image[0])); +/* + * generate a short spike on the CAN tx line + * to bring the couplers in sync + */ +void init_coupler(u32 addr) +{ + struct sja1000_basic_s *ctrl = (struct sja1000_basic_s *)addr; + + /* reset */ + out_8(&ctrl->cr, CR_RR); + + /* dominant */ + out_8(&ctrl->btr0, 0x00); /* btr setup is required */ + out_8(&ctrl->btr1, 0x14); /* we use 1Mbit/s */ + out_8(&ctrl->oc, OC_TP1 | OC_TN1 | OC_POL1 | + OC_TP0 | OC_TN0 | OC_POL0 | OC_MODE1); + out_8(&ctrl->cr, 0x00); + + /* delay */ + in_8(&ctrl->cr); + in_8(&ctrl->cr); + in_8(&ctrl->cr); + in_8(&ctrl->cr); + + /* reset */ + out_8(&ctrl->cr, CR_RR); +} + /* Prototypes */ int gunzip(void *, int, unsigned char *, unsigned long *); @@ -214,6 +243,13 @@ int misc_init_r(void) out_8((void *)DUART1_BA + 1, fctr); /* write FCTR */ out_8((void *)DUART1_BA + 3, 0); /* write LCR */ + /* + * Init magnetic couplers + */ + if (!getenv("noinitcoupler")) { + init_coupler(CAN0_BA); + init_coupler(CAN1_BA); + } return 0; } -- cgit v1.2.3 From 3ffc0d61bad7d986e344ce7062b37c5c8f04fb0e Mon Sep 17 00:00:00 2001 From: Matthias Fuchs Date: Tue, 27 Oct 2009 19:58:09 +0100 Subject: ppc4xx: Initialize magnetic coupler on VOM405 boards This patch fixes an ugly behavior of the IL712 magnetic coupler as used on VOM405. These parts will remember their last state over a power cycle which might cause unwanted behavior. Signed-off-by: Matthias Fuchs Signed-off-by: Stefan Roese --- board/esd/vom405/vom405.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'board') diff --git a/board/esd/vom405/vom405.c b/board/esd/vom405/vom405.c index fb4802265..de350369c 100644 --- a/board/esd/vom405/vom405.c +++ b/board/esd/vom405/vom405.c @@ -26,11 +26,40 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; extern void lxt971_no_sleep(void); +/* + * generate a short spike on the CAN tx line + * to bring the couplers in sync + */ +void init_coupler(u32 addr) +{ + struct sja1000_basic_s *ctrl = (struct sja1000_basic_s *)addr; + + /* reset */ + out_8(&ctrl->cr, CR_RR); + + /* dominant */ + out_8(&ctrl->btr0, 0x00); /* btr setup is required */ + out_8(&ctrl->btr1, 0x14); /* we use 1Mbit/s */ + out_8(&ctrl->oc, OC_TP1 | OC_TN1 | OC_POL1 | + OC_TP0 | OC_TN0 | OC_POL0 | OC_MODE1); + out_8(&ctrl->cr, 0x00); + + /* delay */ + in_8(&ctrl->cr); + in_8(&ctrl->cr); + in_8(&ctrl->cr); + in_8(&ctrl->cr); + + /* reset */ + out_8(&ctrl->cr, CR_RR); +} + int board_early_init_f (void) { /* @@ -77,6 +106,12 @@ int misc_init_r (void) gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize; gd->bd->bi_flashoffset = 0; + /* + * Init magnetic coupler + */ + if (!getenv("noinitcoupler")) + init_coupler(CAN_BA); + return (0); } -- cgit v1.2.3 From cada315100c88894b85972a91309a6f2413966b6 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Thu, 1 Oct 2009 23:55:17 +0200 Subject: mpc8260: move FDT memory node fixup into common CPU code. Signed-off-by: Marcel Ziswiler Tested-by: Heiko Schocher --- board/freescale/mpc8260ads/mpc8260ads.c | 13 ------------- board/ids8247/ids8247.c | 16 ---------------- board/keymile/mgcoge/mgcoge.c | 8 +------- board/muas3001/muas3001.c | 16 ---------------- cpu/mpc8260/cpu.c | 1 + 5 files changed, 2 insertions(+), 52 deletions(-) (limited to 'board') diff --git a/board/freescale/mpc8260ads/mpc8260ads.c b/board/freescale/mpc8260ads/mpc8260ads.c index 49a88bbdd..be5562610 100644 --- a/board/freescale/mpc8260ads/mpc8260ads.c +++ b/board/freescale/mpc8260ads/mpc8260ads.c @@ -550,24 +550,11 @@ void pci_init_board(void) #endif #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_blob_update(void *blob, bd_t *bd) -{ - int ret; - - ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); - - if (ret < 0) { - printf("ft_blob_update(): cannot set /memory/reg " - "property err:%s\n", fdt_strerror(ret)); - } -} - void ft_board_setup(void *blob, bd_t *bd) { ft_cpu_setup(blob, bd); #ifdef CONFIG_PCI ft_pci_setup(blob, bd); #endif - ft_blob_update(blob, bd); } #endif diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c index 79fe9da5b..d621833cc 100644 --- a/board/ids8247/ids8247.c +++ b/board/ids8247/ids8247.c @@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand) #endif /* CONFIG_CMD_NAND */ #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) -/* - * update "memory" property in the blob - */ -void ft_blob_update(void *blob, bd_t *bd) -{ - int ret; - - ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); - - if (ret < 0) { - printf("ft_blob_update(): cannot set /memory/reg " - "property err:%s\n", fdt_strerror(ret)); - } -} - void ft_board_setup(void *blob, bd_t *bd) { ft_cpu_setup( blob, bd); - ft_blob_update(blob, bd); } #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c index b16a01ccc..932a80547 100644 --- a/board/keymile/mgcoge/mgcoge.c +++ b/board/keymile/mgcoge/mgcoge.c @@ -312,11 +312,10 @@ int hush_init_var (void) #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) /* - * update "memory" property in the blob + * update "flash" property in the blob */ void ft_blob_update (void *blob, bd_t *bd) { - ulong memory_data[2] = {0}; ulong *flash_data = NULL; ulong flash_reg[6] = {0}; flash_info_t *info; @@ -324,11 +323,6 @@ void ft_blob_update (void *blob, bd_t *bd) int size; int i = 0; - memory_data[0] = cpu_to_be32 (bd->bi_memstart); - memory_data[1] = cpu_to_be32 (bd->bi_memsize); - fdt_set_node_and_value (blob, "/memory", "reg", memory_data, - sizeof (memory_data)); - len = fdt_get_node_and_value (blob, "/localbus", "ranges", (void *)&flash_data); diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c index 36caed813..e0a7f32fd 100644 --- a/board/muas3001/muas3001.c +++ b/board/muas3001/muas3001.c @@ -308,25 +308,9 @@ int board_early_init_r (void) void ft_blob_update (void *blob, bd_t *bd) { int ret, nodeoffset = 0; - ulong memory_data[2] = {0}; ulong flash_data[4] = {0}; ulong speed = 0; - memory_data[0] = cpu_to_be32 (bd->bi_memstart); - memory_data[1] = cpu_to_be32 (bd->bi_memsize); - - nodeoffset = fdt_path_offset (blob, "/memory"); - if (nodeoffset >= 0) { - ret = fdt_setprop (blob, nodeoffset, "reg", memory_data, - sizeof(memory_data)); - if (ret < 0) - printf ("ft_blob_update): cannot set /memory/reg " - "property err:%s\n", fdt_strerror (ret)); - } else { - /* memory node is required in dts */ - printf ("ft_blob_update(): cannot find /memory node " - "err:%s\n", fdt_strerror(nodeoffset)); - } /* update Flash addr, size */ flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE); flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE); diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c index 17e624872..aedbf297a 100644 --- a/cpu/mpc8260/cpu.c +++ b/cpu/mpc8260/cpu.c @@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd) "timebase-frequency", OF_TBCLK, 1); do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, "clock-frequency", bd->bi_intfreq, 1); + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); } #endif /* CONFIG_OF_LIBFDT */ -- cgit v1.2.3 From 01826abc02ce160501534788e63629ccbe31b05c Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Thu, 12 Nov 2009 11:46:07 +0200 Subject: OMAP3: pandora: fix booting without serial attached When the board is booted without serial cable attached (which is how most of them will be used) UART RX is left floating and sometimes picks noise, which interrupts countdown and enters U-Boot prompt instead of booting the kernel. Fix this by setting up internal pullup on UART RX pin. This does not prevent serial from working as the internal pullup is weak. Signed-off-by: Grazvydas Ignotas --- board/pandora/pandora.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/pandora/pandora.h b/board/pandora/pandora.h index 5bfa0f9e2..f0ad16b0a 100644 --- a/board/pandora/pandora.h +++ b/board/pandora/pandora.h @@ -219,7 +219,8 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(UART2_RX), (IEN | PTD | EN | M4)) /*GPIO_147,*/\ /*UART2_RX*/\ /*Serial Interface (Peripheral boot, Linux console, on AV connector)*/\ - MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX*/\ + /*RX pulled up to avoid noise when nothing is connected to serial port*/\ + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTU | EN | M0)) /*UART3_RX*/\ MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX*/\ /*LEDs (Controlled by OMAP)*/\ MUX_VAL(CP(MMC1_DAT6), (IDIS | PTD | DIS | M4)) /*GPIO_128*/\ -- cgit v1.2.3