summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-08-23 15:44:54 -0400
committerTom Rini <[email protected]>2022-08-23 15:44:54 -0400
commitaea087a665c447dfb89bf2113cad74ad53fa17a0 (patch)
treefbb710bb7a66da927c142b8710cf4564b5652ced /board
parent1247c35c80cb0f6f17c88d54c6575d6d1f50c608 (diff)
parent560a5c3bb3bedac7d1da93362401a1d926214660 (diff)
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- kirkwood: pogo_v4 & nsa310s: Add distro boot (Tony) - kirkwood: add DM timer support and use it on lsxl boards (Michael) - kirkwood: convert the Buffalo Linkstation LS-CHLv2 and XHL boards to DM (Michael) - mvebu: turris_mox/omnia: misc improments (Pali) - mvebu: mbus: Fix mbus driver to work also after U-Boot relocation (Pali)
Diffstat (limited to 'board')
-rw-r--r--board/CZ.NIC/turris_mox/turris_mox.c5
-rw-r--r--board/CZ.NIC/turris_omnia/turris_omnia.c46
-rw-r--r--board/Synology/ds109/ds109.c1
-rw-r--r--board/alliedtelesis/x530/x530.c2
-rw-r--r--board/buffalo/lsxl/README32
-rw-r--r--board/buffalo/lsxl/lsxl.c165
-rw-r--r--board/maxbcm/maxbcm.c8
-rw-r--r--board/theadorable/theadorable.c4
-rw-r--r--board/zyxel/nsa310s/MAINTAINERS1
9 files changed, 164 insertions, 100 deletions
diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
index 28259e71405..3dbd68e5236 100644
--- a/board/CZ.NIC/turris_mox/turris_mox.c
+++ b/board/CZ.NIC/turris_mox/turris_mox.c
@@ -821,6 +821,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
"sgmii");
if (res < 0)
return res;
+
+ res = fdt_setprop_string(blob, node, "label",
+ "sfp");
+ if (res < 0)
+ return res;
}
res = fdt_status_okay_by_compatible(blob, "cznic,moxtet-gpio");
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index 5ddd873d025..ab5061ef582 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -21,6 +21,7 @@
#include <dm/uclass.h>
#include <dt-bindings/gpio/gpio.h>
#include <fdt_support.h>
+#include <hexdump.h>
#include <time.h>
#include <linux/bitops.h>
#include <linux/delay.h>
@@ -61,7 +62,9 @@ DECLARE_GLOBAL_DATA_PTR;
enum mcu_commands {
CMD_GET_STATUS_WORD = 0x01,
CMD_GET_RESET = 0x09,
+ CMD_GET_FW_VERSION_APP = 0x0a,
CMD_WATCHDOG_STATE = 0x0b,
+ CMD_GET_FW_VERSION_BOOT = 0x0e,
/* available if STS_FEATURES_SUPPORTED bit set in status word */
CMD_GET_FEATURES = 0x10,
@@ -282,16 +285,6 @@ static bool omnia_detect_wwan_usb3(const char *wwan_slot)
return false;
}
-void *env_sf_get_env_addr(void)
-{
- /* SPI Flash is mapped to address 0xD4000000 only in SPL */
-#ifdef CONFIG_SPL_BUILD
- return (void *)0xD4000000 + CONFIG_ENV_OFFSET;
-#else
- return NULL;
-#endif
-}
-
int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
{
#ifdef CONFIG_SPL_ENV_SUPPORT
@@ -428,6 +421,38 @@ static const char * const omnia_get_mcu_type(void)
return mcu_types[stsword & STS_MCU_TYPE_MASK];
}
+static const char * const omnia_get_mcu_version(void)
+{
+ static char version[82];
+ u8 version_app[20];
+ u8 version_boot[20];
+ int ret;
+
+ ret = omnia_mcu_read(CMD_GET_FW_VERSION_APP, &version_app, sizeof(version_app));
+ if (ret)
+ return "unknown";
+
+ ret = omnia_mcu_read(CMD_GET_FW_VERSION_BOOT, &version_boot, sizeof(version_boot));
+ if (ret)
+ return "unknown";
+
+ /*
+ * If git commits of MCU bootloader and MCU application are same then
+ * show version only once. If they are different then show both commits.
+ */
+ if (!memcmp(version_app, version_boot, 20)) {
+ bin2hex(version, version_app, 20);
+ version[40] = '\0';
+ } else {
+ bin2hex(version, version_boot, 20);
+ version[40] = '/';
+ bin2hex(version + 41, version_app, 20);
+ version[81] = '\0';
+ }
+
+ return version;
+}
+
/*
* Define the DDR layout / topology here in the board file. This will
* be used by the DDR3 init code in the SPL U-Boot version to configure
@@ -944,6 +969,7 @@ int show_board_info(void)
err = turris_atsha_otp_get_serial_number(&version_num, &serial_num);
printf("Model: Turris Omnia\n");
printf(" MCU type: %s\n", omnia_get_mcu_type());
+ printf(" MCU version: %s\n", omnia_get_mcu_version());
printf(" RAM size: %i MiB\n", omnia_get_ram_size_gb() * 1024);
if (err)
printf(" Serial Number: unknown\n");
diff --git a/board/Synology/ds109/ds109.c b/board/Synology/ds109/ds109.c
index 3914faaf37b..9e7f6ac6c79 100644
--- a/board/Synology/ds109/ds109.c
+++ b/board/Synology/ds109/ds109.c
@@ -10,6 +10,7 @@
#include <miiphy.h>
#include <net.h>
#include <asm/global_data.h>
+#include <asm/io.h>
#include <asm/setup.h>
#include <asm/arch/cpu.h>
#include <asm/arch/soc.h>
diff --git a/board/alliedtelesis/x530/x530.c b/board/alliedtelesis/x530/x530.c
index cbf4533e78d..0cfb7c522f6 100644
--- a/board/alliedtelesis/x530/x530.c
+++ b/board/alliedtelesis/x530/x530.c
@@ -109,7 +109,7 @@ int board_init(void)
gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
/* window for NVS */
- mbus_dt_setup_win(&mbus_state, CONFIG_NVS_LOCATION, CONFIG_NVS_SIZE,
+ mbus_dt_setup_win(CONFIG_NVS_LOCATION, CONFIG_NVS_SIZE,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS1);
/* DEV_READYn is not needed for NVS, ignore it when accessing CS1 */
diff --git a/board/buffalo/lsxl/README b/board/buffalo/lsxl/README
index fffb1ce8ec0..dd9e9433807 100644
--- a/board/buffalo/lsxl/README
+++ b/board/buffalo/lsxl/README
@@ -31,8 +31,8 @@ generated if no valid address could be loaded from the environment variable
'ethaddr' and a DHCP request is sent. After a successful DHCP response is
received, the network settings are configured and the ncip is unset. Thus
all netconsole packets are broadcasted and you can use the netconsole to
-access board from any host within the network segment. To determine the IP
-address assigned to the board, you either have to sniff the traffic or
+access the board from any host within the network segment. To determine the
+IP address assigned to the board, you either have to sniff the traffic or
check the logs/leases of your DHCP server.
The resuce mode is selected by holding the push button for at least one
@@ -42,41 +42,43 @@ the resuce mode is enabled, thus providing a visual feedback.
Pressing the same button for at least 10 seconds on power-up will erase the
environment and reset the board. In this case the visual indication will
be:
-- blinking blue, for about one second
-- solid amber, for about nine seconds
-- blinking amber, until you release the button
+- blue, for about one second
+- amber, for about nine seconds
+- red, until you release the button
This ensures, that you still can recover a device with a broken
environment by first erasing the environment and then entering the rescue
mode.
Once the rescue mode is started, use the ncb binary from the tools/
-directory to access your board. There is a helper script named
-'restore_env' to save your changes. It unsets all the network variables
-which were set by the rescue mode, saves your changes and then resets the
-board.
+directory to access your board.
The common use case for this is setting a MAC address. Let us assume you
-have an empty environment, the board comes up with the amber LED blinking.
+have an empty environment, the board comes up with the amber LED turned on.
Then you enter the rescue mode, connect to the board with the ncb tool and
use the following commands to set your MAC address:
- setenv ethaddr 00:00:00:00:00:00
- run restore_env
+ setenv -f ethaddr 00:00:00:00:00:00
+ saveenv
+ reset
Of course you need to replace the 00:00:00:00:00:00 with your valid MAC
address, which can be found on a sticker on the bottom of your box.
+You cannot store the network console setting in the environment. On reset
+it is automatically restored to serial. Therefore, you have to use the
+push-button to enter resuce mode again.
+
Status LED
----------
-blinking blue
+blue
Bootloader is running normally.
-blinking amber
+amber
No ethaddr set. Use the `Rescue Mode` to set one.
-blinking red
+red
Something bad happend during loading the operating system.
The default behavior of the linux kernel is to turn on the blue LED. So if
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 31d532b7529..6a866b5470d 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -9,21 +9,18 @@
#include <common.h>
#include <bootstage.h>
+#include <button.h>
#include <command.h>
#include <env.h>
-#include <env_internal.h>
#include <init.h>
-#include <net.h>
-#include <malloc.h>
-#include <netdev.h>
-#include <miiphy.h>
+#include <led.h>
+#include <power/regulator.h>
#include <spi.h>
#include <spi_flash.h>
-#include <asm/arch/soc.h>
#include <asm/arch/cpu.h>
#include <asm/arch/mpp.h>
-#include <asm/arch/gpio.h>
#include <asm/global_data.h>
+#include <asm/io.h>
#include <linux/delay.h>
#include "lsxl.h"
@@ -45,12 +42,10 @@
* Additionally, the bootsource is set to 'rescue'.
*/
-#ifndef CONFIG_ENV_OVERWRITE
-# error "You need to set CONFIG_ENV_OVERWRITE"
-#endif
-
DECLARE_GLOBAL_DATA_PTR;
+static bool force_rescue_mode;
+
int board_early_init_f(void)
{
/*
@@ -125,48 +120,43 @@ int board_early_init_f(void)
return 0;
}
-#define LED_OFF 0
-#define LED_ALARM_ON 1
-#define LED_ALARM_BLINKING 2
-#define LED_POWER_ON 3
-#define LED_POWER_BLINKING 4
-#define LED_INFO_ON 5
-#define LED_INFO_BLINKING 6
+enum {
+ LSXL_LED_OFF,
+ LSXL_LED_ALARM,
+ LSXL_LED_POWER,
+ LSXL_LED_INFO,
+};
-static void __set_led(int blink_alarm, int blink_info, int blink_power,
- int value_alarm, int value_info, int value_power)
+static void __set_led(int alarm, int info, int power)
{
- kw_gpio_set_blink(GPIO_ALARM_LED, blink_alarm);
- kw_gpio_set_blink(GPIO_INFO_LED, blink_info);
- kw_gpio_set_blink(GPIO_POWER_LED, blink_power);
- kw_gpio_set_value(GPIO_ALARM_LED, value_alarm);
- kw_gpio_set_value(GPIO_INFO_LED, value_info);
- kw_gpio_set_value(GPIO_POWER_LED, value_power);
+ struct udevice *led;
+ int ret;
+
+ ret = led_get_by_label("lsxl:red:alarm", &led);
+ if (!ret)
+ led_set_state(led, alarm);
+ ret = led_get_by_label("lsxl:amber:info", &led);
+ if (!ret)
+ led_set_state(led, info);
+ ret = led_get_by_label("lsxl:blue:power", &led);
+ if (!ret)
+ led_set_state(led, power);
}
static void set_led(int state)
{
switch (state) {
- case LED_OFF:
- __set_led(0, 0, 0, 1, 1, 1);
- break;
- case LED_ALARM_ON:
- __set_led(0, 0, 0, 0, 1, 1);
- break;
- case LED_ALARM_BLINKING:
- __set_led(1, 0, 0, 1, 1, 1);
- break;
- case LED_INFO_ON:
- __set_led(0, 0, 0, 1, 0, 1);
+ case LSXL_LED_OFF:
+ __set_led(0, 0, 0);
break;
- case LED_INFO_BLINKING:
- __set_led(0, 1, 0, 1, 1, 1);
+ case LSXL_LED_ALARM:
+ __set_led(1, 0, 0);
break;
- case LED_POWER_ON:
- __set_led(0, 0, 0, 1, 1, 0);
+ case LSXL_LED_INFO:
+ __set_led(0, 1, 0);
break;
- case LED_POWER_BLINKING:
- __set_led(0, 0, 1, 1, 1, 1);
+ case LSXL_LED_POWER:
+ __set_led(0, 0, 1);
break;
}
}
@@ -176,33 +166,56 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
- set_led(LED_POWER_BLINKING);
+ set_led(LSXL_LED_POWER);
return 0;
}
-#ifdef CONFIG_MISC_INIT_R
static void check_power_switch(void)
{
- if (kw_gpio_get_value(GPIO_POWER_SWITCH)) {
- /* turn off fan, HDD and USB power */
- kw_gpio_set_value(GPIO_HDD_POWER, 0);
- kw_gpio_set_value(GPIO_USB_VBUS, 0);
- kw_gpio_set_value(GPIO_FAN_HIGH, 1);
- kw_gpio_set_value(GPIO_FAN_LOW, 1);
- set_led(LED_OFF);
+ struct udevice *power_button, *hdd_power, *usb_power;
+ int ret;
+
+ ret = button_get_by_label("Power-on Switch", &power_button);
+ if (ret)
+ goto err;
+
+ ret = regulator_get_by_platname("HDD Power", &hdd_power);
+ if (ret)
+ goto err;
+
+ ret = regulator_get_by_platname("USB Power", &usb_power);
+ if (ret)
+ goto err;
+
+ if (button_get_state(power_button) == BUTTON_OFF) {
+ ret = regulator_set_enable(hdd_power, false);
+ if (ret)
+ goto err;
+ ret = regulator_set_enable(usb_power, false);
+ if (ret)
+ goto err;
+ /* TODO: fan off */
+ set_led(LSXL_LED_OFF);
/* loop until released */
- while (kw_gpio_get_value(GPIO_POWER_SWITCH))
+ while (button_get_state(power_button) == BUTTON_OFF)
;
/* turn power on again */
- kw_gpio_set_value(GPIO_HDD_POWER, 1);
- kw_gpio_set_value(GPIO_USB_VBUS, 1);
- kw_gpio_set_value(GPIO_FAN_HIGH, 0);
- kw_gpio_set_value(GPIO_FAN_LOW, 0);
- set_led(LED_POWER_BLINKING);
- }
+ ret = regulator_set_enable(hdd_power, true);
+ if (ret)
+ goto err;
+ ret = regulator_set_enable(usb_power, true);
+ if (ret)
+ goto err;
+ /* TODO: fan on */
+ set_led(LSXL_LED_POWER);
+ };
+
+ return;
+err:
+ printf("error in %s\n", __func__);
}
void check_enetaddr(void)
@@ -211,7 +224,7 @@ void check_enetaddr(void)
if (!eth_env_get_enetaddr("ethaddr", enetaddr)) {
/* signal unset/invalid ethaddr to user */
- set_led(LED_INFO_BLINKING);
+ set_led(LSXL_LED_INFO);
}
}
@@ -239,17 +252,24 @@ static void rescue_mode(void)
static void check_push_button(void)
{
+ struct udevice *func_button;
int i = 0;
- while (!kw_gpio_get_value(GPIO_FUNC_BUTTON)) {
+ int ret;
+
+ ret = button_get_by_label("Function Button", &func_button);
+ if (ret)
+ goto err;
+
+ while (button_get_state(func_button) == BUTTON_ON) {
udelay(100000);
i++;
if (i == 10)
- set_led(LED_INFO_ON);
+ set_led(LSXL_LED_INFO);
if (i >= 100) {
- set_led(LED_INFO_BLINKING);
+ set_led(LSXL_LED_ALARM);
break;
}
}
@@ -257,18 +277,29 @@ static void check_push_button(void)
if (i >= 100)
erase_environment();
else if (i >= 10)
- rescue_mode();
+ force_rescue_mode = true;
+
+ return;
+err:
+ printf("error in %s\n", __func__);
+}
+
+int board_early_init_r(void)
+{
+ check_push_button();
+
+ return 0;
}
int misc_init_r(void)
{
check_power_switch();
check_enetaddr();
- check_push_button();
+ if (force_rescue_mode)
+ rescue_mode();
return 0;
}
-#endif
#if CONFIG_IS_ENABLED(BOOTSTAGE)
void show_boot_progress(int progress)
@@ -280,6 +311,6 @@ void show_boot_progress(int progress)
if (progress == -BOOTSTAGE_ID_NET_LOADED)
return;
- set_led(LED_ALARM_BLINKING);
+ set_led(LSXL_LED_ALARM);
}
#endif
diff --git a/board/maxbcm/maxbcm.c b/board/maxbcm/maxbcm.c
index e92132ad19a..aad3dc86429 100644
--- a/board/maxbcm/maxbcm.c
+++ b/board/maxbcm/maxbcm.c
@@ -112,13 +112,13 @@ int board_early_init_f(void)
/*
* Setup some board specific mbus address windows
*/
- mbus_dt_setup_win(&mbus_state, DEV_CS0_BASE, 16 << 20,
+ mbus_dt_setup_win(DEV_CS0_BASE, 16 << 20,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS0);
- mbus_dt_setup_win(&mbus_state, DEV_CS1_BASE, 16 << 20,
+ mbus_dt_setup_win(DEV_CS1_BASE, 16 << 20,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS1);
- mbus_dt_setup_win(&mbus_state, DEV_CS2_BASE, 16 << 20,
+ mbus_dt_setup_win(DEV_CS2_BASE, 16 << 20,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS2);
- mbus_dt_setup_win(&mbus_state, DEV_CS3_BASE, 16 << 20,
+ mbus_dt_setup_win(DEV_CS3_BASE, 16 << 20,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS3);
return 0;
diff --git a/board/theadorable/theadorable.c b/board/theadorable/theadorable.c
index 6e41ca23991..144f122bb20 100644
--- a/board/theadorable/theadorable.c
+++ b/board/theadorable/theadorable.c
@@ -208,9 +208,9 @@ int board_init(void)
* Map SPI devices via MBUS so that they can be accessed via
* the SPI direct access mode
*/
- mbus_dt_setup_win(&mbus_state, SPI_BUS0_DEV1_BASE, SPI_BUS0_DEV1_SIZE,
+ mbus_dt_setup_win(SPI_BUS0_DEV1_BASE, SPI_BUS0_DEV1_SIZE,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_SPI0_CS1);
- mbus_dt_setup_win(&mbus_state, SPI_BUS1_DEV2_BASE, SPI_BUS0_DEV1_SIZE,
+ mbus_dt_setup_win(SPI_BUS1_DEV2_BASE, SPI_BUS0_DEV1_SIZE,
CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_SPI1_CS2);
/*
diff --git a/board/zyxel/nsa310s/MAINTAINERS b/board/zyxel/nsa310s/MAINTAINERS
index d153758c218..11106acf3e9 100644
--- a/board/zyxel/nsa310s/MAINTAINERS
+++ b/board/zyxel/nsa310s/MAINTAINERS
@@ -1,5 +1,4 @@
NSA310S BOARD
-M: Gerald Kerma <[email protected]>
M: Tony Dinh <[email protected]>
M: Luka Perkov <[email protected]>
S: Maintained