Skip to contentSkip to conversation

: add canyonlands RAM-boot target

PATCH New Fawaz 2 participants 2 messages Mar 6, 2011 – Mar 8, 2011 PowerPC

lore
Share & tools
lore

Fawaz

author
#0 lore raw

PATCH 1/1 : add canyonlands RAM-boot target

This patch adds another build target for the AMCC Canyonlands
PPC460Ex eval board. Using JTAG debugger(e.g. BDI2000/3000) configured to setup the SDRAM.
here are TLB entries required by RAM-u-boot (for BDI2000/3000):
WTLB 0x00000095 0x0000003F ;SDRAM 256MB @ 0x00000000

  WTLB      0xE0000075  0x4E00003F
  WTLB      0xE1000005  0x4E10001B
  WTLB      0xE3000054  0x4000003F

keep SDRAM configuration part as it's.

Cc Stefan Roese <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Felix Radensky <[email protected]>

---

  arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c |   11 +++++++----
  arch/powerpc/cpu/ppc4xx/Makefile       |    2 ++
  board/amcc/canyonlands/canyonlands.c   |    3 ++-
  board/amcc/canyonlands/u-boot-ram.lds  |   96 
+++++++++++++++++++++++++++++++++
  boards.cfg                             |    1 +
  include/configs/canyonlands.h          |   29 
++++++++++++++++++++++-------
  5 files changed, 130 insertions(+), 12 deletions(-)

create mode 100644 board/amcc/canyonlands/u-boot-ram.lds

(quoted diff) +0 -0

b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
index 95df1d9..2660cd2 100644

arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c +7 -4
@@ -66,7 +66,8 @@
                 "SDRAM_" #mnemonic, SDRAM_##mnemonic, data);    \
      } while (0)
 
-#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+#if (!defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_SYS_RAMBOOT))    \
+    || defined(CONFIG_NAND_SPL)
  static void update_rdcc(void)
  {
      u32 val;
@@ -2896,7 +2897,8 @@ phys_size_t initdram(int board_type)
       * mustn't be reconfigured again since we're already running
       * from SDRAM.
       */
-#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+#if (!defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_SYS_RAMBOOT)) \
+    || defined(CONFIG_NAND_SPL)
      unsigned long val;
 
  #if defined(CONFIG_440)
@@ -3013,12 +3015,13 @@ phys_size_t initdram(int board_type)
  #endif
 
  #if defined(CONFIG_PPC4xx_DDR_AUTOCALIBRATION)
-#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_SYS_RAMBOOT)    \
+ && !defined(CONFIG_NAND_SPL)
      /*------------------------------------------------------------------
       | DQS calibration.
       +-----------------------------------------------------------------*/
      DQS_autocalibration();
-#endif /* !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL) */
+#endif /* !defined(CONFIG_NAND_U_BOOT && CONFIG_SYS_RAMBOOT) && 

!defined(CONFIG_NAND_SPL) */
#endif /* CONFIG_PPC4xx_DDR_AUTOCALIBRATION */

      /*
(quoted diff) +0 -0

b/arch/powerpc/cpu/ppc4xx/Makefile
index d97ca20..02a48f9 100644

arch/powerpc/cpu/ppc4xx/Makefile +2 -0
@@ -36,9 +36,11 @@ COBJS    := 40x_spd_sdram.o
 
  ifndef CONFIG_NAND_SPL
  ifndef CONFIG_NAND_U_BOOT
+ifndef CONFIG_SYS_RAMBOOT
  COBJS    += 44x_spd_ddr.o
  endif
  endif
+endif
  COBJS-$(CONFIG_SDRAM_PPC4xx_IBM_DDR2) += 44x_spd_ddr2.o
  COBJS-$(CONFIG_PPC4xx_DDR_AUTOCALIBRATION) += 4xx_ibm_ddr2_autocalib.o
  COBJS    += 4xx_pci.o
(quoted diff) +0 -0

b/board/amcc/canyonlands/canyonlands.c
index 80e2739..d70ef20 100644

board/amcc/canyonlands/canyonlands.c +2 -1
@@ -390,7 +390,8 @@ int board_early_init_r (void)
       */
 
      /* Remap the NOR FLASH to 0xcc00.0000 ... 0xcfff.ffff */
-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL) \
+    || defined(CONFIG_SYS_RAMBOOT)
      mtebc(PB3CR, CONFIG_SYS_FLASH_BASE_PHYS_L | 0xda000);
  #else
      mtebc(PB0CR, CONFIG_SYS_FLASH_BASE_PHYS_L | 0xda000);

new file mode 100644
index 0000000..fef0225

board/amcc/canyonlands/u-boot-ram.lds new file +96 -0

96 lines not on this page · raw message

boards.cfg +0 -2
index 45c3102..474ecc1 100644
@@ -675,6 +675,7 @@ bluestone                    powerpc     ppc4xx      
-                   amcc
  bubinga                      powerpc     ppc4xx      
-                   amcc
  canyonlands                  powerpc     ppc4xx      

