blob: fad69ab1f85483a20591788b35bd4e9b84f44ca9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Michael Walledccfa462012-06-05 11:33:17 +00002/*
3 * Copyright (c) 2012 Michael Walle
4 * Michael Walle <michael@walle.cc>
Michael Walledccfa462012-06-05 11:33:17 +00005 */
6
7#ifndef _CONFIG_LSXL_H
8#define _CONFIG_LSXL_H
9
10/*
Michael Walledccfa462012-06-05 11:33:17 +000011 * General configuration options
12 */
Michael Walledccfa462012-06-05 11:33:17 +000013
Michael Walledccfa462012-06-05 11:33:17 +000014#define CONFIG_KIRKWOOD_GPIO
Michael Walledccfa462012-06-05 11:33:17 +000015
Michael Walledccfa462012-06-05 11:33:17 +000016#include "mv-common.h"
17
Michael Walle22316a52015-02-08 20:06:07 +010018/* loading initramfs images without uimage header */
Michael Walle22316a52015-02-08 20:06:07 +010019
Michael Walledccfa462012-06-05 11:33:17 +000020/*
21 * Environment variables configurations
22 */
23#ifdef CONFIG_SPI_FLASH
24#define CONFIG_SYS_MAX_FLASH_BANKS 1
25#define CONFIG_SYS_MAX_FLASH_SECT 8
Michael Walledccfa462012-06-05 11:33:17 +000026#endif
27
Michael Walledccfa462012-06-05 11:33:17 +000028/*
29 * Default environment variables
30 */
Michael Walle35e6e292014-04-01 20:09:14 +020031
32#if defined(CONFIG_LSXHL)
33#define CONFIG_FDTFILE "kirkwood-lsxhl.dtb"
34#elif defined(CONFIG_LSCHLV2)
35#define CONFIG_FDTFILE "kirkwood-lschlv2.dtb"
36#else
37#error "Unsupported board"
38#endif
39
Michael Walledccfa462012-06-05 11:33:17 +000040#define CONFIG_EXTRA_ENV_SETTINGS \
Michael Walle35e6e292014-04-01 20:09:14 +020041 "bootsource=legacy\0" \
Michael Walledccfa462012-06-05 11:33:17 +000042 "hdpart=0:1\0" \
Michael Walle35e6e292014-04-01 20:09:14 +020043 "kernel_addr=0x00800000\0" \
44 "ramdisk_addr=0x01000000\0" \
Michael Wallebe083382015-02-08 20:06:06 +010045 "fdt_addr=0x00ff0000\0" \
Michael Walle4f5cb5a2019-04-03 23:28:31 +020046 "bootcmd_legacy=sata init " \
47 "&& load sata ${hdpart} ${kernel_addr} /uImage.buffalo "\
48 "&& load sata ${hdpart} ${ramdisk_addr} /initrd.buffalo "\
Michael Walledaffcc52015-02-08 20:06:05 +010049 "&& bootm ${kernel_addr} ${ramdisk_addr}\0" \
Michael Walle22316a52015-02-08 20:06:07 +010050 "bootcmd_net=bootp ${kernel_addr} vmlinuz " \
51 "&& tftpboot ${ramdisk_addr} initrd.img " \
52 "&& setenv ramdisk_len ${filesize} " \
Michael Walle35e6e292014-04-01 20:09:14 +020053 "&& tftpboot ${fdt_addr} " CONFIG_FDTFILE " " \
Michael Walle22316a52015-02-08 20:06:07 +010054 "&& bootz ${kernel_addr} " \
55 "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \
Michael Walle4f5cb5a2019-04-03 23:28:31 +020056 "bootcmd_hdd=sata init " \
57 "&& load sata ${hdpart} ${kernel_addr} /vmlinuz " \
58 "&& load sata ${hdpart} ${ramdisk_addr} /initrd.img " \
Michael Walle22316a52015-02-08 20:06:07 +010059 "&& setenv ramdisk_len ${filesize} " \
Michael Walle4f5cb5a2019-04-03 23:28:31 +020060 "&& load sata ${hdpart} ${fdt_addr} /dtb " \
Michael Walle22316a52015-02-08 20:06:07 +010061 "&& bootz ${kernel_addr} " \
62 "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \
Michael Walledccfa462012-06-05 11:33:17 +000063 "bootcmd_usb=usb start " \
Michael Walle22316a52015-02-08 20:06:07 +010064 "&& load usb 0:1 ${kernel_addr} /vmlinuz " \
65 "&& load usb 0:1 ${ramdisk_addr} /initrd.img " \
66 "&& setenv ramdisk_len ${filesize} " \
67 "&& load usb 0:1 ${fdt_addr} " CONFIG_FDTFILE " " \
68 "&& bootz ${kernel_addr} " \
69 "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \
Michael Walledccfa462012-06-05 11:33:17 +000070 "bootcmd_rescue=run config_nc_dhcp; run nc\0" \
71 "eraseenv=sf probe 0 " \
Marek Vasut0b3176c2012-09-23 17:41:24 +020072 "&& sf erase " __stringify(CONFIG_ENV_OFFSET) \
73 " +" __stringify(CONFIG_ENV_SIZE) "\0" \
Michael Walledccfa462012-06-05 11:33:17 +000074 "config_nc_dhcp=setenv autoload_old ${autoload}; " \
75 "setenv autoload no " \
76 "&& bootp " \
Michael Walledc3ba8e2012-10-04 06:54:25 +000077 "&& setenv ncip " \
Michael Walledccfa462012-06-05 11:33:17 +000078 "&& setenv autoload ${autoload_old}; " \
79 "setenv autoload_old\0" \
80 "standard_env=setenv ipaddr; setenv netmask; setenv serverip; " \
81 "setenv ncip; setenv gatewayip; setenv ethact; " \
82 "setenv bootfile; setenv dnsip; " \
Michael Walle9f061452014-09-28 00:05:23 +020083 "setenv bootsource legacy; run ser\0" \
Michael Walledccfa462012-06-05 11:33:17 +000084 "restore_env=run standard_env; saveenv; reset\0" \
85 "ser=setenv stdin serial; setenv stdout serial; " \
86 "setenv stderr serial\0" \
87 "nc=setenv stdin nc; setenv stdout nc; setenv stderr nc\0" \
88 "stdin=serial\0" \
89 "stdout=serial\0" \
90 "stderr=serial\0"
91
92/*
93 * Ethernet Driver configuration
94 */
95#ifdef CONFIG_CMD_NET
96#define CONFIG_MVGBE_PORTS {0, 1} /* enable port 1 only */
97#define CONFIG_PHY_BASE_ADR 7
98#undef CONFIG_RESET_PHY_R
99#endif /* CONFIG_CMD_NET */
100
Michael Walle4f5cb5a2019-04-03 23:28:31 +0200101#ifdef CONFIG_SATA
102#define CONFIG_SYS_SATA_MAX_DEVICE 1
Michael Wallef2f14da2014-04-01 20:09:13 +0200103#define CONFIG_SYS_64BIT_LBA
Michael Walle4f5cb5a2019-04-03 23:28:31 +0200104#define CONFIG_LBA48
Michael Walledccfa462012-06-05 11:33:17 +0000105#endif
106
107#endif /* _CONFIG_LSXL_H */