Commit 5745f8c4fd5807becf7f246625e153388293aedc
Exists in
v2017.01-smarct4x
and in
37 other branches
Merge git://git.denx.de/u-boot-marvell
Showing 2 changed files Side-by-side Diff
board/buffalo/lsxl/README
1 | +Intro | |
2 | +----- | |
3 | +The Buffalo Linkstation Pro/Live, codename LS-XHL and LS-CHLv2, is a single | |
4 | +disk NAS server. The PCBs of the LS-XHL and LS-CHLv2 are almost the same. | |
5 | +The LS-XHL has a faster CPU and more RAM with a wider data bus, therefore | |
6 | +the LS-XHL PCB has two SDRAM chips. Both have a Kirkwood CPU (Marvell | |
7 | +88F6281). The only on-board storage is a 4 Mbit SPI flash which stores the | |
8 | +bootloader and its environment. The linux kernel and the initial ramdisk | |
9 | +are loaded from the hard disk. | |
10 | + | |
11 | + | |
12 | +Rescue Mode | |
13 | +----------- | |
14 | +These linkstations don't have a populated serial port. There is no way to | |
15 | +access an (unmodified) board other than using the netconsole. If you want | |
16 | +to recover from a bad environment setting or an empty environment, you can | |
17 | +do this only with a working network connection. | |
18 | + | |
19 | +Therefore, on entering the resuce mode, a random ethernet address is | |
20 | +generated if no valid address could be loaded from the environment variable | |
21 | +'ethaddr' and a DHCP request is sent. After a successful DHCP response is | |
22 | +received, the network settings are configured and the ncip is unset. Thus | |
23 | +all netconsole packets are broadcasted and you can use the netconsole to | |
24 | +access board from any host within the network segment. To determine the IP | |
25 | +address assigned to the board, you either have to sniff the traffic or | |
26 | +check the logs/leases of your DHCP server. | |
27 | + | |
28 | +The resuce mode is selected by holding the push button for at least one | |
29 | +second, while powering-on the device. The status LED turns solid amber if | |
30 | +the resuce mode is enabled, thus providing a visual feedback. | |
31 | + | |
32 | +Pressing the same button for at least 10 seconds on power-up will erase the | |
33 | +environment and reset the board. In this case the visual indication will | |
34 | +be: | |
35 | +- blinking blue, for about one second | |
36 | +- solid amber, for about nine seconds | |
37 | +- blinking amber, until you release the button | |
38 | + | |
39 | +This ensures, that you still can recover a device with a broken | |
40 | +environment by first erasing the environment and then entering the rescue | |
41 | +mode. | |
42 | + | |
43 | +Once the rescue mode is started, use the ncb binary from the tools/ | |
44 | +directory to access your board. There is a helper script named | |
45 | +'restore_env' to save your changes. It unsets all the network variables | |
46 | +which were set by the rescue mode, saves your changes and then resets the | |
47 | +board. | |
48 | + | |
49 | +The common use case for this is setting a MAC address. Let us assume you | |
50 | +have an empty environment, the board comes up with the amber LED blinking. | |
51 | +Then you enter the rescue mode, connect to the board with the ncb tool and | |
52 | +use the following commands to set your MAC address: | |
53 | + | |
54 | + setenv ethaddr 00:00:00:00:00:00 | |
55 | + run restore_env | |
56 | + | |
57 | +Of course you need to replace the 00:00:00:00:00:00 with your valid MAC | |
58 | +address, which can be found on a sticker on the bottom of your box. | |
59 | + | |
60 | + | |
61 | +Status LED | |
62 | +---------- | |
63 | +blinking blue | |
64 | + Bootloader is running normally. | |
65 | + | |
66 | +blinking amber | |
67 | + No ethaddr set. Use the `Rescue Mode` to set one. | |
68 | + | |
69 | +blinking red | |
70 | + Something bad happend during loading the operating system. | |
71 | + | |
72 | +The default behavior of the linux kernel is to turn on the blue LED. So if | |
73 | +the blinking blue LED changes to solid blue the kernel was loaded | |
74 | +successfully. | |
75 | + | |
76 | + | |
77 | +Power-on Switch | |
78 | +--------------- | |
79 | +The power-on switch is a software switch. If it is not in ON position when | |
80 | +the bootloader starts, the bootloader will disable the HDD and USB power | |
81 | +and stop the fan. Then it loops until the switch is in ON position again, | |
82 | +enables the power and fan again and continue booting. | |
83 | + | |
84 | + | |
85 | +Boot sources | |
86 | +------------ | |
87 | +The environment defines several different boot sources: | |
88 | + | |
89 | +legacy | |
90 | + This is the default boot source. It loads the kernel and ramdisk from the | |
91 | + attached HDD using the original filenames. The load addresses were | |
92 | + modified to support loading larger kernels. But it should behave the same | |
93 | + as the original bootloader. | |
94 | + | |
95 | +hdd | |
96 | + Use this for new-style booting. Loads three files /vmlinuz, /initrd.img | |
97 | + and /dtb from the boot partition. This should work out of the box if you | |
98 | + have debian and the flash-kernel package installed. | |
99 | + | |
100 | +usb | |
101 | + Same as hdd expect, that the files are loaded from an attached USB mass | |
102 | + storage device and the filename for the device tree is kirkwood-lsxhl.dtb | |
103 | + (or kirkwood-lschlv2.dtb). | |
104 | + | |
105 | +net | |
106 | + Same as usb expect, that the file are loaded from the network. | |
107 | + | |
108 | +rescue | |
109 | + Automatically activated if the push button is pressed for at least one | |
110 | + second on power-up. Does a DHCP request and enables the network console. | |
111 | + See `Rescue Mode` for more information. | |
112 | + | |
113 | +You can change the boot source by setting the 'bootsource' variable to the | |
114 | +corresponding value. Please note, that the restore_env script will the the | |
115 | +bootsource back to 'legacy'. | |
116 | + | |
117 | + | |
118 | +Flash map | |
119 | +--------- | |
120 | +00000 - 5ffff u-boot | |
121 | +60000 - 6ffff reserved, may be used to store dtb | |
122 | +70000 - 7ffff u-boot environment | |
123 | + | |
124 | + | |
125 | +Compiling | |
126 | +--------- | |
127 | +make lsxhl_config (or lschlv2_config) | |
128 | +make u-boot.kwb | |
129 | + | |
130 | + | |
131 | +Update your board | |
132 | +----------------- | |
133 | +Just flash the resulting u-boot.kwb to the beginning of the SPI flash. If | |
134 | +you already have a bootloader CLI, you can use the following commands: | |
135 | + | |
136 | + sf probe 0 | |
137 | + bootp ${loadaddr} u-boot.kwb | |
138 | + sf erase 0 +${filelen} | |
139 | + sf write 0 ${fileaddr} ${filesize} |
include/configs/lsxl.h
... | ... | @@ -56,6 +56,7 @@ |
56 | 56 | * Commands configuration |
57 | 57 | */ |
58 | 58 | #include <config_cmd_default.h> |
59 | +#define CONFIG_CMD_BOOTZ | |
59 | 60 | #define CONFIG_CMD_DHCP |
60 | 61 | #define CONFIG_CMD_ELF |
61 | 62 | #define CONFIG_CMD_ENV |
... | ... | @@ -78,6 +79,9 @@ |
78 | 79 | */ |
79 | 80 | #include "mv-common.h" |
80 | 81 | |
82 | +/* loading initramfs images without uimage header */ | |
83 | +#define CONFIG_SUPPORT_RAW_INITRD | |
84 | + | |
81 | 85 | /* ST M25P40 */ |
82 | 86 | #undef CONFIG_SPI_FLASH_MACRONIX |
83 | 87 | #define CONFIG_SPI_FLASH_STMICRO |
84 | 88 | |
85 | 89 | |
86 | 90 | |
87 | 91 | |
... | ... | @@ -125,27 +129,31 @@ |
125 | 129 | "hdpart=0:1\0" \ |
126 | 130 | "kernel_addr=0x00800000\0" \ |
127 | 131 | "ramdisk_addr=0x01000000\0" \ |
128 | - "fdt_addr=0x01ff0000ff0000\0" \" \ | |
132 | + "fdt_addr=0x00ff0000ff0000\0" \" \ | |
129 | 133 | "bootcmd_legacy=ide reset " \ |
130 | - "&& load ide ${hdpart} 0x00100000 /uImage.buffalo " \ | |
131 | - "&& load ide ${hdpart} 0x00800000 /initrd.buffalo " \ | |
132 | - "&& bootm 0x00100000 0x00800000\0" \ | |
133 | - "bootcmd_net=bootp ${kernel_addr} uImage " \ | |
134 | - "&& tftpboot ${ramdisk_addr} uInitrd " \ | |
134 | + "&& load ide ${hdpart} ${kernel_addr} /uImage.buffalo " \ | |
135 | + "&& load ide ${hdpart} ${ramdisk_addr} /initrd.buffalo "\ | |
136 | + "&& bootm ${kernel_addr} ${ramdisk_addr}\0" \ | |
137 | + "bootcmd_net=bootp ${kernel_addr} vmlinuz " \ | |
138 | + "&& tftpboot ${ramdisk_addr} initrd.img " \ | |
139 | + "&& setenv ramdisk_len ${filesize} " \ | |
135 | 140 | "&& tftpboot ${fdt_addr} " CONFIG_FDTFILE " " \ |
136 | - "&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \ | |
141 | + "&& bootz ${kernel_addr} " \ | |
142 | + "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \ | |
137 | 143 | "bootcmd_hdd=ide reset " \ |
138 | - "&& load ide ${hdpart} ${kernel_addr} /uImage " \ | |
139 | - "&& load ide ${hdpart} ${ramdisk_addr} /uInitrd " \ | |
140 | - "&& load ide ${hdpart} ${fdt_addr} " \ | |
141 | - "/" CONFIG_FDTFILE " " \ | |
142 | - "&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \ | |
144 | + "&& load ide ${hdpart} ${kernel_addr} /vmlinuz " \ | |
145 | + "&& load ide ${hdpart} ${ramdisk_addr} /initrd.img " \ | |
146 | + "&& setenv ramdisk_len ${filesize} " \ | |
147 | + "&& load ide ${hdpart} ${fdt_addr} /dtb " \ | |
148 | + "&& bootz ${kernel_addr} " \ | |
149 | + "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \ | |
143 | 150 | "bootcmd_usb=usb start " \ |
144 | - "&& load usb 0:1 ${kernel_addr} /uImage " \ | |
145 | - "&& load usb 0:1 ${ramdisk_addr} /uInitrd " \ | |
146 | - "&& load usb 0:1 ${fdt_addr} " \ | |
147 | - "/" CONFIG_FDTFILE " " \ | |
148 | - "&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \ | |
151 | + "&& load usb 0:1 ${kernel_addr} /vmlinuz " \ | |
152 | + "&& load usb 0:1 ${ramdisk_addr} /initrd.img " \ | |
153 | + "&& setenv ramdisk_len ${filesize} " \ | |
154 | + "&& load usb 0:1 ${fdt_addr} " CONFIG_FDTFILE " " \ | |
155 | + "&& bootz ${kernel_addr} " \ | |
156 | + "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \ | |
149 | 157 | "bootcmd_rescue=run config_nc_dhcp; run nc\0" \ |
150 | 158 | "eraseenv=sf probe 0 " \ |
151 | 159 | "&& sf erase " __stringify(CONFIG_ENV_OFFSET) \ |