canyonlands amcc - canyonlands:CANYONLANDS
canyonlands_nand powerpc ppc4xx
canyonlands amcc -
canyonlands:CANYONLANDS,NAND_U_BOOT,SYS_TEXT_BASE=0x01000000
+canyonlands_ramboot powerpc ppc4xx
canyonlands amcc -
canyonlands:CANYONLANDS,SYS_RAMBOOT,SYS_TEXT_BASE=0x01000000,SYS_LDSCRIPT=board/amcc/canyonlands/u-boot-ram.lds
ebony powerpc ppc4xx
- amcc
glacier powerpc ppc4xx
canyonlands amcc - canyonlands:GLACIER
glacier_nand powerpc ppc4xx
canyonlands amcc -
canyonlands:GLACIER,NAND_U_BOOT,SYS_TEXT_BASE=0x01000000

include/configs/canyonlands.h +14 -1
index 8c03582..6433b9b 100644
@@ -139,15 +139,29 @@
  /*
   * Define here the location of the environment variables (FLASH).
   */
-#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+#define CONFIG_ENV_IS_IN_NAND   1   /* use NAND for environ vars */
+#define CONFIG_ENV_IS_EMBEDDED    1    /* use embedded environment */
+#elif defined(CONFIG_SYS_RAMBOOT)
+#define CONFIG_ENV_IS_NOWHERE        /* Store env in memory only*/
+#define CONFIG_ENV_SIZE            (8 << 10)
+/*
+ * In RAM-booting version, we have no environment storage. So we need to
+ * provide@least preliminary MAC addresses for the 4xx EMAC driver to
+ * register the interfaces.
+ */
+#define    CONFIG_ETHADDR            4a:56:49:22:3e:43
+#define    CONFIG_ETH1ADDR            02:93:53:d5:06:98
+#else
  #define    CONFIG_ENV_IS_IN_FLASH    1    /* use FLASH for environment 

vars */
#define CONFIG_SYS_NOR_CS 0 /* NOR chip connected to CSx */
#define CONFIG_SYS_NAND_CS 3 /* NAND chip connected to CSx */
-#else
-#define CONFIG_ENV_IS_IN_NAND 1 /* use NAND for environment
vars */
+#endif/*CONFIG_NAND_U_BOOT || CONFIG_NAND_SPL*/
+
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL) \
+ || defined(CONFIG_SYS_RAMBOOT)
#define CONFIG_SYS_NOR_CS 3 /* NOR chip connected to CSx */
#define CONFIG_SYS_NAND_CS 0 /* NAND chip connected to CSx */
-#define CONFIG_ENV_IS_EMBEDDED 1 /* use embedded environment */
#endif

/*
@@ -251,7 +265,7 @@
/*------------------------------------------------------------------------------
* DDR SDRAM

*----------------------------------------------------------------------------*/ -#if !defined(CONFIG_NAND_U_BOOT)
+#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_SYS_RAMBOOT)
#if !defined(CONFIG_ARCHES)
/*
* NAND booting U-Boot version uses a fixed initialization, since the
whole
@@ -324,7 +338,7 @@
#define CONFIG_SYS_SDRAM0_MMODE 0x00000432
#define CONFIG_SYS_SDRAM0_MEMODE 0x00000004
#endif /* !defined(CONFIG_ARCHES) */
-#endif /* !defined(CONFIG_NAND_U_BOOT) */
+#endif /* !defined(CONFIG_NAND_U_BOOT) &&
!defined(CONFIG_SYS_RAMBOOT) */

  #define CONFIG_SYS_MBYTES_SDRAM    512    /* 512MB            */

@@ -571,7 +585,8 @@
* 0xfe00.0000 -> 4.ce00.0000
*/

-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)    \

+ || defined(CONFIG_SYS_RAMBOOT)
/* Memory Bank 3 (NOR-FLASH) initialization */
#define CONFIG_SYS_EBC_PB3AP 0x10055e00
#define CONFIG_SYS_EBC_PB3CR (CONFIG_SYS_BOOT_BASE_ADDR | 0x9a000)

Signature · 4 lines
Best Regards
Fawaz Gaili
NCTR
NTC - Tower 8th floor
#1 lore raw

PATCH 1/1 : add canyonlands RAM-boot target

Quoted 8 lines · On Sunday 06 March 2011 13:13:30 Fawaz wrote:

This patch adds another build target for the AMCC Canyonlands
PPC460Ex eval board. Using JTAG debugger(e.g. BDI2000/3000) configured to setup the SDRAM.
here are TLB entries required by RAM-u-boot (for BDI2000/3000):
WTLB 0x00000095 0x0000003F ;SDRAM 256MB @ 0x00000000

  WTLB      0xE0000075  0x4E00003F
  WTLB      0xE1000005  0x4E10001B
  WTLB      0xE3000054  0x4000003F
Quoted 6 lines

keep SDRAM configuration part as it's.

Cc Stefan Roese <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Felix Radensky <[email protected]>

Your patch is line wrapped and can't be applied. Please fix this in your mailer, or even better, use "git send-email" to send your patches.

And did you check if this RAM-booting target also works when it is loaded/started via an already running U-Boot (instead of via the JTAG debugger)?

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de