OpenRD の U-Boot に関するページです。

U-Boot

OpenRD でも Sheeva Plug 同様、ブートローダに U-Boot が採用されている。

        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__| 
 ** MARVELL BOARD: OpenRD-Client LE 

U-Boot 1.1.4 (Apr 22 2009 - 20:18:28) Marvell version: 3.4.16

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CEE80

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz 

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB 
DRAM CS[1] base 0x10000000   size 256MB 
DRAM Total size 512MB  16bit width
Flash:  0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB

Checking for BootROM Routine Errors

No. of BootROM routine retries: 8
NAND: Nand ECC error

Running POST...

	DDR2 data bus test                               PASSED

	DDR2 address bus test                            PASSED

	UART 1 internal loopback test on baudrate   9600 PASSED
	UART 1 internal loopback test on baudrate  19200 PASSED
	UART 1 internal loopback test on baudrate 115200 PASSED

	Device: 0, Size: 512 MB, Page Size: 2 KB, Block Size: 128 KB
	NAND detection test                              PASSED

	Bad Block: 09560000
	Bad Block: 0d560000
	Bad Block: 140a0000
	NAND bad-block detection test                    PASSED

	RTC test                                         PASSED

6/6 tests PASSED
POST completed

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled

Module 0 is AUDIO
Module 1 is RGMII

USB 0: host mode
PCI 0: PCI Express Root Complex Interface
PEX interface detected Link X1
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0 
Marvell>> 

Hit any key to stop autoboot のところで何かキーを入力すると、コマンド入力待ちになる。

Marvell>> version 

U-Boot 1.1.4 (Apr 22 2009 - 20:18:28) Marvell version: 3.4.16

コマンド一覧

Marvell>> help
?       - alias for 'help'
base    - print or set address offset
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootext2    dev:boot_part1,boot_part2 addr boot_image linux_dev_name 
bootm   - boot application image from memory
bootp	- boot image via network using BootP/TFTP protocol
bubt	- Burn an image on the Boot Nand Flash.
chpart	- change active partition
cmp     - memory compare
cmpm	- Compare Memory
cp      - memory copy
cpumap - Display CPU memory mapping settings.
crc32   - checksum calculation
date    - get/set/reset date & time
dclk	- Display the MV device CLKs.
dhcp	- invoke DHCP client to obtain IP/boot params
diskboot- boot from IDE device
echo    - echo args to console
eeprom  - EEPROM sub-system
erase   - erase FLASH memory
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fi	- Find value in the memory.
flinfo  - print FLASH memory information
fsinfo	- print information about filesystems
fsload	- load binary file from a filesystem image
g	- start application at cached address 'addr'(default addr 0x40000)
go      - start application at address 'addr'
help    - print online help
icrc32  - checksum calculation
ide     - IDE sub-system
iloop   - infinite loop on address range
imd     - i2c memory display
imm[.b, .s, .w, .l]     - i2c memory modify (auto-incrementing)
imw     - memory write (fill)
inm     - memory modify (constant address)
iprobe  - probe to discover valid I2C chip addresses
ir	- reading and changing MV internal register values.
loop    - infinite loop on address range
ls	- list files in a directory (default /)
map	- Diasplay address decode windows
md      - memory display
me	- PCI master enable
mm      - memory modify (auto-incrementing)
mp	- map PCI BAR
mtdparts- define flash/nand partitions
mtest   - simple RAM test
mv_diag - perform board diagnostics
mv_diag
        - display all available tests
mv_diag all
        - run all available tests
mv_diag test1
        - run specified test
mw      - memory write (fill)
nand                   - NAND sub-system
nboot   - boot from NAND device
nbubt	- Burn a boot loader image on the Boot Nand Flash.
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
phyRead	- Read PCI-E Phy register
pciePhyWrite	- Write PCI-E Phy register
phyRead	- Read Phy register
phyWrite	- Write Phy register
ping	- send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
rcvr	- Satrt recovery process (Distress Beacon with TFTP server)
reset   - Perform RESET of the CPU
resetenv	- Return all environment variable to default.
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
se	- PCI Slave enable
setenv  - set environment variables
sflash	- read, write or erase the external SPI Flash.
sg	- scanning the PHYs status
sp	- Scan PCI bus.
tftpboot- boot image via network using TFTP protocol
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor version

時計

これも購入時はめちゃくちゃな日付・時刻になっているので、U-Boot で 時計を正しい値にしておくのが望ましい。

