]> git.sur5r.net Git - u-boot/commitdiff
km/common: simplify debug environment
authorHolger Brunck <holger.brunck@keymile.com>
Mon, 4 Jul 2011 21:52:52 +0000 (21:52 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 27 Jul 2011 21:43:33 +0000 (23:43 +0200)
The debug environment which is stored in textfiles in the
scripts directory was reworked. Two usecase are now present
which can be executed simply from the default environment:
run develop: this configures the environment to setup the
             rootfs via nfs
run ramfs: this configures the environment to setup the
           rootfs in ram

Each architecture now has a "arch" variable which is used
to load the architecture specific debug scripts and to set
the rootpath for NFS.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>

18 files changed:
board/keymile/scripts/README
board/keymile/scripts/debug-arm-env.txt [deleted file]
board/keymile/scripts/debug-common-env.txt [deleted file]
board/keymile/scripts/debug-ppc-env.txt [deleted file]
board/keymile/scripts/develop-arm.txt [new file with mode: 0644]
board/keymile/scripts/develop-common.txt [new file with mode: 0644]
board/keymile/scripts/develop-ppc_82xx.txt [new file with mode: 0644]
board/keymile/scripts/develop-ppc_8xx.txt [new file with mode: 0644]
board/keymile/scripts/ramfs-arm.txt [new file with mode: 0644]
board/keymile/scripts/ramfs-common.txt [new file with mode: 0644]
board/keymile/scripts/ramfs-ppc_82xx.txt [new file with mode: 0644]
board/keymile/scripts/ramfs-ppc_8xx.txt [new file with mode: 0644]
include/configs/km/keymile-common.h
include/configs/km/km-powerpc.h
include/configs/km/km82xx-common.h
include/configs/km/km8321-common.h
include/configs/km/km83xx-common.h
include/configs/km/km_arm.h

index 86c2b5a26a9069c193016f358316ab7d4640c9a2..7fbcf741b90c2bd0c8df4bbf07ba036460142dad 100644 (file)
@@ -1,23 +1,31 @@
-debug-common-env.txt
+These scripts are needed for our development usecases. Copy this directory
+into your tftp root directory to be able to use this scripts.
+cp -r <u-boot-repo>/board/keymile/scripts <your_tftp_root>/
+
+To load and configure these usecase, two environment variables in the u-boot
+default environment must be parsed:
+run develop : setup environment to configure for rootfs via nfs
+run ramfs   : setup environment to configure for rootfs in ram
+
+Last change: 20.05.2011
+
+develop-common.txt
+============================
+This file defines variables for working with rootfs via nfs for powerpc and
+arm.
+
+develop-<arch>.txt
 ============================
-This file defines environment variables which are valid for powerpc boards
-and for arm boards.
+This file defines architecture specific variables for working with rootfs via
+nfs arm.
 
-addramfs: add phram device for the rootfilesysten in ram
-develop: for development, laod kernel via tftp and mount  rootfs via NFS
-nfsargs: default arguments for nfs boot
-ramfs: load rootfilesystem in RAM  kernel
-rootfsfile: loacation of the rootfs file for ramfs
-setramfspram: compute PRAM size for ramfs target
-setrootfsaddr: compute rootfilesystem address for phram
-tftpkernel: load a kernel with tftp into ram
-tftpramfs: load rootfs with tftp into ram
 
-debug-ppc-env.txt
+ramfs-common.txt
 ============================
-fdt_file: location of the dtb file on the tftp server
-tftpfdt: load dtb file and set fdt address
+This file defines variables for working with rootfs inside the ram for powerpc
+and arm.
 
-debug-arm-env.txt
+ramfs-<arch>.txt
 ============================
-tftpfdt: for arm only a dummy variable, because we have no fdt on arm
+This file defines architecture specific variables for working with rootfs inside
+ram.
diff --git a/board/keymile/scripts/debug-arm-env.txt b/board/keymile/scripts/debug-arm-env.txt
deleted file mode 100644 (file)
index 84498af..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-debug_env_common=tftpboot 0x200000 scripts/debug-common-env.txt && env import -t 0x200000 ${filesize}
-tftpfdt=true
diff --git a/board/keymile/scripts/debug-common-env.txt b/board/keymile/scripts/debug-common-env.txt
deleted file mode 100644 (file)
index 1fd4b0c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-addramfs=setenv bootargs "${bootargs} phram.phram=rootfs${boot_bank},${rootfsaddr},${rootfssize}"
-develop=setenv subbootcmds "tftpfdt tftpkernel nfsargs ${commonargs} boot " && setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && km_setboardid && saveenv && reset
-nfsargs=setenv bootargs ubi.mtd=ubi0 root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
-ramfs=setenv actual_bank -1 && setenv subbootcmds "tftpfdt tftpkernel setrootfsaddr tftpramfs flashargs ${commonargs} addpanic addramfs boot " && setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && run setboardid && run setramfspram && run setpnvramaddr && saveenv && reset
-rootfsfile=${hostname}/rootfsImage
-setramfspram=setexpr value 0 + ${reservedpram} && setexpr value 0x${value} + ${rootfssize} && setexpr value 0x${value} + ${varsize} && setexpr value 0x${value} + ${pnvramsize} && setexpr value 0x${value} / 0x400 && setenv pram 0x${value}
-tftpkernel=tftpboot ${kernel_addr_r} ${hostname}/uImage && setenv actual_kernel_addr ${kernel_addr_r}
-tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage && setenv loadaddr
-setrootfsaddr=setexpr value ${pnvramsize} - ${rootfssize} && setenv rootfsaddr 0x${value}
diff --git a/board/keymile/scripts/debug-ppc-env.txt b/board/keymile/scripts/debug-ppc-env.txt
deleted file mode 100644 (file)
index 3c06ff1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-debug_env_common=tftpboot 0x200000 scripts/debug-common-env.txt && env import -t 0x200000 ${filesize}
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb && setenv actual_fdt_addr ${fdt_addr_r}
diff --git a/board/keymile/scripts/develop-arm.txt b/board/keymile/scripts/develop-arm.txt
new file mode 100644 (file)
index 0000000..922afea
--- /dev/null
@@ -0,0 +1,2 @@
+setup_debug_env=tftpboot 0x200000 scripts/develop-common.txt && env import -t 0x200000 ${filesize} && run configure
+tftpfdt=true
diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt
new file mode 100644 (file)
index 0000000..3ccd039
--- /dev/null
@@ -0,0 +1,6 @@
+altbootcmd=run ${subbootcmds}
+bootcmd=run ${subbootcmds}
+configure=km_setboardid && saveenv && reset
+subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
+nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:/opt/eldk/${arch}
+tftpkernel=tftpboot ${load_addr_r} ${hostname}/uImage
diff --git a/board/keymile/scripts/develop-ppc_82xx.txt b/board/keymile/scripts/develop-ppc_82xx.txt
new file mode 100644 (file)
index 0000000..909f6a3
--- /dev/null
@@ -0,0 +1,2 @@
+setup_debug_env=tftpboot 0x200000 scripts/develop-common.txt && env import -t 0x200000 ${filesize} && run configure
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
diff --git a/board/keymile/scripts/develop-ppc_8xx.txt b/board/keymile/scripts/develop-ppc_8xx.txt
new file mode 100644 (file)
index 0000000..909f6a3
--- /dev/null
@@ -0,0 +1,2 @@
+setup_debug_env=tftpboot 0x200000 scripts/develop-common.txt && env import -t 0x200000 ${filesize} && run configure
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
diff --git a/board/keymile/scripts/ramfs-arm.txt b/board/keymile/scripts/ramfs-arm.txt
new file mode 100644 (file)
index 0000000..79974f1
--- /dev/null
@@ -0,0 +1,2 @@
+setup_debug_env=tftpboot 0x200000 scripts/ramfs-common.txt && env import -t 0x200000 ${filesize} && run configure
+tftpfdt=true
diff --git a/board/keymile/scripts/ramfs-common.txt b/board/keymile/scripts/ramfs-common.txt
new file mode 100644 (file)
index 0000000..9315500
--- /dev/null
@@ -0,0 +1,12 @@
+addramfs=setenv bootargs "${bootargs} mem=${rootfsaddr} phram.phram=rootfs${boot_bank},${rootfsaddr},${rootfssize}"
+actual_bank=-1
+altbootcmd=run ${subbootcmds}
+bootcmd=run ${subbootcmds}
+subbootcmds=tftpfdt tftpkernel setrootfsaddr tftpramfs flashargs add_default addpanic addramfs boot
+nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
+configure=km_setboardid && run setramfspram && saveenv && reset
+setramfspram=setexpr value 0 + ${rootfssize} && setexpr value 0x${value} / 0x400 && setexpr value 0x${value} + ${pram} && setenv pram 0x${value}
+rootfsfile=${hostname}/rootfsImage
+setrootfsaddr=setexpr value ${pnvramaddr} - ${rootfssize} && setenv rootfsaddr 0x${value}
+tftpkernel=tftpboot ${load_addr_r} ${hostname}/uImage
+tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage
diff --git a/board/keymile/scripts/ramfs-ppc_82xx.txt b/board/keymile/scripts/ramfs-ppc_82xx.txt
new file mode 100644 (file)
index 0000000..970927a
--- /dev/null
@@ -0,0 +1,2 @@
+setup_debug_env=tftpboot 0x200000 scripts/ramfs-common.txt && env import -t 0x200000 ${filesize} && run configure
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
diff --git a/board/keymile/scripts/ramfs-ppc_8xx.txt b/board/keymile/scripts/ramfs-ppc_8xx.txt
new file mode 100644 (file)
index 0000000..970927a
--- /dev/null
@@ -0,0 +1,2 @@
+setup_debug_env=tftpboot 0x200000 scripts/ramfs-common.txt && env import -t 0x200000 ${filesize} && run configure
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
index c40a5417b1269638c2c0d5982b56daa98f225944..c0df6d81b04a27d768099b361dbc140bfa1d2bde 100644 (file)
 #define CONFIG_KM_DEF_ENV_BOOTTARGETS                                  \
        "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
                "flashargs add_default addpanic boot\0"                 \
-       "debug_env="                                                    \
-               "tftp 200000 " CONFIG_KM_ARCH_DBG_FILE " && "           \
+       "develop="                                                      \
+               "tftp 200000 scripts/develop-${arch}.txt && "           \
                "env import -t 200000 ${filesize} && "                  \
-               "run debug_env_common\0"                                \
+               "run setup_debug_env\0"                                 \
+       "ramfs="                                                        \
+               "tftp 200000 scripts/ramfs-${arch}.txt && "             \
+               "env import -t 200000 ${filesize} && "                  \
+               "run setup_debug_env\0"                                 \
        ""
 
 /*
index 7aaa8d21e85c23e1259d488061e0b1c91151cadc..4cec57cf3128634a7caa61f1ed0e371675613d9a 100644 (file)
@@ -83,6 +83,4 @@
                "protect on " xstr(BOOTFLASH_START) "  +${filesize}\0"  \
        ""
 
-#define CONFIG_KM_ARCH_DBG_FILE                "scripts/debug-ppc-env.txt"
-
 #endif /* __CONFIG_KEYMILE_POWERPC_H */
index 446c1d0b8b42ac827ff9d2d2223e3e390d0df145..b89631c806732f81f2f75393912c1df7804b6b85 100644 (file)
@@ -87,7 +87,7 @@
        "newenv="                                                       \
                "prot off 0xFE0C0000 +0x40000 && "                      \
                "era 0xFE0C0000 +0x40000\0"                             \
-       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
+       "arch=ppc_82xx\0"                                       \
        ""
 
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE
index 6fab45eb801d2ae9ce8784b90b31da57cbf10550..902ae26e550959008836f8dcb79f70ba1c62cb98 100644 (file)
@@ -33,8 +33,7 @@
 #define CONFIG_MPC832x /* MPC832x CPU specific */
 #define CONFIG_KM8321  /* Keymile PBEC8321 board specific */
 
-#define CONFIG_KM_DEF_ROOTPATH         \
-       "rootpath=/opt/eldk/ppc_8xx\0"
+#define CONFIG_KM_DEF_ARCH     "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
 #include "km83xx-common.h"
index 85b6ed200474dbd72ce46c6163a8c562912df2dd..2b1a84a5ed09dbb4382d49c04475f2d22838e12f 100644 (file)
 #define CONFIG_KM_DEF_ENV "km-common=empty\0"
 #endif
 
-#ifndef CONFIG_KM_DEF_ROOTPATH
-#define CONFIG_KM_DEF_ROOTPATH         \
-       "rootpath=/opt/eldk/ppc_82xx\0"
+#ifndef CONFIG_KM_DEF_ARCH
+#define CONFIG_KM_DEF_ARCH     "arch=ppc_82xx\0"
 #endif
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        CONFIG_KM_DEF_ENV                                               \
-       CONFIG_KM_DEF_ROOTPATH                                          \
+       CONFIG_KM_DEF_ARCH                                              \
        "dtt_bus=pca9547:70:a\0"                                        \
        "EEprom_ivm=pca9547:70:9\0"                                     \
        "newenv="                                                       \
index 7eb5cd49f6baa9b2e08ceb60b978f732369e3ad0..23717f4cbd1cbed3547f6a7505f34cb6a485a463 100644 (file)
@@ -77,8 +77,6 @@
        CONFIG_KM_DEF_ENV_UPDATE                                        \
        ""
 
-#define CONFIG_KM_ARCH_DBG_FILE                "scripts/debug-arm-env.txt"
-
 #define CONFIG_SKIP_LOWLEVEL_INIT      /* disable board lowlevel_init */
 #define CONFIG_MISC_INIT_R
 
@@ -243,7 +241,7 @@ int get_scl(void);
                " ${addr} " xstr(CONFIG_ENV_OFFSET) " 4 && "            \
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
                " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
-       "rootpath=/opt/eldk/arm\0"                                      \
+       "arch=arm\0"                                                    \
        "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
        ""