Support for MPC8308ERDB board
cover Support for MPC8308ERDB board
These patches add support for MPC8308 based development board from Freescale.
PATCH 1/2 mpc8308: support for Freescale MPC8308 cpu
This patch adds basic support for Freescale MPC8308 CPU. Serial ports, NOR flash and integrated Ethernet controllers are supported. PCI Express is also supported. eSDHC, NAND and USB may work but aren't tested (using ULPI PHY requires additional patch).
--- arch/powerpc/cpu/mpc83xx/cpu.c | 1 + arch/powerpc/cpu/mpc83xx/speed.c | 3 ++- arch/powerpc/include/asm/immap_83xx.h | 15 +++++++++++++-- arch/powerpc/include/asm/mpc8xxx_spi.h | 3 ++- include/mpc83xx.h | 20 ++++++++++++++++---- 5 files changed, 34 insertions(+), 8 deletions(-)
arch/powerpc/cpu/mpc83xx/cpu.c +1 -0
@@ -55,6 +55,7 @@ int checkcpu(void)char name[15 ];u32 partid; } cpu_type_list [] = { +CPU_TYPE_ENTRY (8308 ),CPU_TYPE_ENTRY (8311 ),CPU_TYPE_ENTRY (8313 ), CPU_TYPE_ENTRY(8314),
arch/powerpc/cpu/mpc83xx/speed.c +2 -1
@@ -202,7 +202,8 @@ int get_clocks(void) }#endif -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315 ) +#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || \ + defined(CONFIG_MPC8315 ) || defined(CONFIG_MPC8308 )switch ((sccr &SCCR_TSEC2CM ) >>SCCR_TSEC2CM_SHIFT ) {case 0 : tsec2_clk =0 ;
arch/powerpc/include/asm/immap_83xx.h +13 -2
@@ -73,7 +73,11 @@ typedef struct sysconf83xx {u32 obir;/* Output Buffer Impedance Register */ u8 res8[0xC ];u32 pecr1;/* PCI Express control register 1 */ +#ifdef CONFIG_MPC8308 +u32 sdhccr;/* eSDHC Control Registers for MPC8308 */ +#else u32 pecr2;/* PCI Express control register 2 */ +#endif u8 res9[0xB8 ]; } sysconf83xx_t;
@@ -589,7 +593,14 @@ typedef struct sdhc83xx {* SerDes */ typedef struct serdes83xx { -u8 fixme[0x100 ]; +u32 srdscr0; +u32 srdscr1; +u32 srdscr2; +u32 srdscr3; +u32 srdscr4; +u8 res0[0xc ]; +u32 srdsrstctl; +u8 res1[0xdc ]; }serdes83xx_t ;/*
@@ -691,7 +702,7 @@ typedef struct immap { u8 res7[0xC0000]; } immap_t; -#elif defined(CONFIG_MPC8315) +#elif defined(CONFIG_MPC8315) || defined(CONFIG_MPC8308) typedef struct immap { sysconf83xx_t sysconf; /* System configuration */ wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
arch/powerpc/include/asm/mpc8xxx_spi.h +2 -1
@@ -27,9 +27,10 @@#include <asm/types.h> -#if defined(CONFIG_MPC834x) || \ +#if defined(CONFIG_MPC8308) || \ defined(CONFIG_MPC8313) || \ defined(CONFIG_MPC8315) || \ + defined(CONFIG_MPC834x) || \ defined(CONFIG_MPC837x) typedef struct spi8xxx {
include/mpc83xx.h +16 -4
@@ -1,5 +1,5 @@/* -* Copyright (C) 2004-2007 Freescale Semiconductor, Inc. +* Copyright (C) 2004-2007, 2010 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project.
@@ -65,6 +65,7 @@#define PARTID_NO_E (spridr) ((spridr & 0xFFFE0000) >> 16)#define SPR_FAMILY (spridr) ((spridr & 0xFFF00000) >> 20) +#define SPR_8308 0x8100#define SPR_831X_FAMILY 0x80B#define SPR_8311 0x80B2#define SPR_8313 0x80B0
@@ -473,7 +474,7 @@#define HRCWL_CE_TO_PLL_1X30 0x0000001E#define HRCWL_CE_TO_PLL_1X31 0x0000001F -#elif defined(CONFIG_MPC8315 ) +#elif defined(CONFIG_MPC8315 ) || defined(CONFIG_MPC8308 )#define HRCWL_SVCOD 0x30000000#define HRCWL_SVCOD_SHIFT 28#define HRCWL_SVCOD_DIV_2 0x00000000
@@ -734,8 +735,8 @@#define SCCR_USBDRCM_2 0x00200000#define SCCR_USBDRCM_3 0x00300000 -#elif defined(CONFIG_MPC8315 ) -/* SCCR bits - MPC8315 specific */ +#elif defined(CONFIG_MPC8315 ) || defined(CONFIG_MPC8308 ) +/* SCCR bits - MPC8315/MPC8308 specific */ #define SCCR_TSEC1CM 0xc0000000#define SCCR_TSEC1CM_SHIFT 30#define SCCR_TSEC1CM_0 0x00000000
@@ -750,6 +751,15 @@#define SCCR_TSEC2CM_2 0x20000000#define SCCR_TSEC2CM_3 0x30000000 +#if defined(CONFIG_MPC8308 ) +#define SCCR_SDHCCM 0x0c000000 +#define SCCR_SDHCCM_SHIFT 26 +#define SCCR_SDHCCM_0 0x00000000 +#define SCCR_SDHCCM_1 0x04000000 +#define SCCR_SDHCCM_2 0x08000000 +#define SCCR_SDHCCM_3 0x0c000000 +#endif +#define SCCR_USBDRCM 0x00c00000#define SCCR_USBDRCM_SHIFT 22#define SCCR_USBDRCM_0 0x00000000
@@ -757,6 +767,7 @@#define SCCR_USBDRCM_2 0x00800000#define SCCR_USBDRCM_3 0x00c00000 +#if defined(CONFIG_MPC8315 )#define SCCR_SATA1CM 0x00003000#define SCCR_SATA1CM_SHIFT 12#define SCCR_SATACM 0x00003c00
@@ -765,6 +776,7 @@#define SCCR_SATACM_1 0x00001400#define SCCR_SATACM_2 0x00002800#define SCCR_SATACM_3 0x00003c00 +#endif #define SCCR_TDMCM 0x00000030#define SCCR_TDMCM_SHIFT 4
Signature · 1 line
1.6.2.5
PATCH 1/2 mpc8308: support for Freescale MPC8308 cpu
Dear Ilya Yanok,
Quoted 6 lines · In message <[email protected]> you wrote:
This patch adds basic support for Freescale MPC8308 CPU. Serial ports, NOR flash and integrated Ethernet controllers are supported. PCI Express is also supported. eSDHC, NAND and USB may work but aren't tested (using ULPI PHY requires additional patch).
Signed-off-by Ilya Yanok <[email protected]>
...
arch/powerpc/cpu/mpc83xx/speed.c int get_clocks(void) · line 206
Quoted 3 lines
arch/powerpc/cpu/mpc83xx/speed.c +2
-1-#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315 ) +#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || \ + defined(CONFIG_MPC8315 ) || defined(CONFIG_MPC8308 )
Please sort this list.
Review
Quoted 2 lines
(quoted diff) +1
-1-#elif defined(CONFIG_MPC8315) +#elif defined(CONFIG_MPC8315) || defined(CONFIG_MPC8308)
Ditto.
Review
Quoted 2 lines
(quoted diff) +1
-1-#elif defined(CONFIG_MPC8315) +#elif defined(CONFIG_MPC8315) || defined(CONFIG_MPC8308)
Ditto. ... and so on.
include/mpc83xx.h line 761
Quoted 8 lines
include/mpc83xx.h +8
-0+#if defined(CONFIG_MPC8308 ) +#define SCCR_SDHCCM 0x0c000000 +#define SCCR_SDHCCM_SHIFT 26 +#define SCCR_SDHCCM_0 0x00000000 +#define SCCR_SDHCCM_1 0x04000000 +#define SCCR_SDHCCM_2 0x08000000 +#define SCCR_SDHCCM_3 0x0c000000 +#endif
Would it make sense to write this as:
And: why do we need the #ifdef? Unused defines should not hurt?
#define SCCR_SDHCCM_MASK 0x0c000000 /* is it a mask? */ #define SCCR_SDHCCM_SHIFT 26 #define SCCR_SDHCCM(arg) ((arg)<<SCCR_SDHCCM_SHIFT)
include/mpc83xx.h line 768
Quoted 6 lines
#define
SCCR_USBDRCM0x00c00000
#defineSCCR_USBDRCM_SHIFT22
#defineSCCR_USBDRCM_00x00000000include/mpc83xx.h +0
-0@@ -757,6 +767,7 @@#define SCCR_USBDRCM_2 0x00800000#define SCCR_USBDRCM_3 0x00c00000
Ah, I see you just follow precedent code. If Kim accepts this, I'm fine with it, too.
include/mpc83xx.h line 779
Quoted 9 lines
include/mpc83xx.h +2
-0+#if defined(CONFIG_MPC8315 )#define SCCR_SATA1CM 0x00003000#define SCCR_SATA1CM_SHIFT 12#define SCCR_SATACM 0x00003c00@@ -765,6 +776,7 @@#define SCCR_SATACM_1 0x00001400#define SCCR_SATACM_2 0x00002800#define SCCR_SATACM_3 0x00003c00 +#endif
Do we need that #ifdef? Ok, the #defines don't apply to the 8308, but do they hurt if they are just there, unused?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The world is no nursery. - Sigmund Freud
PATCH 1/2 mpc8308: support for Freescale MPC8308 cpu
Dear Wolfgang,
thanks for your review.
Quoted 7 lines · Wolfgang Denk
Quoted 7 lines
This patch adds basic support for Freescale MPC8308 CPU. Serial ports, NOR flash and integrated Ethernet controllers are supported. PCI Express is also supported. eSDHC, NAND and USB may work but aren't tested (using ULPI PHY requires additional patch).
Signed-off-by Ilya Yanok<[email protected]>
Quoted 8 lines
...
arch/powerpc/cpu/mpc83xx/speed.c int get_clocks(void) · line 206
Quoted 4 lines
arch/powerpc/cpu/mpc83xx/speed.c +2
-1-#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315 ) +#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || \ + defined(CONFIG_MPC8315 ) || defined(CONFIG_MPC8308 )Please sort this list.
Fixed.
Quoted 11 lines
include/mpc83xx.h line 761
Quoted 9 lines
include/mpc83xx.h +8
-0+#if defined(CONFIG_MPC8308 ) +#define SCCR_SDHCCM 0x0c000000 +#define SCCR_SDHCCM_SHIFT 26 +#define SCCR_SDHCCM_0 0x00000000 +#define SCCR_SDHCCM_1 0x04000000 +#define SCCR_SDHCCM_2 0x08000000 +#define SCCR_SDHCCM_3 0x0c000000 +#endif Would it make sense to write this as:
Quoted 7 lines
And: why do we need the #ifdef? Unused defines should not hurt?
#define SCCR_SDHCCM_MASK 0x0c000000 /* is it a mask? */ #define SCCR_SDHCCM_SHIFT 26 #define SCCR_SDHCCM(arg) ((arg)<<SCCR_SDHCCM_SHIFT)
As you already mentioned I'm just following the style used in this file.
Quoted 4 lines
Quoted 4 lines
+#if
defined(CONFIG_MPC8315)
#defineSCCR_SATA1CM0x00003000
#defineSCCR_SATA1CM_SHIFT12
#defineSCCR_SATACM0x00003c00
Quoted 9 lines
include/mpc83xx.h line 780
Quoted 6 lines
include/mpc83xx.h +1
-0@@ -765,6 +776,7 @@#define SCCR_SATACM_1 0x00001400#define SCCR_SATACM_2 0x00002800#define SCCR_SATACM_3 0x00003c00 +#endif Do we need that #ifdef? Ok, the #defines don't apply to the 8308, but do they hurt if they are just there, unused?
Well, it seems to be safer not to have unused defines so that you can't erroneously use some define not applicable for current CPU, but if you wish I'll remove these ifdefs.
Regards, Ilya.
PATCH 1/2 mpc8308: support for Freescale MPC8308 cpu
Dear Ilya,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Do we need that #ifdef? Ok, the #defines don't apply to the 8308, but do they hurt if they are just there, unused?
Well, it seems to be safer not to have unused defines so that you can't erroneously use some define not applicable for current CPU, but if you wish I'll remove these ifdefs.
Please remove them.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de If you can't beat it or corrupt it, you pretend it was your idea in the first place. - Terry Pratchett, _Guards! Guards!_
PATCH 1/2 mpc8308: support for Freescale MPC8308 cpu
This patch adds basic support for Freescale MPC8308 CPU. Serial ports, NOR flash and integrated Ethernet controllers are supported. PCI Express is also supported. eSDHC, NAND and USB may work but aren't tested (using ULPI PHY requires additional patch).
--- arch/powerpc/cpu/mpc83xx/cpu.c | 1 + arch/powerpc/cpu/mpc83xx/speed.c | 23 +++++++++++++++-------- arch/powerpc/include/asm/global_data.h | 6 ++++-- arch/powerpc/include/asm/immap_83xx.h | 15 +++++++++++++-- arch/powerpc/include/asm/mpc8xxx_spi.h | 3 ++- include/mpc83xx.h | 27 +++++++++++++++++++-------- 6 files changed, 54 insertions(+), 21 deletions(-)
arch/powerpc/cpu/mpc83xx/cpu.c +1 -0
@@ -55,6 +55,7 @@ int checkcpu(void)char name[15 ];u32 partid; } cpu_type_list [] = { +CPU_TYPE_ENTRY (8308 ),CPU_TYPE_ENTRY (8311 ),CPU_TYPE_ENTRY (8313 ), CPU_TYPE_ENTRY(8314),
arch/powerpc/cpu/mpc83xx/speed.c +15 -8
@@ -100,7 +100,8 @@ int get_clocks(void)u32 lcrr;u32 csb_clk; -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)u32 tsec1_clk;u32 tsec2_clk;u32 usbdr_clk;
@@ -132,7 +133,8 @@ int get_clocks(void)u32 qe_clk;u32 brg_clk;#endif -#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC831x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC837x)u32 pciexp1_clk;u32 pciexp2_clk;#endif
@@ -164,7 +166,8 @@ int get_clocks(void) sccr = im->clk.sccr; -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)switch ((sccr &SCCR_TSEC1CM ) >>SCCR_TSEC1CM_SHIFT ) {case 0 : tsec1_clk =0 ;
@@ -202,7 +205,8 @@ int get_clocks(void) }#endif -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315 ) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC8315 ) || \ + defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)switch ((sccr &SCCR_TSEC2CM ) >>SCCR_TSEC2CM_SHIFT ) {case 0 : tsec2_clk =0 ;
@@ -319,7 +323,7 @@ int get_clocks(void) i2c1_clk = csb_clk;#elif defined(CONFIG_MPC832x) i2c1_clk = enc_clk; -#elif defined(CONFIG_MPC831x) +#elif defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) i2c1_clk = enc_clk;#elif defined(CONFIG_FSL_ESDHC ) i2c1_clk = sdhc_clk;
@@ -328,7 +332,8 @@ int get_clocks(void) i2c2_clk = csb_clk;/* i2c-2 clk is equal to csb clk */ #endif -#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC831x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC837x)switch ((sccr &SCCR_PCIEXP1CM ) >>SCCR_PCIEXP1CM_SHIFT ) {case 0 : pciexp1_clk =0 ;
@@ -444,7 +449,8 @@ int get_clocks(void)#endif gd->csb_clk = csb_clk; -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) gd->tsec1_clk = tsec1_clk; gd->tsec2_clk = tsec2_clk; gd->usbdr_clk = usbdr_clk;
@@ -525,7 +531,8 @@ int do_clocks (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])#if defined(CONFIG_FSL_ESDHC )printf (" SDHC: %-4s MHz\n" ,strmhz (buf, gd->sdhc_clk));#endif -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)printf (" TSEC1: %-4s MHz\n" ,strmhz (buf, gd->tsec1_clk));printf (" TSEC2: %-4s MHz\n" ,strmhz (buf, gd->tsec2_clk));printf (" USB DR: %-4s MHz\n" ,strmhz (buf, gd->usbdr_clk));
arch/powerpc/include/asm/global_data.h +4 -2
@@ -60,7 +60,8 @@ typedef struct global_data {#if defined(CONFIG_MPC83xx)/* There are other clocks in the MPC83XX */ u32 csb_clk; -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)u32 tsec1_clk;u32 tsec2_clk;u32 usbdr_clk;
@@ -76,7 +77,8 @@ typedef struct global_data {u32 lbiu_clk;u32 lclk_clk;u32 pci_clk; -#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC831x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC837x)u32 pciexp1_clk;u32 pciexp2_clk;#endif
arch/powerpc/include/asm/immap_83xx.h +13 -2
@@ -73,7 +73,11 @@ typedef struct sysconf83xx {u32 obir;/* Output Buffer Impedance Register */ u8 res8[0xC ];u32 pecr1;/* PCI Express control register 1 */ +#ifdef CONFIG_MPC8308 +u32 sdhccr;/* eSDHC Control Registers for MPC8308 */ +#else u32 pecr2;/* PCI Express control register 2 */ +#endif u8 res9[0xB8 ]; } sysconf83xx_t;
@@ -589,7 +593,14 @@ typedef struct sdhc83xx {* SerDes */ typedef struct serdes83xx { -u8 fixme[0x100 ]; +u32 srdscr0; +u32 srdscr1; +u32 srdscr2; +u32 srdscr3; +u32 srdscr4; +u8 res0[0xc ]; +u32 srdsrstctl; +u8 res1[0xdc ]; }serdes83xx_t ;/*
@@ -691,7 +702,7 @@ typedef struct immap { u8 res7[0xC0000]; } immap_t; -#elif defined(CONFIG_MPC8315) +#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315) typedef struct immap { sysconf83xx_t sysconf; /* System configuration */ wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
arch/powerpc/include/asm/mpc8xxx_spi.h +2 -1
@@ -27,9 +27,10 @@#include <asm/types.h> -#if defined(CONFIG_MPC834x) || \ +#if defined(CONFIG_MPC8308) || \ defined(CONFIG_MPC8313) || \ defined(CONFIG_MPC8315) || \ + defined(CONFIG_MPC834x) || \ defined(CONFIG_MPC837x) typedef struct spi8xxx {
include/mpc83xx.h +19 -8
@@ -1,5 +1,5 @@/* -* Copyright (C) 2004-2007 Freescale Semiconductor, Inc. +* Copyright (C) 2004-2007, 2010 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project.
@@ -65,6 +65,7 @@#define PARTID_NO_E (spridr) ((spridr & 0xFFFE0000) >> 16)#define SPR_FAMILY (spridr) ((spridr & 0xFFF00000) >> 20) +#define SPR_8308 0x8100#define SPR_831X_FAMILY 0x80B#define SPR_8311 0x80B2#define SPR_8313 0x80B0
@@ -115,8 +116,9 @@#define SPCR_TSEC2EP 0x00000003/* TSEC2 emergency priority */ #define SPCR_TSEC2EP_SHIFT (31-31) -#elif defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) -/* SPCR bits - MPC831x and MPC837x specific */ +#elif defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC837x) +/* SPCR bits - MPC8308, MPC831x and MPC837x specific */ #define SPCR_TSECDP 0x00003000/* TSEC data priority */ #define SPCR_TSECDP_SHIFT (31-19)#define SPCR_TSECBDP 0x00000C00/* TSEC buffer descriptor priority */
@@ -473,7 +475,7 @@#define HRCWL_CE_TO_PLL_1X30 0x0000001E#define HRCWL_CE_TO_PLL_1X31 0x0000001F -#elif defined(CONFIG_MPC8315 ) +#elif defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC8315 )#define HRCWL_SVCOD 0x30000000#define HRCWL_SVCOD_SHIFT 28#define HRCWL_SVCOD_DIV_2 0x00000000
@@ -541,7 +543,8 @@#define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000#define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000 -#if defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC837x)#define HRCWH_ROM_LOC_NAND_SP_8BIT 0x00100000#define HRCWH_ROM_LOC_NAND_SP_16BIT 0x00200000#define HRCWH_ROM_LOC_NAND_LP_8BIT 0x00500000
@@ -592,7 +595,8 @@/* RSR - Reset Status Register */ -#if defined(CONFIG_MPC831x) || defined(CONFIG_MPC837x) +#if defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC831x) || \ + defined(CONFIG_MPC837x)#define RSR_RSTSRC 0xF0000000/* Reset source */ #define RSR_RSTSRC_SHIFT 28#else
@@ -734,8 +738,8 @@#define SCCR_USBDRCM_2 0x00200000#define SCCR_USBDRCM_3 0x00300000 -#elif defined(CONFIG_MPC8315 ) -/* SCCR bits - MPC8315 specific */ +#elif defined(CONFIG_MPC8308 ) || defined(CONFIG_MPC8315 ) +/* SCCR bits - MPC8315/MPC8308 specific */ #define SCCR_TSEC1CM 0xc0000000#define SCCR_TSEC1CM_SHIFT 30#define SCCR_TSEC1CM_0 0x00000000
@@ -750,6 +754,13 @@#define SCCR_TSEC2CM_2 0x20000000#define SCCR_TSEC2CM_3 0x30000000 +#define SCCR_SDHCCM 0x0c000000 +#define SCCR_SDHCCM_SHIFT 26 +#define SCCR_SDHCCM_0 0x00000000 +#define SCCR_SDHCCM_1 0x04000000 +#define SCCR_SDHCCM_2 0x08000000 +#define SCCR_SDHCCM_3 0x0c000000 +#define SCCR_USBDRCM 0x00c00000#define SCCR_USBDRCM_SHIFT 22#define SCCR_USBDRCM_0 0x00000000
Signature · 1 line
1.6.2.5
Kim Phillips
AppliedPATCH 1/2 mpc8308: support for Freescale MPC8308 cpu
Quoted 7 lines · On Mon, 28 Jun 2010 16:44:33 +0400 Ilya Yanok <[email protected]> wrote:
This patch adds basic support for Freescale MPC8308 CPU. Serial ports, NOR flash and integrated Ethernet controllers are supported. PCI Express is also supported. eSDHC, NAND and USB may work but aren't tested (using ULPI PHY requires additional patch).
Signed-off-by Ilya Yanok <[email protected]>---
Applied.
Thanks,
Kim
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
In reply to Ilya YanokThis patch provides support for MPC8308ERDB development board from Freescale with a minimal set of features:
Dual UART is supported
NOR flash is supported
Both TSEC Ethernet controllers are supported
PCI Express initialization is supported
The following features are enabled in configuration but not fully tested:
I2C (used to get the board revision)
I2C-connected RTC
VSC7385 switch
--- MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8308erdb/Makefile | 52 +++ board/freescale/mpc8308erdb/config.mk | 1 + board/freescale/mpc8308erdb/mpc8308erdb.c | 154 ++++++++ board/freescale/mpc8308erdb/sdram.c | 126 +++++++ include/configs/MPC8308ERDB.h | 572 +++++++++++++++++++++++++++++ 7 files changed, 909 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mpc8308erdb/Makefile create mode 100644 board/freescale/mpc8308erdb/config.mk create mode 100644 board/freescale/mpc8308erdb/mpc8308erdb.c create mode 100644 board/freescale/mpc8308erdb/sdram.c create mode 100644 include/configs/MPC8308ERDB.h
MAKEALL +1 -0
@@ -359,6 +359,7 @@ LIST_8260=" \ LIST_83xx=" \ caddy2 \ kmeter1 \ + MPC8308ERDB \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \
Makefile +3 -0
@@ -2233,6 +2233,9 @@ TASREG_config : unconfig kmeter1_config: unconfig @$(MKCONFIG) kmeter1 powerpc mpc83xx kmeter1 keymile +MPC8308ERDB_config: unconfig + @$(MKCONFIG) -a MPC8308ERDB powerpc mpc83xx mpc8308erdb freescale + MPC8313ERDB_33_config \ MPC8313ERDB_66_config \ MPC8313ERDB_NAND_33_config \
board/freescale/mpc8308erdb/Makefile new file +52 -0
52 lines not on this page · raw message
board/freescale/mpc8308erdb/config.mk new file +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0xFE000000
board/freescale/mpc8308erdb/mpc8308erdb.c new file +154 -0
154 lines not on this page · raw message
board/freescale/mpc8308erdb/sdram.c new file +126 -0
126 lines not on this page · raw message
include/configs/MPC8308ERDB.h new file +572 -0
572 lines not on this page · raw message
Signature · 1 line
1.6.2.5
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Dear Ilya Yanok,
Quoted 11 lines · In message <[email protected]> you wrote:
This patch provides support for MPC8308ERDB development board from Freescale with a minimal set of features:
Dual UART is supported
NOR flash is supported
Both TSEC Ethernet controllers are supported
PCI Express initialization is supportedThe following features are enabled in configuration but not fully tested:
I2C (used to get the board revision)
I2C-connected RTC
VSC7385 switch
...
Quoted 5 lines
MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8308erdb/Makefile | 52 +++ board/freescale/mpc8308erdb/config.mk | 1 + board/freescale/mpc8308erdb/mpc8308erdb.c | 154 ++++++++
Quoted 8 lines
board/freescale/mpc8308erdb/sdram.c | 126 +++++++ include/configs/MPC8308ERDB.h | 572 +++++++++++++++++++++++++++++ 7 files changed, 909 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mpc8308erdb/Makefile create mode 100644 board/freescale/mpc8308erdb/config.mk create mode 100644 board/freescale/mpc8308erdb/mpc8308erdb.c create mode 100644 board/freescale/mpc8308erdb/sdram.c create mode 100644 include/configs/MPC8308ERDB.h
Entry to MAINTAINERS missing.
Makefile TASREG_config : unconfig · line 2237
Quoted 10 lines
Makefile +2
-0@@ -2233,6 +2233,9 @@ TASREG_config : unconfig kmeter1_config: unconfig @$(MKCONFIG) kmeter1 powerpc mpc83xx kmeter1 keymile +MPC8308ERDB_config: unconfig + @$(MKCONFIG) -a MPC8308ERDB powerpc mpc83xx mpc8308erdb freescale
NAK. Please rebase your code against the "next" branch. We don't accept any board entries to the top level Makefile any more. Please add to boards.cfg instead.
board/freescale/mpc8308erdb/mpc8308erdb.c line 5
Quoted 8 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +5
-0@@ -0,0 +1,154 @@ +/* +* Copyright (C) 2010 Freescale Semiconductor, Inc. +* Copyright (C) 2010 Ilya Yanok, Emcraft Systems, yanok at emcraft.com +* +* Author: Freescale unknown
Maybe "Initial author" ?
board/freescale/mpc8308erdb/mpc8308erdb.c line 46
Quoted 6 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +6
-0+int board_early_init_f (void ) +{ +immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; + +if (in_be32 (&im->pmc.pmccr1) &PMCCR1_POWER_OFF ) + gd->flags |=GD_FLG_SILENT ;
What exactly is this good for?
board/freescale/mpc8308erdb/mpc8308erdb.c line 128
Quoted 8 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +8
-0+/* +* Miscellaneous late-boot configurations +* +* If a VSC7385 microcode image is present, then upload it. +*/ +int misc_init_r (void ) +{ +int rc =0 ;
Please drop the variable.
board/freescale/mpc8308erdb/mpc8308erdb.c line 134
Quoted 5 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +5
-0+#ifdef CONFIG_VSC7385_IMAGE +if (vsc7385_upload_firmware ((void *)CONFIG_VSC7385_IMAGE , +CONFIG_VSC7385_IMAGE_SIZE )) { +puts ("Failure uploading VSC7385 microcode.\n" ); + rc =1 ;
return 1;
board/freescale/mpc8308erdb/mpc8308erdb.c line 138
Quoted 4 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +4
-0+ } +#endif + +return rc;
return 0;
board/freescale/mpc8308erdb/mpc8308erdb.c line 150
Quoted 3 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +3
-0+int board_eth_init (bd_t *bis) +{ +cpu_eth_init (bis);/* Initialize TSECs first */
I think it's wrong to ignore the return code here.
board/freescale/mpc8308erdb/mpc8308erdb.c line 154
Quoted 4 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +4
-0+return pci_eth_init (bis); +} + +
Please remove trailing empty lines.
Quoted 43 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +43
-0+/* Fixed sdram init -- doesn't use serial presence detect. +* +* This is useful for faster booting in configs where the RAM is unlikely +* to be changed, or for things like NAND booting where space is tight. +*/ +static long fixed_sdram (void ) +{ +immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; +u32 msize =CONFIG_SYS_DDR_SIZE *1024 *1024 ; +u32 msize_log2 =__ilog2 (msize); + +out_be32 (&im->sysconf.ddrlaw[0 ].bar, +CONFIG_SYS_DDR_SDRAM_BASE &0xfffff000 ); +out_be32 (&im->sysconf.ddrlaw[0 ].ar,LBLAWAR_EN | (msize_log2 -1 )); +out_be32 (&im->sysconf.ddrcdr,CONFIG_SYS_DDRCDR_VALUE ); + +/* +* Erratum DDR3 requires a 50ms delay after clearing DDRCDR[DDR_cfg], +* or the DDR2 controller may fail to initialize correctly. +*/ +udelay (50000 ); + +out_be32 (&im->ddr.csbnds[0 ].csbnds, (msize -1 ) >>24 ); +out_be32 (&im->ddr.cs_config[0 ],CONFIG_SYS_DDR_CS0_CONFIG ); + +/* Currently we use only one CS, so disable the other bank. */ +out_be32 (&im->ddr.cs_config[1 ],0 ); + +out_be32 (&im->ddr.sdram_clk_cntl,CONFIG_SYS_DDR_SDRAM_CLK_CNTL ); +out_be32 (&im->ddr.timing_cfg_3,CONFIG_SYS_DDR_TIMING_3 ); +out_be32 (&im->ddr.timing_cfg_1,CONFIG_SYS_DDR_TIMING_1 ); +out_be32 (&im->ddr.timing_cfg_2,CONFIG_SYS_DDR_TIMING_2 ); +out_be32 (&im->ddr.timing_cfg_0,CONFIG_SYS_DDR_TIMING_0 ); + +if (in_be32 (&im->pmc.pmccr1) &PMCCR1_POWER_OFF ) { +out_be32 (&im->ddr.sdram_cfg, +CONFIG_SYS_DDR_SDRAM_CFG |SDRAM_CFG_BI ); + }else { +out_be32 (&im->ddr.sdram_cfg,CONFIG_SYS_DDR_SDRAM_CFG ); + } + +out_be32 (&im->ddr.sdram_cfg2,CONFIG_SYS_DDR_SDRAM_CFG2 ); +out_be32 (&im->ddr.sdram_mode,CONFIG_SYS_DDR_MODE );
board/freescale/mpc8308erdb/mpc8308erdb.c line 88
Quoted 10 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +10
-0+out_be32 (&im->ddr.sdram_mode2,CONFIG_SYS_DDR_MODE2 ); + +out_be32 (&im->ddr.sdram_interval,CONFIG_SYS_DDR_INTERVAL ); +sync (); + +/* enable DDR controller */ +setbits_be32 (&im->ddr.sdram_cfg,SDRAM_CFG_MEM_EN ); +sync (); + +return msize;
Please test RAM and verify the size using get_mem_size().
Quoted 99 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +19
-0+} + +phys_size_t initdram (int board_type) +{ +immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; +u32 msize; + +if ((in_be32 (&im->sysconf.immrbar) &IMMRBAR_BASE_ADDR ) != (u32 )im) +return -1 ; + +/* DDR SDRAM */ + msize =fixed_sdram (); + +if (in_be32 (&im->pmc.pmccr1) &PMCCR1_POWER_OFF ) +resume_from_sleep (); + +/* return total bus SDRAM size(bytes) -- DDR */ +return msize; +}include/configs/MPC8308ERDB.h new file +74
-0@@ -0,0 +1,572 @@ +/* +* Copyright (C) 2009-2010 Freescale Semiconductor, Inc. +* Copyright (C) 2010 Ilya Yanok, Emcraft Systems, yanok at emcraft.com +* +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* +* High Level Configuration Options +*/ +#define CONFIG_E300 1/* E300 family */ +#define CONFIG_MPC83xx 1/* MPC83xx family */ +#define CONFIG_MPC831x 1/* MPC831x CPU family */ +#define CONFIG_MPC8308 1/* MPC8308 CPU specific */ +#define CONFIG_MPC8308ERDB 1/* MPC8308ERDB board specific */ + +#define CONFIG_MISC_INIT_R + +/* +* On-board devices +* +* TSEC1 is SoC TSEC +* TSEC2 is VSC switch +*/ +#define CONFIG_TSEC1 +#define CONFIG_VSC7385_ENET + +/* +* System Clock Setup +*/ +#define CONFIG_83XX_CLKIN 33333333/* in Hz */ +#define CONFIG_SYS_CLK_FREQ CONFIG_83XX_CLKIN + +/* +* Hardware Reset Configuration Word +* if CLKIN is 66.66MHz, then +* CSB = 133MHz, DDRC = 266MHz, LBC = 133MHz +* We choose the A type silicon as default, so the core is 400Mhz. +*/ +#define CONFIG_SYS_HRCW_LOW (\ + HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\ + HRCWL_DDR_TO_SCB_CLK_2X1 |\ + HRCWL_SVCOD_DIV_2 |\ + HRCWL_CSB_TO_CLKIN_4X1 |\ + HRCWL_CORE_TO_CSB_3X1) +/* +* There are neither HRCWH_PCI_HOST nor HRCWH_PCI1_ARBITER_ENABLE bits +* in 8308's HRCWH according to the manual, but original Freescale's +* code has them and I've expirienced some problems using the board +* with BDI3000 attached when I've tried to set these bits to zero +* (UART doesn't work after the 'reset run' command). +*/ +#define CONFIG_SYS_HRCW_HIGH (\ + HRCWH_PCI_HOST |\
include/configs/MPC8308ERDB.h line 84
Quoted 10 lines
include/configs/MPC8308ERDB.h new file +10
-0+HRCWH_PCI1_ARBITER_ENABLE |\ +HRCWH_CORE_ENABLE |\ +HRCWH_FROM_0X00000100 |\ +HRCWH_BOOTSEQ_DISABLE |\ +HRCWH_SW_WATCHDOG_DISABLE |\ +HRCWH_ROM_LOC_LOCAL_16BIT |\ +HRCWH_RL_EXT_LEGACY |\ +HRCWH_TSEC1M_IN_RGMII |\ +HRCWH_TSEC2M_IN_RGMII |\ + HRCWH_BIG_ENDIAN)
Kim, can you please comment?
include/configs/MPC8308ERDB.h line 410
Quoted 9 lines
include/configs/MPC8308ERDB.h new file +9
-0+#include <config_cmd_default.h> + +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_NET +#define CONFIG_CMD_I2C +#define CONFIG_CMD_MII +#define CONFIG_CMD_DATE +#define CONFIG_CMD_PCI
Please sort list.
Thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "If you own a machine, you are in turn owned by it, and spend your time serving it..." - Marion Zimmer Bradley, _The Forbidden Tower_
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Dear Wolfgang,
Quoted 14 lines · Wolfgang Denk
Quoted 8 lines
MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8308erdb/Makefile | 52 +++ board/freescale/mpc8308erdb/config.mk | 1 + board/freescale/mpc8308erdb/mpc8308erdb.c | 154 ++++++++ board/freescale/mpc8308erdb/sdram.c | 126 +++++++ include/configs/MPC8308ERDB.h | 572 +++++++++++++++++++++++++++++ 7 files changed, 909 insertions(+), 0 deletions(-)Quoted 6 lines
create mode 100644 board/freescale/mpc8308erdb/Makefile create mode 100644
board/freescale/mpc8308erdb/config.mkcreate mode 100644board/freescale/mpc8308erdb/mpc8308erdb.ccreate mode 100644board/freescale/mpc8308erdb/sdram.ccreate mode 100644include/configs/MPC8308ERDB.h
Quoted 2 lines
Entry to
MAINTAINERSmissing.
Should I add you as a maintainer or myself?
Quoted 8 lines
Quoted 8 lines
Makefile +0
-0@@ -2233,6 +2233,9 @@ TASREG_config : unconfig kmeter1_config: unconfig @$(MKCONFIG) kmeter1 powerpc mpc83xx kmeter1 keymile
Quoted 7 lines
Makefile TASREG_config : unconfig
Quoted 3 lines
Makefile +2
-0+MPC8308ERDB_config: unconfig + @$(MKCONFIG) -a MPC8308ERDB powerpc mpc83xx mpc8308erdb freescaleNAK. Please rebase your code against the "next" branch. We don't accept any board entries to the top level
Makefileany more. Please add to boards.cfg instead.
Done.
Quoted 11 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 5
Quoted 9 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +5
-0@@ -0,0 +1,154 @@ +/* +* Copyright (C) 2010 Freescale Semiconductor, Inc. +* Copyright (C) 2010 Ilya Yanok, Emcraft Systems, yanok at emcraft.com +* +* Author: Freescale unknown Maybe "Initial author" ?
Dropped this line.
Quoted 9 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 46
Quoted 7 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +6
-0+int board_early_init_f (void ) +{ +immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; + +if (in_be32 (&im->pmc.pmccr1)&PMCCR1_POWER_OFF ) + gd->flags |=GD_FLG_SILENT ;What exactly is this good for?
That's for making board silent then it comes out of sleep (not printing version info, checkcpu() output and so on). Actually I've not tested sleep/wakeup functionality but the code looks correct.
Quoted 11 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 128
Quoted 9 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +8
-0+/* +* Miscellaneous late-boot configurations +* +* If a VSC7385 microcode image is present, then upload it. +*/ +int misc_init_r (void ) +{ +int rc =0 ;Please drop the variable.
Done.
Quoted 17 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 134
Quoted 6 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +5
-0+#ifdef CONFIG_VSC7385_IMAGE +if (vsc7385_upload_firmware ((void *)CONFIG_VSC7385_IMAGE , +CONFIG_VSC7385_IMAGE_SIZE )) { +puts ("Failure uploading VSC7385 microcode.\n" ); + rc =1 ;return 1;board/freescale/mpc8308erdb/mpc8308erdb.c line 138
Quoted 5 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +4
-0+ } +#endif + +return rc;return 0;
Quoted 6 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 150
Quoted 4 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +3
-0+int board_eth_init (bd_t *bis) +{ +cpu_eth_init (bis);/* Initialize TSECs first */ I think it's wrong to ignore the return code here.
What makes you think so? What can we do with the return code here? Print warning? If we return error from board_eth_init() calling code will call cpu_eth_init() again which is useless as we have already called it.
Quoted 7 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 154
Quoted 5 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +4
-0+return pci_eth_init (bis); +} + +Please remove trailing empty lines.
Fixed.
Quoted 47 lines
Quoted 47 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +47
-0+/* Fixed sdram init -- doesn't use serial presence detect. +* +* This is useful for faster booting in configs where the RAM is unlikely +* to be changed, or for things like NAND booting where space is tight. +*/ +static long fixed_sdram (void ) +{ +immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; +u32 msize =CONFIG_SYS_DDR_SIZE *1024 *1024 ; +u32 msize_log2 =__ilog2 (msize); + +out_be32 (&im->sysconf.ddrlaw[0 ].bar, +CONFIG_SYS_DDR_SDRAM_BASE &0xfffff000 ); +out_be32 (&im->sysconf.ddrlaw[0 ].ar,LBLAWAR_EN | (msize_log2 -1 )); +out_be32 (&im->sysconf.ddrcdr,CONFIG_SYS_DDRCDR_VALUE ); + +/* +* Erratum DDR3 requires a 50ms delay after clearing DDRCDR[DDR_cfg], +* or the DDR2 controller may fail to initialize correctly. +*/ +udelay (50000 ); + +out_be32 (&im->ddr.csbnds[0 ].csbnds, (msize -1 )>>24 ); +out_be32 (&im->ddr.cs_config[0 ],CONFIG_SYS_DDR_CS0_CONFIG ); + +/* Currently we use only one CS, so disable the other bank. */ +out_be32 (&im->ddr.cs_config[1 ],0 ); + +out_be32 (&im->ddr.sdram_clk_cntl,CONFIG_SYS_DDR_SDRAM_CLK_CNTL ); +out_be32 (&im->ddr.timing_cfg_3,CONFIG_SYS_DDR_TIMING_3 ); +out_be32 (&im->ddr.timing_cfg_1,CONFIG_SYS_DDR_TIMING_1 ); +out_be32 (&im->ddr.timing_cfg_2,CONFIG_SYS_DDR_TIMING_2 ); +out_be32 (&im->ddr.timing_cfg_0,CONFIG_SYS_DDR_TIMING_0 ); + +if (in_be32 (&im->pmc.pmccr1)&PMCCR1_POWER_OFF ) { +out_be32 (&im->ddr.sdram_cfg, +CONFIG_SYS_DDR_SDRAM_CFG |SDRAM_CFG_BI ); + }else { +out_be32 (&im->ddr.sdram_cfg,CONFIG_SYS_DDR_SDRAM_CFG ); + } + +out_be32 (&im->ddr.sdram_cfg2,CONFIG_SYS_DDR_SDRAM_CFG2 ); +out_be32 (&im->ddr.sdram_mode,CONFIG_SYS_DDR_MODE ); +out_be32 (&im->ddr.sdram_mode2,CONFIG_SYS_DDR_MODE2 ); + +out_be32 (&im->ddr.sdram_interval,CONFIG_SYS_DDR_INTERVAL ); +sync ();
Quoted 9 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 88
Quoted 7 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +6
-0+ +/* enable DDR controller */ +setbits_be32 (&im->ddr.sdram_cfg,SDRAM_CFG_MEM_EN ); +sync (); + +return msize;Please test RAM and verify the size using
get_mem_size().
Done.
Quoted 38 lines
Quoted 23 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +22
-0+ +/* +* Hardware Reset Configuration Word +* if CLKIN is 66.66MHz, then +* CSB = 133MHz, DDRC = 266MHz, LBC = 133MHz +* We choose the A type silicon as default, so the core is 400Mhz. +*/ +#define CONFIG_SYS_HRCW_LOW (\ + HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\ + HRCWL_DDR_TO_SCB_CLK_2X1 |\ + HRCWL_SVCOD_DIV_2 |\ + HRCWL_CSB_TO_CLKIN_4X1 |\ + HRCWL_CORE_TO_CSB_3X1) +/* +* There are neither HRCWH_PCI_HOST nor HRCWH_PCI1_ARBITER_ENABLE bits +* in 8308's HRCWH according to the manual, but original Freescale's +* code has them and I've expirienced some problems using the board +* with BDI3000 attached when I've tried to set these bits to zero +* (UART doesn't work after the 'reset run' command). +*/ +#define CONFIG_SYS_HRCW_HIGH (\ + HRCWH_PCI_HOST |\board/freescale/mpc8308erdb/mpc8308erdb.c line 120
Quoted 10 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +10
-0+HRCWH_PCI1_ARBITER_ENABLE |\ +HRCWH_CORE_ENABLE |\ +HRCWH_FROM_0X00000100 |\ +HRCWH_BOOTSEQ_DISABLE |\ +HRCWH_SW_WATCHDOG_DISABLE |\ +HRCWH_ROM_LOC_LOCAL_16BIT |\ +HRCWH_RL_EXT_LEGACY |\ +HRCWH_TSEC1M_IN_RGMII |\ +HRCWH_TSEC2M_IN_RGMII |\ + HRCWH_BIG_ENDIAN)Kim, can you please comment?
Quoted 12 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 129
Quoted 10 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +9
-0+#include <config_cmd_default.h> + +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_NET +#define CONFIG_CMD_I2C +#define CONFIG_CMD_MII +#define CONFIG_CMD_DATE +#define CONFIG_CMD_PCI Please sort list.
Fixed.
I'l wait for a while for other comments and then repost the updated patches.
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Dear Ilya Yanok,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Entry to
MAINTAINERSmissing.Should I add you as a maintainer or myself?
You did the actual work...
Quoted 11 lines
Quoted 5 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 150
Quoted 4 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +3
-0+int board_eth_init (bd_t *bis) +{ +cpu_eth_init (bis);/* Initialize TSECs first */ I think it's wrong to ignore the return code here.
What makes you think so? What can we do with the return code here? Print warning? If we return error from
board_eth_init()calling code will callcpu_eth_init()again which is useless as we have already called it.Quoted 1 line
board/freescale/mpc8308erdb/mpc8308erdb.c line 151
Quoted 1 line
board/freescale/mpc8308erdb/mpc8308erdb.c new file +1
-0+return pci_eth_init (bis);
My understanding is that pci_eth_init() and board_eth_init() return the number of NIC's found - should that number not include the number of successfully initialized TSECs?
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The use of COBOL cripples the mind; its teaching should, therefore,
be regarded as a criminal offence.
-- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Wolfgang & Ilya,
Sorry for responding to both of you at the same time...
Quoted 24 lines · Wolfgang Denk
Dear Ilya Yanok,
Quoted 5 lines · In message<[email protected]> you wrote:
Quoted 3 lines
Entry to
MAINTAINERSmissing.Should I add you as a maintainer or myself?
You did the actual work...
Quoted 11 lines
Quoted 7 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 150
Quoted 5 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +3
-0+int board_eth_init (bd_t *bis) +{ +cpu_eth_init (bis);/* Initialize TSECs first */ I think it's wrong to ignore the return code here.
What makes you think so? What can we do with the return code here? Print warning? If we return error from
board_eth_init()calling code will callcpu_eth_init()again which is useless as we have already called it.
Yes, print a warning if < 0. As you've noticed, returning -1 wouldn't be good. I'm not aware of a U-boot policy for handling hardware problems other than printf.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 151
Quoted 2 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +1
-0+return pci_eth_init (bis);My understanding is that
pci_eth_init()andboard_eth_init()return the number of NIC's found - should that number not include the number of successfully initialized TSECs?
Yes, please. Something like:
int board_eth_init(bd_t *bis)
{
int rc, num_if = 0;
if ((rc = cpu_eth_init(bis)) >= 0)
{
num_if += rc;
} else {
print error message
}
if ((rc = pci_eth_init(bis)) >= 0)
{
num_if += rc;
} else {
print error message
}
return num_if;
}I'm working on changing net/eth.c to be less kludgy, but am having a hard time setting up my test bed. Hopefully in the next few days.
Quoted 5 lines
Best regards,
Wolfgang Denk
regards,
Ben
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Hi Ben,
Quoted 11 lines · Ben Warren
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 150
Quoted 4 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +3
-0+int board_eth_init (bd_t *bis) +{ +cpu_eth_init (bis);/* Initialize TSECs first */ I think it's wrong to ignore the return code here.
What makes you think so? What can we do with the return code here? Print
warning? If we return error fromboard_eth_init()calling code will callcpu_eth_init()again which is useless as we have already called it.
Quoted 3 lines
Yes, print a warning if < 0. As you've noticed, returning -1 wouldn't be good. I'm not aware of a U-boot policy for handling hardware problems other than printf.
Actually I thought that controllers missing in the "NET: " line would be enough but I'll add a warning if you ask.
Quoted 25 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ return
pci_eth_init(bis);My understanding is that
pci_eth_init()andboard_eth_init()return the number of NIC's found - should that number not include the number of successfully initialized TSECs?Yes, please. Something like:
int
board_eth_init(bd_t *bis){ int rc, num_if = 0; if ((rc = cpu_eth_init(bis)) >= 0) { num_if += rc; } else { print error message } if ((rc = pci_eth_init(bis)) >= 0) { num_if += rc; } else { print error message } return num_if; }
Quoted 2 lines
I'm working on changing
net/eth.cto be less kludgy, but am having a hard time setting up my test bed. Hopefully in the next few days.
I'll do like you proposed.
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
In reply to Wolfgang DenkHi Wolfgang,
Quoted 6 lines · Wolfgang Denk
Quoted 4 lines
Quoted 2 lines
Entry to
MAINTAINERSmissing.Should I add you as a maintainer or myself?
You did the actual work...
but I fear I won't be able to maintain it... I don't have much free time to spend now...
Quoted 6 lines
Quoted 2 lines
board/freescale/mpc8308erdb/mpc8308erdb.c line 151
Quoted 2 lines
board/freescale/mpc8308erdb/mpc8308erdb.c new file +1
-0+return pci_eth_init (bis);My understanding is that
pci_eth_init()andboard_eth_init()return the number of NIC's found - should that number not include the number of successfully initialized TSECs?
Ok. I get your point. Actually, as for now code in net/eth.c just checks board_eth_init() value to be negative or not so there is no difference between different non-negative values. But I'll do it like Ben asked.
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
In reply to Ilya YanokQuoted 7 lines · On Sun, 20 Jun 2010 21:32:48 +0400 Ilya Yanok <[email protected]> wrote:
This patch provides support for MPC8308ERDB development board from Freescale with a minimal set of features:
Dual UART is supported
NOR flash is supported
Both TSEC Ethernet controllers are supported
PCI Express initialization is supported
Quoted 7 lines
The following features are enabled in configuration but not fully tested:
I2C (used to get the board revision)
I2C-connected RTC
VSC7385 switchSigned-off-by Ilya Yanok <[email protected]>---
thanks for submitting this, Ilya.
The comments below are in addition to Wolfgang's.
Quoted 5 lines
MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8308erdb/Makefile | 52 +++ board/freescale/mpc8308erdb/config.mk | 1 + board/freescale/mpc8308erdb/mpc8308erdb.c | 154 ++++++++
Quoted 8 lines
board/freescale/mpc8308erdb/sdram.c | 126 +++++++ include/configs/MPC8308ERDB.h | 572 +++++++++++++++++++++++++++++ 7 files changed, 909 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mpc8308erdb/Makefile create mode 100644 board/freescale/mpc8308erdb/config.mk create mode 100644 board/freescale/mpc8308erdb/mpc8308erdb.c create mode 100644 board/freescale/mpc8308erdb/sdram.c create mode 100644 include/configs/MPC8308ERDB.h
missing a doc/README.mpc8308erdb file.
Makefile TASREG_config : unconfig · line 2238
Quoted 4 lines
Makefile +3
-0+MPC8308ERDB_config: unconfig + @$(MKCONFIG) -a MPC8308ERDB powerpc mpc83xx mpc8308erdb freescale +
patch doesn't apply to WD's next branch:
---
Applying: MPC8308ERDB: minimal support for devboard from Freescale
error: patch failed: Makefile:2233
error: Makefile: patch does not apply /home/r1aaha/git/u-boot/.git/rebase-apply/patch:112: new blank line at EOF. +
Patch failed at 0002 MPC8308ERDB: minimal support for devboard from Freescale When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
---
please rebase on top of Wolfgang's next branch, and also fix the new blank line at EOF.
Quoted 1 line
+#define
CONFIG_MPC831x1 /* MPC831x CPU family */
I don't see the 8308 being a member of the 831x family; e.g., upper spridr bits are 0x810, which don't match those of 831x: 0x80B. Please introduce a new CONFIG_MPC830x.
Quoted 6 lines
+/*
+ * There are neitherHRCWH_PCI_HOSTnorHRCWH_PCI1_ARBITER_ENABLEbits
+ * in 8308's HRCWH according to the manual, but original Freescale's
+ * code has them and I've expirienced some problems using the board
+ * with BDI3000 attached when I've tried to set these bits to zero
+ * (UART doesn't work after the 'reset run' command).
is the BDI overriding the RCW in this case? it's not clear..
include/configs/MPC8308ERDB.h line 90
Quoted 2 lines
include/configs/MPC8308ERDB.h new file +2
-0+#define CFG_SICRH 0x01001003 +#define CFG_SICRL 0x00000040/* 3.3V, no delay */
the CFG_ prefix is no longer - are these even being used anywhere?
include/configs/MPC8308ERDB.h line 442
Quoted 2 lines
include/configs/MPC8308ERDB.h new file +2
-0+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \ + HID0_ENABLE_DYNAMIC_POWER_MANAGMENT)
| HID0_ENABLE_INSTRUCTION_CACHE?
Thanks,
Kim
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Hi Kim,
Thanks for your review.
Quoted 14 lines · Kim Phillips
Quoted 8 lines
MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8308erdb/Makefile | 52 +++ board/freescale/mpc8308erdb/config.mk | 1 + board/freescale/mpc8308erdb/mpc8308erdb.c | 154 ++++++++ board/freescale/mpc8308erdb/sdram.c | 126 +++++++ include/configs/MPC8308ERDB.h | 572 +++++++++++++++++++++++++++++ 7 files changed, 909 insertions(+), 0 deletions(-)Quoted 6 lines
create mode 100644 board/freescale/mpc8308erdb/Makefile create mode 100644
board/freescale/mpc8308erdb/config.mkcreate mode 100644board/freescale/mpc8308erdb/mpc8308erdb.ccreate mode 100644board/freescale/mpc8308erdb/sdram.ccreate mode 100644include/configs/MPC8308ERDB.h
Quoted 2 lines
missing a doc/README.mpc8308erdb file.
Hm.. Wolfgang, do we really need this?
Well, I hope I'd be able to reuse most of doc/README.mpc8315erdb...
Quoted 19 lines
Makefile TASREG_config : unconfig · line 2238
Quoted 5 lines
Makefile +3
-0+MPC8308ERDB_config: unconfig + @$(MKCONFIG) -a MPC8308ERDB powerpc mpc83xx mpc8308erdb freescale +patch doesn't apply to WD's next branch:
---
Applying: MPC8308ERDB: minimal support for devboard from Freescale
error: patch failed: Makefile:2233
error:Makefile: patch does not apply/home/r1aaha/git/u-boot/.git/rebase-apply/patch:112: new blank line at EOF. +
Patch failed at 0002 MPC8308ERDB: minimal support for devboard from Freescale When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
---
Quoted 3 lines
please rebase on top of Wolfgang's next branch, and also fix the new blank line at EOF.
Yes, I've already done this.
Quoted 6 lines
Quoted 2 lines
+#define
CONFIG_MPC831x1 /* MPC831x CPU family */I don't see the 8308 being a member of the 831x family; e.g., upper spridr bits are
0x810, which don't match those of 831x:0x80B. Please introduce a newCONFIG_MPC830x.
Actually I've noticed this myself... But 8308 has many things common with 831x and I'm not sure if there is a family of 830x (I can see only 8308 on Freescale website).
Well, I'll do as you propose.
Quoted 9 lines
Quoted 7 lines
+/*
+ * There are neitherHRCWH_PCI_HOSTnorHRCWH_PCI1_ARBITER_ENABLEbits
+ * in 8308's HRCWH according to the manual, but original Freescale's
+ * code has them and I've expirienced some problems using the board
+ * with BDI3000 attached when I've tried to set these bits to zero
+ * (UART doesn't work after the 'reset run' command).is the BDI overriding the RCW in this case? it's not clear..
Yes, my default BDI configuration overrides RCW with 0xa0606c00 0x44060000 (with HRCWH_PCI_HOST and HRCWH_PCI1_ARBITER_ENABLE bits set) to be able to program empty flash.
My test sequence is as follows:
0. I had BDI overriding RCW and programmed U-Boot with the same RCW values.
1. I compiled new U-Boot image without HRCWH_PCI* bits and reflashed it from U-Boot itself.
2. Then I rebooted the board with the U-Boot 'reset' command. Everything works fine.
3. Reseted the board with 'reset run' command from the BDI. Everything works well too (recall that BDI is configured to override RCW with old value).
4. Then I've changed BDI configuration disabling the RCW override. Everything works.
5. But if I configure BDI to override RCW with new value (without HRCWH_PCI* bits) I can't see anything on serial console after reset (but it looks like U-Boot is started correctly, at least execution address looks correct).
Quoted 5 lines
include/configs/MPC8308ERDB.h line 90
Quoted 3 lines
include/configs/MPC8308ERDB.h new file +2
-0+#define CFG_SICRH 0x01001003 +#define CFG_SICRL 0x00000040/* 3.3V, no delay */ the
CFG_prefix is no longer - are these even being used anywhere?
Ouch... That's my bug. I'll fix it.
Quoted 5 lines
include/configs/MPC8308ERDB.h line 442
Quoted 3 lines
include/configs/MPC8308ERDB.h new file +2
-0+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \ + HID0_ENABLE_DYNAMIC_POWER_MANAGMENT)|
HID0_ENABLE_INSTRUCTION_CACHE?
Yes, you are right. I'll add it.
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Dear Ilya Yanok,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
missing a doc/README.mpc8308erdb file.
Hm.. Wolfgang, do we really need this?
Only if there is somethign spoecial about this board which is worth being documented.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There has been an alarming increase in the number of things you know nothing about.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
In reply to Kim PhillipsDear Kim,
Quoted 5 lines · Kim Phillips
include/configs/MPC8308ERDB.h line 442
Quoted 3 lines
include/configs/MPC8308ERDB.h new file +2
-0+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \ + HID0_ENABLE_DYNAMIC_POWER_MANAGMENT)|
HID0_ENABLE_INSTRUCTION_CACHE?
I've enabled icache and now the board sometimes resets twice after U-Boot 'reset' command:
=> re
Resetting the board.
U-Boot 2010.06-rc3-00020-g093a164 (Jun 24 2010 - 17:45:17) MPC83XX
Reset Status: Software Hard, External/Internal Soft, External/Internal Hard
CPU: e300c3, MPC8308, Rev: 1.0 at 400 MHz, CSB: 133.333 MHz Board: Freescale MPC8308ERDB Rev 1.0 I2C: ready
DRAM:
U-Boot 2010.06-rc3-00020-g093a164 (Jun 24 2010 - 17:45:17) MPC83XX
Reset Status: External/Internal Soft, External/Internal Hard
CPU: e300c3, MPC8308, Rev: 1.0 at 400 MHz, CSB: 133.333 MHz Board: Freescale MPC8308ERDB Rev 1.0 I2C: ready DRAM: 128 MiB FLASH: 8 MiB PCIE0: link In: serial Out: serial Err: serial Net: eTSEC1: No support for PHY id ffffffff; assuming generic
eTSEC0, eTSEC1
Hit any key to stop autoboot: 0
=>
(It doesn't always stop at "DRAM:" line but that position is most frequent) Maybe you have some ideas on this subject?
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Quoted 11 lines · On Thu, 24 Jun 2010 19:59:13 +0400 Ilya Yanok <[email protected]> wrote:
Quoted 4 lines · Kim Phillips
include/configs/MPC8308ERDB.h line 442
Quoted 3 lines
include/configs/MPC8308ERDB.h new file +2
-0+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \ + HID0_ENABLE_DYNAMIC_POWER_MANAGMENT)|
HID0_ENABLE_INSTRUCTION_CACHE?I've enabled icache and now the board sometimes resets twice after U-Boot 'reset' command:
(It doesn't always stop at "DRAM:" line but that position is most frequent) Maybe you have some ideas on this subject?
hmm, if it's only on soft-resets, can you try adding HID0_ENABLE_INSTRUCTION_CACHE to CONFIG_SYS_HID0_INIT in addition to _FINAL? Some cache state is preserved over a soft-reset...
Thanks,
Kim
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Hi Kim,
Quoted 11 lines · Kim Phillips
Quoted 7 lines
I've enabled icache and now the board sometimes resets twice after U-Boot 'reset' command:
(It doesn't always stop at "DRAM:" line but that position is most frequent) Maybe you have some ideas on this subject?
hmm, if it's only on soft-resets, can you try adding
HID0_ENABLE_INSTRUCTION_CACHEtoCONFIG_SYS_HID0_INITin addition to_FINAL? Some cache state is preserved over a soft-reset...
Thanks for your advice but this doesn't help...
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Quoted 4 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de
[mailto:u-boot-bounces at lists.denx.de]
Quoted 17 lines
On Behalf Of Ilya Yanok
Sent: Friday, June 25, 2010 1:07 AM
To: Phillips Kim-R1AAHA
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 2/2] MPC8308ERDB: minimal support for devboard from FreescaleHi Kim,
Quoted 7 lines · Kim Phillips
Quoted 7 lines
I've enabled icache and now the board sometimes resets twice after U-Boot 'reset' command:
(It doesn't always stop at "DRAM:" line but that position is most frequent) Maybe you have some ideas on this subject?
Quoted 7 lines
Quoted 4 lines
hmm, if it's only on soft-resets, can you try adding
HID0_ENABLE_INSTRUCTION_CACHEtoCONFIG_SYS_HID0_INITin addition to_FINAL? Some cache state is preserved over a soft-reset...Thanks for your advice but this doesn't help...
Just from my experience on few other boards, this could be a DDR configuration issue.
Can you try to run at lower frequencies?..Or may be playing with DDR controller timings.
Regards
Poonam
Quoted 6 lines
Regards, Ilya.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Quoted 13 lines · On Thu, 24 Jun 2010 19:00:54 -0500 Kim Phillips <[email protected]>…
Quoted 10 lines · On Thu, 24 Jun 2010 23:36:49 +0400 Ilya Yanok <[email protected]> wrote:
Hi Kim,
Quoted 7 lines · Kim Phillips
Quoted 7 lines
I've enabled icache and now the board sometimes resets twice after U-Boot 'reset' command:
(It doesn't always stop at "DRAM:" line but that position is most frequent) Maybe you have some ideas on this subject?
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
hmm, if it's only on soft-resets, can you try adding
HID0_ENABLE_INSTRUCTION_CACHEtoCONFIG_SYS_HID0_INITin addition to_FINAL? Some cache state is preserved over a soft-reset...Thanks for your advice but this doesn't help...
turning icache on early causes a different pattern of bus accesses when fetching code, and this might trigger bus accesses that interfere with code that sets bus configuration registers, such as the acr. Can you test this patch please?:
arch/powerpc/cpu/mpc83xx/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-y += speed.o COBJS-y += interrupts.o COBJS-y += spd_sdram.o COBJS-y += ecc.o +COBJS-y += acr.o COBJS-$(CONFIG_QE) += qe_io.o COBJS-$(CONFIG_FSL_SERDES) += serdes.o COBJS-$(CONFIG_PCI) += pci.o
arch/powerpc/cpu/mpc83xx/acr.c new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright (C) 2010 Freescale Semiconductor, Inc. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <asm/io.h> + +void single_cline_write (volatile void *addr,__be32 val) +{ +out_be32 (addr, val); +}
arch/powerpc/cpu/mpc83xx/cpu_init.c +5 -1
@@ -30,6 +30,8 @@DECLARE_GLOBAL_DATA_PTR ; +extern void single_cline_write (volatile void *addr,__be32 val); +#ifdef CONFIG_QE extern qe_iop_conf_t qe_iop_conf_tab[]; extern void qe_config_iopin(u8 port, u8 pin, int dir,
@@ -63,6 +65,7 @@ static void config_qe_ioports(void)*/ void cpu_init_f (volatile immap_t * im) { +__be32 val; __be32 acr_mask =#ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */ ACR_PIPE_DEP |
@@ -213,7 +216,8 @@ void cpu_init_f (volatile immap_t * im)memset ((void *) gd,0 ,sizeof (gd_t));/* system performance tweaking */ -clrsetbits_be32 (&im->arbiter.acr, acr_mask, acr_val); + val =__raw_readl (&im->arbiter.acr); +single_cline_write (&im->arbiter.acr, acr_val & (val & ~acr_mask));clrsetbits_be32 (&im->sysconf.spcr, spcr_mask, spcr_val);
arch/powerpc/cpu/mpc83xx/u-boot.lds +2 -0
@@ -51,6 +51,8 @@ SECTIONS .text : { arch/powerpc/cpu/mpc83xx/start.o (.text) + . = ALIGN(32); + arch/powerpc/cpu/mpc83xx/acr.o (.text) *(.text) *(.got1) . = ALIGN(16);
Thanks,
Kim
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Dear Kim Phillips,
Quoted 22 lines · In message <[email protected]> you wrote:
+++
b/arch/powerpc/cpu/mpc83xx/acr.carch/powerpc/cpu/mpc83xx/acr.c new file +19
-0@@ -0,0 +1,29 @@ +/* +* Copyright (C) 2010 Freescale Semiconductor, Inc. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
arch/powerpc/cpu/mpc83xx/acr.c line 29
Quoted 10 lines
arch/powerpc/cpu/mpc83xx/acr.c new file +10
-0+* MA 02111-1307 USA +*/ + +#include <common.h> +#include <asm/io.h> + +void single_cline_write (volatile void *addr,__be32 val) +{ +out_be32 (addr, val); +}
Oops?? Why do we need a new file, with a new function, does nothing else but calling another funtion, and that gets used just a single time?
Drop this wrapper!
arch/powerpc/cpu/mpc83xx/cpu_init.c line 33
Quoted 6 lines
+++
b/arch/powerpc/cpu/mpc83xx/cpu_init.carch/powerpc/cpu/mpc83xx/cpu_init.c +1
-0@@ -30,6 +30,8 @@DECLARE_GLOBAL_DATA_PTR ; +extern void single_cline_write (volatile void *addr,__be32 val);
[Prototypes should always go to appropriate header files!!]
arch/powerpc/cpu/mpc83xx/cpu_init.c void cpu_init_f (volatile immap_t * im) · line 219
Quoted 12 lines
arch/powerpc/cpu/mpc83xx/cpu_init.c +1
-0void cpu_init_f (volatile immap_t * im) { +__be32 val; __be32 acr_mask =#ifdef
CONFIG_SYS_ACR_PIPE_DEP/* Arbiter pipeline depth */arch/powerpc/cpu/mpc83xx/cpu_init.c +1
-1ACR_PIPE_DEP |@@ -213,7 +216,8 @@ void cpu_init_f (volatile immap_t * im)memset ((void *) gd,0 ,sizeof (gd_t));/* system performance tweaking */ -clrsetbits_be32 (&im->arbiter.acr, acr_mask, acr_val); + val =__raw_readl (&im->arbiter.acr);
Do we need __raw_readl()? Why would in_be32() not work?
arch/powerpc/cpu/mpc83xx/cpu_init.c void cpu_init_f (volatile immap_t * im) · line 220
Quoted 1 line
arch/powerpc/cpu/mpc83xx/cpu_init.c +1
-0+single_cline_write (&im->arbiter.acr, acr_val & (val & ~acr_mask));
Make this:
out_be32(&im->arbiter.acr, acr_val & (val & ~acr_mask));
arch/powerpc/cpu/mpc83xx/u-boot.lds SECTIONS · line 55
Quoted 2 lines
arch/powerpc/cpu/mpc83xx/u-boot.lds +2
-0+ . = ALIGN(32); + arch/powerpc/cpu/mpc83xx/acr.o (.text)
Ah! I guess this is worth a comment? But should we not rather aligh the in_* and out_* functions then?
What is the exact use case when such alignment might be needed? Can you guarantee that it's only with this specific register access, and only for write accesses?
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de ... bacteriological warfare ... hard to believe we were once foolish enough to play around with that. -- McCoy, "The Omega Glory", stardate unknown
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
In reply to Kim PhillipsHi Kim,
Quoted 5 lines · Kim Phillips
Quoted 1 line
Quoted 1 line
Thanks for your advice but this doesn't help...
turning icache on early causes a different pattern of bus accesses when fetching code, and this might trigger bus accesses that interfere with code that sets bus configuration registers, such as the acr. Can you test this patch please?:
Unfortunately this patch doesn't help too...
Thanks for your efforts!
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale (ICache issue)
In reply to Kim PhillipsHi Kim,
Quoted 4 lines · Kim Phillips
turning icache on early causes a different pattern of bus accesses when fetching code, and this might trigger bus accesses that interfere with code that sets bus configuration registers, such as the acr. Can you test this patch please?:
This issue turned to be BDI related (I can't reproduce it with BDI detached).
Sorry for inconvenience.
Regards, Ilya.
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
In reply to Kim PhillipsThis patch provides support for MPC8308ERDB development board from Freescale with a minimal set of features:
Dual UART is supported
NOR flash is supported
Both TSEC Ethernet controllers are supported
PCI Express initialization is supported
The following features are enabled in configuration but not fully tested:
I2C (used to get the board revision)
I2C-connected RTC
VSC7385 switch
There is one (hopefully) minor issue: on soft reset the board sometimes resets twice. I've not managed to find the fix for this problem yet. As a workaround instruction cache can be disabled.
--- MAINTAINERS | 4 + MAKEALL | 1 + board/freescale/mpc8308erdb/Makefile | 52 +++ board/freescale/mpc8308erdb/config.mk | 1 + board/freescale/mpc8308erdb/mpc8308erdb.c | 160 ++++++++ board/freescale/mpc8308erdb/sdram.c | 126 +++++++ boards.cfg | 1 + include/configs/MPC8308ERDB.h | 577 +++++++++++++++++++++++++++++ 8 files changed, 922 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mpc8308erdb/Makefile create mode 100644 board/freescale/mpc8308erdb/config.mk create mode 100644 board/freescale/mpc8308erdb/mpc8308erdb.c create mode 100644 board/freescale/mpc8308erdb/sdram.c create mode 100644 include/configs/MPC8308ERDB.h
MAINTAINERS +4 -0
@@ -489,6 +489,10 @@ Stephen Williams <[email protected]> JSE PPC405GPr +Ilya Yanok <[email protected]> + + MPC8308ERDB MPC8308 + Roy Zang <[email protected]> mpc7448hpc2 MPC7448
MAKEALL +1 -0
@@ -359,6 +359,7 @@ LIST_8260=" \ LIST_83xx=" \ caddy2 \ kmeter1 \ + MPC8308ERDB \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \
board/freescale/mpc8308erdb/Makefile new file +52 -0
52 lines not on this page · raw message
board/freescale/mpc8308erdb/config.mk new file +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0xFE000000
board/freescale/mpc8308erdb/mpc8308erdb.c new file +160 -0
160 lines not on this page · raw message
board/freescale/mpc8308erdb/sdram.c new file +126 -0
126 lines not on this page · raw message
boards.cfg +1 -0
@@ -132,6 +132,7 @@ ZPC1900 powerpc mpc8260 zpc1900 mgcoge powerpc mpc8260 - keymile SCM powerpc mpc8260 - siemens TQM8272 powerpc mpc8260 tqm8272 tqc +MPC8308ERDB powerpc mpc83xx mpc8308erdb freescale kmeter1 powerpc mpc83xx kmeter1 keymile MVBLM7 powerpc mpc83xx mvblm7 matrix_vision TQM834x powerpc mpc83xx tqm834x tqc
include/configs/MPC8308ERDB.h new file +577 -0
577 lines not on this page · raw message
Signature · 1 line
1.6.2.5
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Quoted 1 line · On Mon, 28 Jun 2010 16:45:29 +0400 Ilya Yanok <[email protected]> wrote:
This patch provides support for MPC8308ERDB development board from
so, according to this document:
http://cache.freescale.com/files/32bit/doc/user_guide/MPC8308RDBUG.pdf
the board name is just 'mpc8308rdb', not 'mpc8308erdb'. AFAICT, there is no version of the 8308 that has an 'E'ncryption unit, so the name should probably be changed.
apologies for not seeing this earlier...
Kim
PATCH 2/2 MPC8308ERDB: minimal support for devboard from Freescale
Hi Kim,
Quoted 4 lines · Kim Phillips
Quoted 2 lines
This patch provides support for MPC8308ERDB development board from
so, according to this document:
Quoted 8 lines
http://cache.freescale.com/files/32bit/doc/user_guide/MPC8308RDBUG.pdf
the board name is just 'mpc8308rdb', not 'mpc8308erdb'. AFAICT, there is no version of the 8308 that has an 'E'ncryption unit, so the name should probably be changed.
apologies for not seeing this earlier...
Well, actually I saw this myself... but the board is named MPC8308ERDB in Freescale BSP so I didn't change this name.
Ok, I'll fix this and repost the patch.
Regards, Ilya.
PATCH 2/2 MPC8308RDB: minimal support for devboard from Freescale
This patch provides support for MPC8308RDB development board from Freescale with a minimal set of features:
Dual UART is supported
NOR flash is supported
Both TSEC Ethernet controllers are supported
PCI Express initialization is supported
The following features are enabled in configuration but not fully tested:
I2C (used to get the board revision)
I2C-connected RTC
VSC7385 switch
There is one (hopefully) minor issue: on soft reset the board sometimes resets twice. I've not managed to find the fix for this problem yet. As a workaround instruction cache can be disabled.
--- MAINTAINERS | 4 + MAKEALL | 1 + board/freescale/mpc8308rdb/Makefile | 52 +++ board/freescale/mpc8308rdb/config.mk | 1 + board/freescale/mpc8308rdb/mpc8308rdb.c | 160 +++++++++ board/freescale/mpc8308rdb/sdram.c | 126 +++++++ boards.cfg | 1 + include/configs/MPC8308RDB.h | 560 +++++++++++++++++++++++++++++++ 8 files changed, 905 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mpc8308rdb/Makefile create mode 100644 board/freescale/mpc8308rdb/config.mk create mode 100644 board/freescale/mpc8308rdb/mpc8308rdb.c create mode 100644 board/freescale/mpc8308rdb/sdram.c create mode 100644 include/configs/MPC8308RDB.h
MAINTAINERS +4 -0
@@ -489,6 +489,10 @@ Stephen Williams <[email protected]> JSE PPC405GPr +Ilya Yanok <[email protected]> + + MPC8308RDB MPC8308 + Roy Zang <[email protected]> mpc7448hpc2 MPC7448
MAKEALL +1 -0
@@ -359,6 +359,7 @@ LIST_8260=" \ LIST_83xx=" \ caddy2 \ kmeter1 \ + MPC8308RDB \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \
board/freescale/mpc8308rdb/Makefile new file +52 -0
52 lines not on this page · raw message
board/freescale/mpc8308rdb/config.mk new file +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0xFE000000
board/freescale/mpc8308rdb/mpc8308rdb.c new file +160 -0
160 lines not on this page · raw message
board/freescale/mpc8308rdb/sdram.c new file +126 -0
126 lines not on this page · raw message
boards.cfg +1 -0
@@ -132,6 +132,7 @@ ZPC1900 powerpc mpc8260 zpc1900 mgcoge powerpc mpc8260 - keymile SCM powerpc mpc8260 - siemens TQM8272 powerpc mpc8260 tqm8272 tqc +MPC8308RDB powerpc mpc83xx mpc8308rdb freescale kmeter1 powerpc mpc83xx kmeter1 keymile MVBLM7 powerpc mpc83xx mvblm7 matrix_vision TQM834x powerpc mpc83xx tqm834x tqc
include/configs/MPC8308RDB.h new file +560 -0
560 lines not on this page · raw message
Signature · 1 line
1.6.2.5
Kim Phillips
AppliedPATCH 2/2 MPC8308RDB: minimal support for devboard from Freescale
Quoted 12 lines · On Wed, 7 Jul 2010 20:16:13 +0400 Ilya Yanok <[email protected]> wrote:
This patch provides support for MPC8308RDB development board from Freescale with a minimal set of features:
Dual UART is supported
NOR flash is supported
Both TSEC Ethernet controllers are supported
PCI Express initialization is supportedThe following features are enabled in configuration but not fully tested:
I2C (used to get the board revision)
I2C-connected RTC
VSC7385 switch
Quoted 6 lines
There is one (hopefully) minor issue: on soft reset the board sometimes resets twice. I've not managed to find the fix for this problem yet. As a workaround instruction cache can be disabled.
Signed-off-by Ilya Yanok <[email protected]>---
Applied, after relocating the boards.cfg entry to maintain the correct sort order.
Thanks,
Kim