Marvell>> date
Date: 2000-05-17 (Wednesday)    Time: 12:42:36
Marvell>> help date
date [MMDDhhmm[[CC]YY][.ss]]
date reset
  - without arguments: print date & time
  - with numeric argument: set the system date & time
  - with 'reset' argument: reset the RTC
Marvell>> date 1028112609
Date: 2009-10-28 (Wednesday)    Time: 11:26:00

時刻はUTC(日本標準時から9時間引いた値)を入力する。この例では、2009/10/28 20:26 JST = 11:26 UTC である。 一度も日付時刻設定をしていないと、2022年とかおかしな日付になってしまうことがあるので注意。

各種コマンド出力

dclk

Marvell>> dclk
TCLK 200Mhz, SYSCLK 400Mhz (UART baudrate 115200)

iprobe

Marvell>> iprobe
Valid chip addresses: 4A 64

map

Marvell>> map

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 256MB 
SDRAM_CS1 ....base 10000000, size 256MB 
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base 90000000, size 256MB 
PEX0_IO ....base f0000000, size  16MB 
INTER_REGS ....base f1000000, size   1MB 
NFLASH_CS ....base f9000000, size   8MB 
SPI_CS ....base f8000000, size  16MB 
BOOT_ROM_CS ....base fff80000, size 512KB 
DEV_BOOTCS ....base fff80000, size 512KB 
CRYPT_ENG ....base fb000000, size  64KB 

AHB To MBUS Bridge:
-------------------
win0 - PEX0_MEM base 90000000, ....size 256MB 
win1 - NFLASH_CS base f9000000, ....size   8MB 
win2 - PEX0_IO base f0000000, ....size  16MB 
win3 - SPI_CS base f8000000, ....size  16MB 
win4 - BOOT_ROM_CS base fff80000, ....size 512KB 
win5 - disable
win6 - disable
win7 - CRYPT_ENG base fb000000, ....size  64KB 
win8 - INTER_REGS base f1000000, ....size   1MB 

PEX0:
-----

Pex Bars 

Internal Regs Bar0.... base f1000000, size   1MB 
DRAM Bar1............. base 00000000, size 512MB 
Devices Bar2.......... disable

Pex Decode Windows

win0 - SDRAM_CS0 base 00000000, ....size 256MB 
win1 - SDRAM_CS1 base 10000000, ....size 256MB 
win2 - disable
win3 - disable
win4 - disable
win5 - disable
default win - target unknown 
Expansion ROM - NFLASH_CS 

USB:
----
Device 0:
win0 - SDRAM_CS0 base 00000000, size 256MB 
win1 - SDRAM_CS1 base 10000000, size 256MB 
win2 - PEX0_MEM base 90000000, size 256MB 
win3 - disable

ETH 0:
----
win0 - SDRAM_CS0 base 00000000, ....size 256MB 
win1 - SDRAM_CS1 base 10000000, ....size 256MB 
win2 - NFLASH_CS base f9000000, ....size   8MB 
win3 - SPI_CS base f8000000, ....size  16MB 
win4 - BOOT_ROM_CS base fff80000, ....size 512KB 
win5 - disable

ETH 1:
----
win0 - SDRAM_CS0 base 00000000, ....size 256MB 
win1 - SDRAM_CS1 base 10000000, ....size 256MB 
win2 - NFLASH_CS base f9000000, ....size   8MB 
win3 - SPI_CS base f8000000, ....size  16MB 
win4 - BOOT_ROM_CS base fff80000, ....size 512KB 
win5 - disable

XOR 0:
----
win0 - NFLASH_CS base f9000000, size   8MB 
win1 - PEX0_MEM base 90000000, size 256MB 
win2 - SDRAM_CS0 base 0, size 256MB 
win3 - SDRAM_CS1 base 10000000, size 256MB 
win4 - SPI_CS base f8000000, size  16MB 
win5 - CRYPT_ENG base fb000000, size  64KB 
win6 - disable
win7 - disable

XOR 1:
----
win0 - NFLASH_CS base f9000000, size   8MB 
win1 - PEX0_MEM base 90000000, size 256MB 
win2 - SDRAM_CS0 base 0, size 256MB 
win3 - SDRAM_CS1 base 10000000, size 256MB 
win4 - SPI_CS base f8000000, size  16MB 
win5 - CRYPT_ENG base fb000000, size  64KB 
win6 - disable
win7 - disable

SATA 0:
----
win0 - SDRAM_CS0 base 00000000, ....size 256MB 
win1 - SDRAM_CS1 base 10000000, ....size 256MB 
win2 - SDRAM_CS2 base 20000000, ....size 256MB 
win3 - SDRAM_CS3 base 30000000, ....size 256MB 

