Howto: Roll your own u-boot for GoFlexHome August 09, 2013 05:19PM |
Registered: 11 years ago Posts: 20 |
$ tar xf u-boot-2013.07.tar.bz2 $ cd u-boot-2013.07 $ make goflexhome_config
/* * Copyright (C) 2013 Suriyan Ramasami <suriyan.r@gmail.com> * * Based on dockstar.h originally written by * Copyright (C) 2010 Eric C. Cooper <ecc@cmu.edu> * * Based on sheevaplug.h originally written by * Prafulla Wadaskar <prafulla@marvell.com> * (C) Copyright 2009 * Marvell Semiconductor <www.marvell.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., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef _CONFIG_GOFLEXHOME_H #define _CONFIG_GOFLEXHOME_H /* * Version number information */ #define CONFIG_IDENT_STRING "\nSeagate GoFlex Home" /* * High Level Configuration Options (easy to change) */ #define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ #define CONFIG_KIRKWOOD 1 /* SOC Family Name */ #define CONFIG_KW88F6281 1 /* SOC Name */ #define CONFIG_MACH_TYPE MACH_TYPE_GOFLEXHOME /* Machine type */ #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ /* * Default GPIO configuration and LED status */ #define GOFLEXHOME_OE_LOW (~(0)) #define GOFLEXHOME_OE_HIGH (~(0)) #define GOFLEXHOME_OE_VAL_LOW (1 << 29) /* USB_PWEN low */ #define GOFLEXHOME_OE_VAL_HIGH (1 << 17) /* LED pin high */ /* PHY related */ #define MV88E1116_LED_FCTRL_REG 10 #define MV88E1116_CPRSP_CR3_REG 21 #define MV88E1116_MAC_CTRL_REG 21 #define MV88E1116_PGADR_REG 22 #define MV88E1116_RGMII_TXTM_CTRL (1 << 4) #define MV88E1116_RGMII_RXTM_CTRL (1 << 5) /* * Commands configuration */ #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ #define CONFIG_CONSOLE_MUX #define CONFIG_SYS_CONSOLE_IS_IN_ENV #define CONFIG_SYS_HUSH_PARSER 1 /* use the "Hush" shell */ #include <config_cmd_default.h> #define CONFIG_CMD_DHCP #define CONFIG_CMD_ENV #define CONFIG_CMD_MII #define CONFIG_CMD_NAND #define CONFIG_CMD_PING #define CONFIG_CMD_USB #define CONFIG_CMD_IDE #define CONFIG_CMD_DATE #define CONFIG_CMD_EXT4 #define CONFIG_SYS_MVFS /* Picks up Filesystem from mv-common.h */ /* * mv-common.h should be defined after CMD configs since it used them * to enable certain macros */ #include "mv-common.h" /* #define CONFIG_SYS_TEXT_BASE 0x00060000 */ #define CONFIG_JFFS2_NAND #define CONFIG_JFFS2_LZO #undef CONFIG_SYS_PROMPT /* previously defined in mv-common.h */ #define CONFIG_SYS_PROMPT "GFH >> " /* Command Prompt */ /* * Environment variables configurations */ #ifdef CONFIG_CMD_NAND #define CONFIG_ENV_IS_IN_NAND 1 #define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ #else #define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ #endif /* * max 4k env size is enough, but in case of nand * it has to be rounded to sector size */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */ #define CONFIG_ENV_ADDR 0xA0000 #define CONFIG_ENV_OFFSET 0xA0000 /* env starts here */ #define CONFIG_CMDLINE_TAG 1 #define CONFIG_INITRD_TAG 1 #define CONFIG_SETUP_MEMORY_TAGS 1 /* * Default environment variables */ /* #define CONFIG_BOOTCOMMAND \ "setenv bootargs console=${console} ${mtdparts} ${bootargs_root}; " \ "ubi part root; " \ "ubifsmount ubi:root; " \ "ubifsload 0x800000 ${kernel}; " \ "bootm 0x800000" */ #define CONFIG_BOOTCOMMAND \ "mw 0x800000 0 1;" \ "run setdevice_usb;" \ "run bootcmd_device;" \ "run setdevice_ide;" \ "run bootcmd_device;" \ "run bootcmd_ubifs;" \ "reset" #define CONFIG_MTDPARTS \ "mtdparts=orion_nand:1M(u-boot),6M(uImage),-(root)\0" #define CONFIG_LOADS_ECHO 0 #define CONFIG_ETHPRIME "egiga0" #define CONFIG_AUTOLOAD "no" #define CONFIG_ROOTPATH "/boot/uImage" #define CONFIG_LOADADDR 0x02000000 /* Defaults taken from original u-boot defaults from device */ #define CONFIG_ETHADDR 00:50:43:f8:1b:1c #define CONFIG_IPADDR 169.254.254.253 #define CONFIG_SERVERIP 169.254.254.254 #define CONFIG_EXTRA_ENV_SETTINGS \ "console=ttyS0,115200\0" \ "mtdids=nand0=orion_nand\0" \ "mtdparts=" CONFIG_MTDPARTS \ "bootcmd_device=run device_setup; if ext2load ${device_interface} ${device_part} 0x800000 ${rootpath}; then run device_bootargs; run device_boot; fi\0" \ "bootcmd_ubifs=run setdevice_ubi; ubi part root 2048; ubifsmount ubi0:rootfs; run device_bootargs; setenv bootargs ubi.mtd=2,2048 ${bootargs}; nand read 0x800000 0x100000 0x600000; bootm 0x800000\0" \ "device_setup=$device_interface reset\0" \ "device_part=0:1\0" \ "device_bootargs=setenv bootargs console=${console} mtdparts=${mtdparts} root=${device_root} rootdelay=${device_rootdelay} rootfstype=${device_rootfs}\0" \ "device_boot=if ext2load ${device_interface} ${device_part} 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000;else bootm 0x800000;fi\0" \ "setdevice_usb=setenv device_interface usb; setenv device_root LABEL=rootfs; setenv device_rootdelay 5; setenv device_rootfs ext2;\0" \ "setdevice_ide=setenv device_interface ide; setenv device_root /dev/sda1; setenv device_rootdelay 1; setenv device_rootfs ext3;\0" \ "setdevice_ubi=setenv device_root ubi:rootfs; setenv device_rootdelay 1; setenv device_rootfs ubifs;\0" /* * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ #define CONFIG_PHY_BASE_ADR 0 #endif /* CONFIG_CMD_NET */ /* * * SATA Driver configuration * */ #ifdef CONFIG_MVSATA_IDE #define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET #endif /*CONFIG_MVSATA_IDE*/ /* * * RTC driver configuration * */ #ifdef CONFIG_CMD_DATE #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ #endif /* _CONFIG_GOFLEXHOME_H */
codesourcery-arm-2011.03.sh export CONCURRENCY_LEVEL=2 make u-boot.kwb exit
dd if=u-boot.kwb of=uboot.mtd0.kwb bs=512K conv=sync
cat /dev/mtd0 0xA0000 0x20000 0x20000 > /etc/fw_env.config cp blparam /usr/sbin cp flash_erase /usr/sbin cp nanddump /usr/sbin cp nandwrite /usr/sbin cp fw_printenv /usr/sbin ln -s /usr/sbin/fw_printenv /usr/sbin/fw_saveenv export PATH=/usr/sbin:/sbin:$PATH fw_printenv > envbackup.txt nanddump -nof uboot.mtd0.bak -l 0x100000 /dev/mtd0 nanddump -nof uImage.mtd1.bak -l 0x600000 /dev/mtd1 nanddump -nof rootfs.mtd2.bak -l 0xf900000 /dev/mtd2
nandwrite uboot.mtd0.kwb /dev/mtd0 nandwrite uImage.mtd1.kwb /dev/mtd1
Clément
Re: Howto: Roll your own u-boot for GoFlexHome September 21, 2013 07:28AM |
Preparing kirkwood boot image to boot from nand Nand ECC mode = default Nand page size = 0x800 Image Type: Kirkwood Boot from NAND Flash Image Data Size: 396648 Bytes = 387.35 kB = 0.38 MB Load Address: 00600000 Entry Point: 00600000
tftp 0x800000 uboot.mtd0.kwb go 0x800200
## Starting application at 0x00800200 ...
Clément
Re: Howto: Roll your own u-boot for GoFlexHome September 22, 2013 05:48AM |