[U-Boot-Users] [PATCH 3/13] SPARC: bootm SPARC support
Daniel Hellstrom
daniel at gaisler.com
Fri Mar 28 13:27:00 CET 2008
Hello Wolfgang,
This patch adds support for SPARC u-boot images to bootm. The IH_ARCH_SPARC
indentifier in the image header is recognized. The IH_ARCH_SPARC indentifier
has already been implemented in mkimage.
---------------------
U-Boot 1.3.2-00273-gf85e20a (Mar 28 2008 - 13:13:48)GAISLER LEON3
GR-XC3S-1500
CPU: LEON3
Board: GR-XC3S-1500
FLASH: 8 MB
In: serial
Out: serial
Err: serial
Net: GRETH 10/100
Type "run flash_nfs" to mount root filesystem over NFS
Hit any key to stop autoboot: 0
=> setenv scratch 41000000
=> run getkernel
Using GRETH 10/100 device
TFTP from server 192.168.0.20; our IP address is 192.168.0.179
Filename '/uImage'.
Load address: 0x41000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
############################################
done
Bytes transferred = 2550387 (26ea73 hex)
=> bootm
## Booting kernel from Legacy Image at 41000000 ...
Image Name: Linux-2.6.21.1
Image Type: SPARC Linux Kernel Image (gzip compressed)
Data Size: 2550323 Bytes = 2.4 MB
Load Address: 40004000
Entry Point: f0004000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Found SPARC Linux kernel 2.6.21 ...
Booting Linux
Booting Linux...
PROMLIB: Sun Boot Prom Version 0 Revision 0
Linux version 2.6.21.1 (daniel at neptune) (gcc version 3.2.2) #17 Tue Dec
18 16:57
ARCH: LEON
Vendors Slaves
Ahb masters:
0( 1: 3| 0): VENDOR_GAISLER GAISLER_LEON3
1( 1: 1c| 0): VENDOR_GAISLER GAISLER_AHBJTAG
2( 1: 1d| 0): VENDOR_GAISLER GAISLER_ETHMAC
3( 1: 1f|10): VENDOR_GAISLER Unknown device 1f
4( 1: 1f|11): VENDOR_GAISLER Unknown device 1f
Ahb slaves:
0( 4: f| 0): VENDOR_ESA ESA_MCTRL
+0: 0x0 (raw:0x3e002)
+1: 0x20000000 (raw:0x2000e002)
+2: 0x40000000 (raw:0x4003c002)
1( 1: 6| 0): VENDOR_GAISLER GAISLER_APBMST
+0: 0x80000000 (raw:0x8000fff2)
2( 1: 4| 0): VENDOR_GAISLER GAISLER_LEON3DSU
+0: 0x90000000 (raw:0x9000f002)
Apb slaves:
0( 4: f| 0): VENDOR_ESA ESA_MCTRL
+ 0: 0x80000000 (raw:0xfff1)
1( 1: c| 2): VENDOR_GAISLER GAISLER_APBUART
+ 0: 0x80000100 (raw:0x10fff1)
2( 1: d| 0): VENDOR_GAISLER GAISLER_IRQMP
+ 0: 0x80000200 (raw:0x20fff1)
3( 1: 11| 8): VENDOR_GAISLER GAISLER_GPTIMER
+ 0: 0x80000300 (raw:0x30fff1)
4( 1: 1d|12): VENDOR_GAISLER GAISLER_ETHMAC
+ 0: 0x80000b00 (raw:0xb0fff1)
5( 1: 1f|10): VENDOR_GAISLER Unknown device 1f
+ 0: 0x80000c00 (raw:0xc0fff1)
6( 1: 1f|11): VENDOR_GAISLER Unknown device 1f
+ 0: 0x80000d00 (raw:0xd0fff1)
7( 1: 52| 7): VENDOR_GAISLER Unknown device 52
+ 0: 0x80000f00 (raw:0xf0fff1)
TYPE: Leon2/3 System-on-a-Chip
Ethernet address: 0:0:7a:cc:0:12
CACHE: direct mapped cache, set size 1k
CACHE: not flushing on every context switch
Boot time fixup v1.6. 4/Mar/98 Jakub Jelinek (jj at ultra.linux.cz).
Patching kernu
node 2: /cpu00 (type:cpu) (props:.node device_type mid mmu-nctx
clock-frequency)
PROM: Built device tree from rootnode 1 with 918 bytes of memory.
DEBUG: psr.impl = 0xf fsr.vers = 0x7
Built 1 zonelists. Total pages: 15318
Kernel command line: console=ttyS0,38400 root=/dev/nfs rw
nfsroot=192.168.0.20:
PID hash table entries: 256 (order: 8, 1024 bytes)
Todo: init master_l10_counter
Attaching grlib apbuart serial drivers (clk:40hz):
Console: colour dummy device 80x25
....
---------------
This patch is also available at
ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.
Best Regards,
Daniel Hellstrom
common/image.c | 2 +-
include/image.h | 4 ++++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/common/image.c b/common/image.c
index f04826a..ce49bb2 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1014,7 +1014,7 @@ int boot_get_ramdisk (int argc, char *argv[],
bootm_headers_t *images,
return 0;
}
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
/**
* boot_ramdisk_high - relocate init ramdisk
* @lmb: pointer to lmb handle, will be used for memory mgmt
diff --git a/include/image.h b/include/image.h
index 36143e2..c1a6cbb 100644
--- a/include/image.h
+++ b/include/image.h
@@ -419,6 +419,8 @@ static inline int image_check_target_arch
(image_header_t *hdr)
if (!image_check_arch (hdr, IH_ARCH_PPC))
#elif defined(__sh__)
if (!image_check_arch (hdr, IH_ARCH_SH))
+#elif defined(__sparc__)
+ if (!image_check_arch (hdr, IH_ARCH_SPARC))
#else
# error Unknown CPU type
#endif
@@ -571,6 +573,8 @@ static inline int fit_image_check_target_arch (const
void *fdt, int node)
if (!fit_image_check_arch (fdt, node, IH_ARCH_PPC))
#elif defined(__sh__)
if (!fit_image_check_arch (fdt, node, IH_ARCH_SH))
+#elif defined(__sparc__)
+ if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC))
#else
# error Unknown CPU type
#endif
More information about the U-Boot
mailing list