SATA 1:
----
win0 - SDRAM_CS0 base 00000000, ....size 256MB 
win1 - SDRAM_CS1 base 10000000, ....size 256MB 
win2 - SDRAM_CS2 base 20000000, ....size 256MB 
win3 - SDRAM_CS3 base 30000000, ....size 256MB 

AUDIO:
----
win0 - SDRAM_CS0 base 00000000, ....size 256MB 
win1 - SDRAM_CS1 base 10000000, ....size 256MB 
Marvell>> 

mv_diag

Marvell>> mv_diag
Available tests are: 
 data_bus
 addr_bus
 device
 uart_int
 uart_ext
 nand_detect
 nand_bad_block
 nand_rw
 gbe_link
 rtc

デフォルトの環境変数

Marvell>> printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
eth1mtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
ethaddr=00:50:43:xx:xx:xx
eth1addr=00:50:43:xx:xx:xx
run_diag=no
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw ubi.mtd=1,2048 root=ubi0:rootfs rootfstype=ubifs
bootcmd=nand read.e 0x800000 0x100000 0x400000; bootm 0x800000
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes

DENX 版

marvel-git

$ git clone git://git.denx.de/u-boot-marvell.git
$ cd u-boot-marvell/
$ vi scripts/kconfig/menu.c
$ make openrd_base_config
$ make u-boot.kwb

以下の warnig が出る。

In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     jump->offset = strlen(r->s);
                  ^
scripts/kconfig/menu.c:551:19: note: ‘jump’ was declared here
  struct jump_key *jump;
                   ^

