diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-12-14 16:46:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-15 11:34:13 +0100 |
commit | e305a3dbe4a80adac8b174e04fa5ee39a39921f8 (patch) | |
tree | df11398533b80220bac590a2561c1fc03b4f8583 /arch/arm/boards/at91sam9260ek | |
parent | c2580681e5f02c4fb273e8fec0b35bc191bfbcad (diff) | |
download | barebox-e305a3dbe4a80adac8b174e04fa5ee39a39921f8.tar.gz barebox-e305a3dbe4a80adac8b174e04fa5ee39a39921f8.tar.xz |
at91sam9260/9g20-ek: update nand support
by default boot from nand with the bootstrap as first stage
update the smc config for 9g20-ek
switch to defaultenv
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/at91sam9260ek')
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/_update | 36 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/boot | 38 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/init | 19 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/pcidmaloop | 14 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/pciloop | 13 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/update_kernel | 8 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/bin/update_root | 8 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/env/config | 45 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9260ek/init.c | 42 |
9 files changed, 69 insertions, 154 deletions
diff --git a/arch/arm/boards/at91sam9260ek/env/bin/_update b/arch/arm/boards/at91sam9260ek/env/bin/_update deleted file mode 100644 index 014bce3512..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/_update +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -if [ -z "$part" -o -z "$image" ]; then - echo "define \$part and \$image" - exit 1 -fi - -if [ ! -e "$part" ]; then - echo "Partition $part does not exist" - exit 1 -fi - -if [ $# = 1 ]; then - image=$1 -fi - -if [ x$ip = xdhcp ]; then - dhcp -fi - -ping $eth0.serverip -if [ $? -ne 0 ] ; then - echo "update aborted" - exit 1 -fi - -unprotect $part - -echo -echo "erasing partition $part" -erase $part - -echo -echo "flashing $image to $part" -echo -tftp $image $part diff --git a/arch/arm/boards/at91sam9260ek/env/bin/boot b/arch/arm/boards/at91sam9260ek/env/bin/boot deleted file mode 100644 index ed6f11a108..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/boot +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -. /env/config - -if [ x$1 = xflash ]; then - root=flash - kernel=flash -fi - -if [ x$1 = xnet ]; then - root=net - kernel=net -fi - -if [ x$ip = xdhcp ]; then - bootargs="$bootargs ip=dhcp" -else - bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::" -fi - -if [ x$root = xflash ]; then - bootargs="$bootargs root=$rootpart rootfstype=jffs2" -else - bootargs="$bootargs root=/dev/nfs nfsroot=192.168.23.111:$nfsroot" -fi - -bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts" - -if [ $kernel = net ]; then - if [ x$ip = xdhcp ]; then - dhcp - fi - tftp $uimage uImage - bootm uImage -else - bootm /dev/nor0.kernel -fi - diff --git a/arch/arm/boards/at91sam9260ek/env/bin/init b/arch/arm/boards/at91sam9260ek/env/bin/init deleted file mode 100644 index b8d8399842..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/init +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -PATH=/env/bin -export PATH - -. /env/config - -echo -echo -n "Hit any key to stop autoboot: " -timeout -a $autoboot_timeout -if [ $? != 0 ]; then - echo - echo "type update_kernel [<imagename>] to update kernel into flash" - echo "type udate_root [<imagename>] to update rootfs into flash" - echo - exit -fi - -boot
\ No newline at end of file diff --git a/arch/arm/boards/at91sam9260ek/env/bin/pcidmaloop b/arch/arm/boards/at91sam9260ek/env/bin/pcidmaloop deleted file mode 100644 index 24e76cbed7..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/pcidmaloop +++ /dev/null @@ -1,14 +0,0 @@ -pci stat -pci stat -c -while true; do - pci readm 32 0xA1000000 32 -s - pci readm 32 0xA2000000 256 -s - pci dmatx 2000 a2000100 128 -s - pci writem 32 0xa2000100 0x12345678 4 -s - pci readm 32 0xA3000000 256 -s - pci dmatx 2000 a3000040 128 -s - pci writem 32 0xa3000100 0x12345678 4 -s - pci readm 32 0xA4000000 16 -s - pci dmatx 2000 a4000080 4 -s - pci writem 32 0xa4000080 0x12345678 4 -s -done diff --git a/arch/arm/boards/at91sam9260ek/env/bin/pciloop b/arch/arm/boards/at91sam9260ek/env/bin/pciloop deleted file mode 100644 index 4a804f9f31..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/pciloop +++ /dev/null @@ -1,13 +0,0 @@ -pci stat -pci stat -c -while true; do - pci readm 32 0xA1000000 32 -s - pci readm 32 0xA2000000 256 -s - pci writem 32 0xa2000100 0x12345678 4 -s - pci readm 32 0xA3000000 256 -s - pci writem 32 0xa3000100 0x12345678 4 -s - pci readm 32 0xA4000000 16 -s - pci writem 32 0xa4000080 0x12345678 4 -s - -# pci dmatx 2000 a3000040 128 -s -done diff --git a/arch/arm/boards/at91sam9260ek/env/bin/update_kernel b/arch/arm/boards/at91sam9260ek/env/bin/update_kernel deleted file mode 100644 index 1ad95fc5d6..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/update_kernel +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -. /env/config - -image=$uimage -part=/dev/nor0.kernel - -. /env/bin/_update $1 diff --git a/arch/arm/boards/at91sam9260ek/env/bin/update_root b/arch/arm/boards/at91sam9260ek/env/bin/update_root deleted file mode 100644 index b757a5b922..0000000000 --- a/arch/arm/boards/at91sam9260ek/env/bin/update_root +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -. /env/config - -image=$jffs2 -part=/dev/nor0.root - -. /env/bin/_update $1 diff --git a/arch/arm/boards/at91sam9260ek/env/config b/arch/arm/boards/at91sam9260ek/env/config index 71d6f88cfe..ba14c2bfc5 100644 --- a/arch/arm/boards/at91sam9260ek/env/config +++ b/arch/arm/boards/at91sam9260ek/env/config @@ -1,20 +1,41 @@ #!/bin/sh -# can be either 'net' or 'flash' -kernel=net -root=net - -# use 'dhcp' todo dhcp in barebox and in kernel +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp -# -# setup default ethernet address -# -eth0.serverip=192.168.23.108 +# or set your networking parameters here +#eth0.ipaddr=a.b.c.d +#eth0.netmask=a.b.c.d +#eth0.gateway=a.b.c.d +#eth0.serverip=a.b.c.d + +# can be either 'nfs', 'tftp', 'nor' or 'nand' +kernel_loc=nfs +# can be either 'net', 'nor', 'nand' or 'initrd' +rootfs_loc=net + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root.$rootfs_type -uimage=uImage-at91sam9260ek +# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo +#kernelimage_type=zimage +#kernelimage=zImage +kernelimage_type=uimage +kernelimage=uImage +#kernelimage_type=raw +#kernelimage=Image +#kernelimage_type=raw_lzo +#kernelimage=Image.lzo + +nand_device=atmel_nand +nand_parts="128k(at91bootstrap),256k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),4M(kernel),120M(rootfs),-(data)" +rootfs_mtdblock_nand=5 autoboot_timeout=3 -nfsroot="/home/jbe/pengutronix/bsp/OSELAS.BSP-Phytec-phyCORE-i.MX27-trunk/root,v3" -bootargs="console=ttyS0,115200 rw init=/bin/sh" +bootargs="console=ttyS0,115200" + +# set a fancy prompt (if support is compiled in) +PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m\n# " diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c index 958319e4ad..5aacc75123 100644 --- a/arch/arm/boards/at91sam9260ek/init.c +++ b/arch/arm/boards/at91sam9260ek/init.c @@ -31,6 +31,7 @@ #include <io.h> #include <asm/hardware.h> #include <nand.h> +#include <sizes.h> #include <linux/mtd/nand.h> #include <mach/board.h> #include <mach/at91sam9_smc.h> @@ -72,7 +73,7 @@ static struct atmel_nand_data nand_pdata = { #endif }; -static struct sam9_smc_config ek_nand_smc_config = { +static struct sam9_smc_config ek_9260_nand_smc_config = { .ncs_read_setup = 0, .nrd_setup = 1, .ncs_write_setup = 0, @@ -90,16 +91,41 @@ static struct sam9_smc_config ek_nand_smc_config = { .tdf_cycles = 2, }; +static struct sam9_smc_config ek_9g20_nand_smc_config = { + .ncs_read_setup = 0, + .nrd_setup = 2, + .ncs_write_setup = 0, + .nwe_setup = 2, + + .ncs_read_pulse = 4, + .nrd_pulse = 4, + .ncs_write_pulse = 4, + .nwe_pulse = 4, + + .read_cycle = 7, + .write_cycle = 7, + + .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, + .tdf_cycles = 3, +}; + static void ek_add_device_nand(void) { + struct sam9_smc_config *smc; + + if (machine_is_at91sam9g20ek()) + smc = &ek_9g20_nand_smc_config; + else + smc = &ek_9260_nand_smc_config; + /* setup bus-width (8 or 16) */ if (nand_pdata.bus_width_16) - ek_nand_smc_config.mode |= AT91_SMC_DBW_16; + smc->mode |= AT91_SMC_DBW_16; else - ek_nand_smc_config.mode |= AT91_SMC_DBW_8; + smc->mode |= AT91_SMC_DBW_8; /* configure chip-select 3 (NAND) */ - sam9_smc_configure(3, &ek_nand_smc_config); + sam9_smc_configure(3, smc); at91_add_device_nand(&nand_pdata); } @@ -156,10 +182,14 @@ static int at91sam9260ek_devices_init(void) armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100)); ek_set_board_type(); - devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self_raw"); + devfs_add_partition("nand0", 0x00000, SZ_128K, PARTITION_FIXED, "at91bootstrap_raw"); + dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); + devfs_add_partition("nand0", SZ_128K, SZ_256K, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); - devfs_add_partition("nand0", 0x80000, 0x20000, PARTITION_FIXED, "env_raw"); + devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); + devfs_add_partition("nand0", SZ_512K, SZ_128K, PARTITION_FIXED, "env_raw1"); + dev_add_bb_dev("env_raw1", "env1"); return 0; } |