scripts/kconfig/menu.c の修正

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index a26cc5d..72c9dba 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
 {
 	int i, j;
 	struct menu *submenu[8], *menu, *location = NULL;
-	struct jump_key *jump;
+	struct jump_key *jump = NULL;
 
 	str_printf(r, _("Prompt: %s\n"), _(prop->text));
 	menu = prop->menu->parent;
@@ -586,7 +586,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
 		str_printf(r, _("  Location:\n"));
 		for (j = 4; --i >= 0; j += 2) {
 			menu = submenu[i];
-			if (head && location && menu == location)
+			if (jump && menu == location)
 				jump->offset = strlen(r->s);
 			str_printf(r, "%*c-> %s", j, ' ',
 				   _(menu_get_prompt(menu)));

[PATCH v2] kconfig: Fix warning "‘jump’ may be used uninitialized" -- Linux Kbuild

version

Marvell>> version

U-Boot 2014.10-rc3-17415-g8fdd6f0 (Dec 25 2014 - 23:06:29)
OpenRD-Base
arm5tel-unknown-linux-gnueabi-gcc (crosstool-NG 1.20.0) 4.9.1
GNU ld (crosstool-NG 1.20.0) 2.24

USB 関係

  • usb サブコマンド一覧
    Marvell>> usb
    usb - USB sub-system
    
    Usage:
    usb start - start (scan) USB controller
    usb reset - reset (rescan) USB controller
    usb stop [f] - stop USB [f]=force stop
    usb tree - show USB device tree
    usb info [dev] - show available USB devices
    usb test [dev] [port] [mode] - set USB 2.0 test mode
        (specify port 0 to indicate the device's upstream port)
        Available modes: J, K, S[E0_NAK], P[acket], F[orce_Enable]
    usb storage - show details of USB storage devices
    usb dev [dev] - show or set current USB storage device
    usb part [dev] - print partition table of one or all USB storage    devices
    usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'
        to memory address `addr'
    usb write addr blk# cnt - write `cnt' blocks starting at block `blk#'
        from memory address `addr'
  • usb info 実行結果
    Marvell>> usb start
    (Re)start USB...
    USB0:   USB EHCI 1.00
    scanning bus 0 for devices... 2 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    Marvell>> usb info
    1: Hub,  USB Revision 2.0
     - u-boot EHCI Host Controller 
     - Class: Hub
     - PacketSize?: 64  Configurations: 1
     - Vendor: 0x0000  Product 0x0000 Version 1.0
       Configuration: 1
       - Interfaces: 1 Self Powered 0mA
         Interface: 0
         - Alternate Setting 0, Endpoints: 1
         - Class Hub
         - Endpoint 1 In Interrupt MaxPacket? 8 Interval 255ms
    
    2: Mass Storage,  USB Revision 2.0
     - BUFFALO USB Flash Disk 07930EA10281
     - Class: (from Interface) Mass Storage
     - PacketSize?: 64  Configurations: 1
     - Vendor: 0x0411  Product 0x0111 Version 1.16
       Configuration: 1
       - Interfaces: 1 Bus Powered 200mA
         Interface: 0
         - Alternate Setting 0, Endpoints: 2
         - Class Mass Storage, Transp. SCSI, Bulk only
         - Endpoint 1 In Bulk MaxPacket? 512
         - Endpoint 2 Out Bulk MaxPacket? 512
  • usb デバイスの認識状況
    Marvell>> usb dev
    
    USB device 0: Vendor: BUFFALO  Rev: 3.10 Prod: USB Flash Disk  
                Type: Removable Hard Disk
                Capacity: 3818.0 MB = 3.7 GB (7819264 x 512)
    Marvell>> usb part
    
    Partition Map for USB device 0  --   Partition Type: DOS
    
    Part	Start Sector	Num Sectors	UUID		Type
      1	2048      	7817216   	0009d278-01	83
    Marvell>> usb tree
    USB device tree:
      1  Hub (480 Mb/s, 0mA)
      |  u-boot EHCI Host Controller 
      |
      +-2  Mass Storage (480 Mb/s, 200mA)
           BUFFALO USB Flash Disk 07930EA10281
  • ext2ls を使ったファイル一覧取得結果
    Marvell>> ext2ls usb 0:1
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
    <DIR>       4096 mnt
    <DIR>       4096 opt
    <DIR>       4096 proc
    <DIR>       4096 root
    <DIR>       4096 run
    <SYM>          7 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    Marvell>> ext2ls usb 0:1 /boot
    <DIR>       4096 .
    <DIR>       4096 ..
             3124168 uImage

2014.01

$ make distclean
$ make openrd_base_config
Configuring for openrd_base - Board: openrd, Options: BOARD_IS_OPENRD_BASE
$ make u-boot.kwb

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:    386068 Bytes = 377.02 kB = 0.37 MB
Load Address: 00600000
Entry Point:  00600000

$ ls -al u-boot*
-rwxr-xr-x 1 itou-r wheel 2199497 Dec 22 08:29 u-boot
-rw-r--r-- 1 itou-r wheel  386068 Dec 22 08:29 u-boot.bin
-rw-r--r-- 1 itou-r wheel  386584 Dec 22 08:29 u-boot.kwb
-rw-r--r-- 1 itou-r wheel    1194 Dec 22 08:29 u-boot.lds
-rw-r--r-- 1 itou-r wheel  293754 Dec 22 08:29 u-boot.map

OpenOCD を使った U-Boot の更新

母艦の ArchLinux では libftdi が使われていたので、OpenOCD 標準のコンフィグファイルでは書き込みができなかった。秋月で安価に売られている NGX ARM USB JTAGを使ったらなんとか書き込めた。

  • openrd.cfg
    # Marvell OpenRD
    
    source [find interface/ftdi/ngxtech.cfg]
    adapter_khz 2000
    
    source [find target/feroceon.cfg]
    
    $_TARGETNAME configure \
    	-work-area-phys 0x10000000 \
    	-work-area-size 65536 \
    	-work-area-backup 0
    
    arm7_9 dcc_downloads enable
    
    # this assumes the hardware default peripherals location before u-Boot moves it
    set _FLASHNAME $_CHIPNAME.flash
    nand device $_FLASHNAME orion 0 0xd8000000
    
    proc openrd_init { } {
    
    	# We need to assert DBGRQ while holding nSRST down.
    	# However DBGACK will be set only when nSRST is released.
    	# Furthermore, the JTAG interface doesn't respond at all when
    	# the CPU is in the WFI (wait for interrupts) state, so it is
    	# possible that initial tap examination failed.  So let's
    	# re-examine the target again here when nSRST is asserted which
    	# should then succeed.
    	jtag_reset 0 1
    	feroceon.cpu arp_examine
    	halt 0
    	jtag_reset 0 0
    	wait_halt
    
    	arm mcr 15 0 0 1 0 0x00052078
    
    	mww 0xD0001400 0x43000C30 ;#  DDR SDRAM Configuration Register
    	mww 0xD0001404 0x37543000 ;#  Dunit Control Low Register
    	mww 0xD0001408 0x22125451 ;#  DDR SDRAM Timing (Low) Register
    	mww 0xD000140C 0x00000A33 ;#  DDR SDRAM Timing (High) Register
    	mww 0xD0001410 0x000000CC ;#  DDR SDRAM Address Control Register
    	mww 0xD0001414 0x00000000 ;#  DDR SDRAM Open Pages Control Register
    	mww 0xD0001418 0x00000000 ;#  DDR SDRAM Operation Register
    	mww 0xD000141C 0x00000C52 ;#  DDR SDRAM Mode Register
    	mww 0xD0001420 0x00000004 ;#  DDR SDRAM Extended Mode Register
    	mww 0xD0001424 0x0000F17F ;#  Dunit Control High Register
    	mww 0xD0001428 0x00085520 ;#  Dunit Control High Register
    	mww 0xD000147c 0x00008552 ;#  Dunit Control High Register
    	mww 0xD0001504 0x0FFFFFF1 ;#  CS0n Size Register
    	mww 0xD0001508 0x10000000 ;#  CS1n Base Register
    	mww 0xD000150C 0x0FFFFFF5 ;#  CS1n Size Register
    	mww 0xD0001514 0x00000000 ;#  CS2n Size Register
    	mww 0xD000151C 0x00000000 ;#  CS3n Size Register
    	mww 0xD0001494 0x00120012 ;#  DDR2 SDRAM ODT Control (Low) Register
    	mww 0xD0001498 0x00000000 ;#  DDR2 SDRAM ODT Control (High) REgister
    	mww 0xD000149C 0x0000E40F ;#  DDR2 Dunit ODT Control Register
    	mww 0xD0001480 0x00000001 ;#  DDR SDRAM Initialization Control Register
    	mww 0xD0020204 0x00000000 ;#  Main IRQ Interrupt Mask Register
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    	mww 0xD0020204 0x00000000 ;#              "
    
    	mww 0xD0010000 0x01111111 ;#  MPP  0 to 7
    	mww 0xD0010004 0x11113322 ;#  MPP  8 to 15
    	mww 0xD0010008 0x00001111 ;#  MPP 16 to 23
    
    	mww 0xD0010418 0x003E07CF ;#  NAND Read Parameters REgister
    	mww 0xD001041C 0x000F0F0F ;#  NAND Write Parameters Register
    	mww 0xD0010470 0x01C7D943 ;#  NAND Flash Control Register
    
    }
    
    proc openrd_reflash_uboot { } {
    
    	# reflash the u-Boot binary and reboot into it
    	openrd_init
    	nand probe 0
    	nand erase 0 0x0 0xa0000
    	nand write 0 uboot.bin 0 oob_softecc_kw
    	resume
    
    }
    
    proc openrd_load_uboot { } {
    
    	# load u-Boot into RAM and execute it
    	openrd_init
    	load_image uboot.elf
    	verify_image uboot.elf
    	resume 0x00600000
    
    }
    u-boot.kwb を uboot.bin という名前に変更して、カレントディレクトリに置いておく。
    $ ls -al
    合計 2812
    drwxr-xr-x 2 itou-r users    4096 12月 29 18:25 .
    drwxr-xr-x 6 itou-r users    4096 12月 29 14:48 ..
    -rw-r--r-- 1 itou-r users    4566 12月 29 17:09 openrd.cfg
    -rw-r--r-- 1 itou-r users  390848 12月 29 17:55 uboot.bin
    $ sudo openocd -f ./openrd.cfg -s /usr/share/openocd/scripts -c init -c openrd_reflash_uboot
    Open On-Chip Debugger 0.8.0 (2014-04-29-15:41)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.sourceforge.net/doc/doxygen/bugs.html
    adapter speed: 2000 kHz
    WARNING!
    This file was not tested with real interface, but is assumed to work as this
    interface uses the same layout as configs that were verified. Please report your
    experience with this file to openocd-devel mailing list, so it could be marked
    as working or fixed.
    Info : only one transport option; autoselect 'jtag'
    trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
    adapter_nsrst_delay: 200
    jtag_ntrst_delay: 200
    dcc downloads are enabled
    Warn : use 'feroceon.cpu' as target identifier, not '0'
    openrd_load_uboot
    Info : clock speed 2000 kHz
    Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)
    Info : Embedded ICE version 0
    Info : feroceon.cpu: hardware has 1 breakpoint/watchpoint unit
    target state: halted
    target halted in ARM state due to debug-request, current mode: Supervisor
    cpsr: 0x000000d3 pc: 0xffff0000
    MMU: disabled, D-Cache: disabled, I-Cache: disabled
    NAND flash device 'NAND 512MiB 3.3V 8-bit (Hynix)' found
    erased blocks 0 to 4 on NAND flash device #0 'NAND 512MiB 3.3V 8-bit'
    wrote file uboot.bin to NAND flash 0 up to offset 0x0005f800 in 26.164478s (14.588 KiB/s)

情報


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-01-01 (木) 15:15:19 (1146d)