summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/tlv_eeprom.c18
-rw-r--r--configs/ib62x0_defconfig16
-rw-r--r--drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c13
-rw-r--r--drivers/spi/Kconfig2
-rw-r--r--include/configs/ib62x0.h28
5 files changed, 43 insertions, 34 deletions
diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c
index d7c229e5441..3127660dd9e 100644
--- a/cmd/tlv_eeprom.c
+++ b/cmd/tlv_eeprom.c
@@ -41,7 +41,7 @@ static int set_date(char *buf, const char *string);
static int set_bytes(char *buf, const char *string, int *converted_accum);
static void show_tlv_devices(int current_dev);
-/* The EERPOM contents after being read into memory */
+/* The EEPROM contents after being read into memory */
static u8 eeprom[TLV_INFO_MAX_LEN];
static struct udevice *tlv_devices[MAX_TLV_DEVICES];
@@ -430,7 +430,7 @@ int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
static int has_been_read;
int ret;
- // If no arguments, read the EERPOM and display its contents
+ // If no arguments, read the EEPROM and display its contents
if (argc == 1) {
if (!has_been_read) {
ret = read_eeprom(current_dev, eeprom);
@@ -560,7 +560,7 @@ U_BOOT_CMD(tlv_eeprom, 4, 1, do_tlv_eeprom,
/**
* tlvinfo_find_tlv
*
- * This function finds the TLV with the supplied code in the EERPOM.
+ * This function finds the TLV with the supplied code in the EEPROM.
* An offset from the beginning of the EEPROM is returned in the
* eeprom_index parameter if the TLV is found.
*/
@@ -631,7 +631,7 @@ static bool tlvinfo_add_tlv(u8 *eeprom, int tcode, char *strval)
char data[MAX_TLV_VALUE_LEN];
int eeprom_index;
- // Encode each TLV type into the format to be stored in the EERPOM
+ // Encode each TLV type into the format to be stored in the EEPROM
switch (tcode) {
case TLV_CODE_PRODUCT_NAME:
case TLV_CODE_PART_NUMBER:
@@ -691,7 +691,7 @@ static bool tlvinfo_add_tlv(u8 *eeprom, int tcode, char *strval)
// Is there room for this TLV?
if ((be16_to_cpu(eeprom_hdr->totallen) + ENT_SIZE + new_tlv_len) >
TLV_TOTAL_LEN_MAX) {
- printf("ERROR: There is not enough room in the EERPOM to save data.\n");
+ printf("ERROR: There is not enough room in the EEPROM to save data.\n");
return false;
}
@@ -1033,10 +1033,8 @@ int mac_read_from_eeprom(void)
struct tlvinfo_header *eeprom_hdr = to_header(eeprom);
int devnum = 0; // TODO: support multiple EEPROMs
- puts("EEPROM: ");
-
if (read_eeprom(devnum, eeprom)) {
- printf("Read failed.\n");
+ log_err("EEPROM: read failed\n");
return -1;
}
@@ -1082,8 +1080,8 @@ int mac_read_from_eeprom(void)
}
}
- printf("%s v%u len=%u\n", eeprom_hdr->signature, eeprom_hdr->version,
- be16_to_cpu(eeprom_hdr->totallen));
+ log_debug("EEPROM: %s v%u len=%u\n", eeprom_hdr->signature, eeprom_hdr->version,
+ be16_to_cpu(eeprom_hdr->totallen));
return 0;
}
diff --git a/configs/ib62x0_defconfig b/configs/ib62x0_defconfig
index 65aca43e8b9..60a61086bb5 100644
--- a/configs/ib62x0_defconfig
+++ b/configs/ib62x0_defconfig
@@ -2,48 +2,41 @@ CONFIG_ARM=y
CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_SYS_DCACHE_OFF=y
CONFIG_ARCH_CPU_INIT=y
+CONFIG_SYS_THUMB_BUILD=y
CONFIG_ARCH_KIRKWOOD=y
CONFIG_SYS_KWD_CONFIG="board/raidsonic/ib62x0/kwbimage.cfg"
CONFIG_TEXT_BASE=0x600000
CONFIG_NR_DRAM_BANKS=2
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
CONFIG_TARGET_IB62X0=y
CONFIG_ENV_SIZE=0x20000
CONFIG_ENV_OFFSET=0xE0000
CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ib62x0"
CONFIG_SYS_LOAD_ADDR=0x800000
CONFIG_IDENT_STRING=" RaidSonic ICY BOX IB-NAS62x0"
+CONFIG_LTO=y
+CONFIG_BOOTSTD_FULL=y
CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part root; ubifsmount ubi:rootfs; ubifsload 0x800000 ${kernel}; ubifsload 0x700000 ${fdt}; ubifsumount; fdt addr 0x700000; fdt resize; fdt chosen; bootz 0x800000 - 0x700000"
CONFIG_USE_PREBOOT=y
CONFIG_SYS_PBSIZE=1051
# CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="ib62x0 => "
CONFIG_SYS_MAXARGS=32
-CONFIG_CMD_BOOTZ=y
CONFIG_CMD_IDE=y
CONFIG_CMD_NAND=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_JFFS2=y
CONFIG_CMD_MTDPARTS=y
CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),-@0x100000(root)"
CONFIG_CMD_UBI=y
-CONFIG_ISO_PARTITION=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_NETCONSOLE=y
CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_SYS_ATA_STRIDE=4
CONFIG_SYS_ATA_DATA_OFFSET=0x100
CONFIG_SYS_ATA_REG_OFFSET=0x100
@@ -58,6 +51,5 @@ CONFIG_MVGBE=y
CONFIG_MII=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_STORAGE=y
CONFIG_LZMA=y
CONFIG_BZIP2=y
diff --git a/drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c b/drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c
index 31b6209416b..84156a1e8ad 100644
--- a/drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c
+++ b/drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c
@@ -64,7 +64,7 @@ static u8 center_high_element_get(u8 dir, u8 pbs_element, u16 lambda, u8 pbs_max
static int mv_ddr4_centralization(u8 dev_num, u16 (*lambda)[MAX_BUS_NUM][BUS_WIDTH_IN_BITS], u8 (*copt)[MAX_BUS_NUM],
u8 (*pbs_result)[MAX_BUS_NUM][BUS_WIDTH_IN_BITS], u8 (*vw_size)[MAX_BUS_NUM],
u8 mode, u16 param0, u8 param1);
-static int mv_ddr4_dqs_reposition(u8 dir, u16 *lambda, u8 *pbs_result, char delta, u8 *copt, u8 *dqs_pbs);
+static int mv_ddr4_dqs_reposition(u8 dir, u16 *lambda, u8 *pbs_result, s8 delta, u8 *copt, u8 *dqs_pbs);
static int mv_ddr4_copt_get(u8 dir, u16 *lambda, u8 *vw_l, u8 *vw_h, u8 *pbs_result, u8 *copt);
static int mv_ddr4_center_of_mass_calc(u8 dev_num, u8 if_id, u8 subphy_num, u8 mode, u8 *vw_l, u8 *vw_h, u8 *vw_v,
u8 vw_num, u8 *v_opt, u8 *t_opt);
@@ -659,7 +659,7 @@ static int mv_ddr4_centralization(u8 dev_num, u16 (*lambda)[MAX_BUS_NUM][BUS_WID
} /* if_id */
/* restore cs enable value*/
- for (if_id = 0; if_id < MAX_INTERFACE_NUM - 1; if_id++) {
+ for (if_id = 0; if_id < MAX_INTERFACE_NUM; if_id++) {
VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id);
status = ddr3_tip_if_write(dev_num, ACCESS_TYPE_UNICAST, if_id, DUAL_DUNIT_CFG_REG,
cs_ena_reg_val[if_id], MASK_ALL_BITS);
@@ -895,7 +895,7 @@ static int mv_ddr4_copt_get(u8 dir, u16 *lambda, u8 *vw_l, u8 *vw_h, u8 *pbs_res
* It provides with a solution for a single subphy (8 bits).
* The calling function is responsible for any additional pbs taps for dqs
*/
-static int mv_ddr4_dqs_reposition(u8 dir, u16 *lambda, u8 *pbs_result, char delta, u8 *copt, u8 *dqs_pbs)
+static int mv_ddr4_dqs_reposition(u8 dir, u16 *lambda, u8 *pbs_result, s8 delta, u8 *copt, u8 *dqs_pbs)
{
u8 dq_idx;
u32 pbs_max_val = 0;
@@ -952,7 +952,8 @@ static int mv_ddr4_center_of_mass_calc(u8 dev_num, u8 if_id, u8 subphy_num, u8 m
int t_opt_temp = 0, v_opt_temp = 0;
int vw_avg = 0, v_avg = 0;
int s0 = 0, s1 = 0, s2 = 0, slope = 1, r_sq = 0;
- u32 d_min = 10000, reg_val = 0;
+ u32 reg_val = 0;
+ int d_min = 10000;
int status;
/*
@@ -2189,7 +2190,7 @@ int mv_ddr4_dm_tuning(u32 cs, u16 (*pbs_tap_factor)[MAX_BUS_NUM][BUS_WIDTH_IN_BI
for (dq = 0; dq < BUS_WIDTH_IN_BITS; dq++) {
idx = dq + subphy * BUS_WIDTH_IN_BITS;
reg_val = new_dq_pbs[dq] - dq_pbs_diff;
- if (reg_val < 0) {
+ if (new_dq_pbs[dq] < dq_pbs_diff) {
DEBUG_DM_TUNING(DEBUG_LEVEL_ERROR,
("unexpected negative value found\n"));
return MV_FAIL;
@@ -2267,7 +2268,7 @@ int mv_ddr4_dm_tuning(u32 cs, u16 (*pbs_tap_factor)[MAX_BUS_NUM][BUS_WIDTH_IN_BI
idx = dq + subphy * BUS_WIDTH_IN_BITS;
pad = dq_map_table[idx];
reg_val = new_dq_pbs[dq] - dq_pbs_diff;
- if (reg_val < 0) {
+ if (new_dq_pbs[dq] < dq_pbs_diff) {
DEBUG_DM_TUNING(DEBUG_LEVEL_ERROR,
("unexpected negative value found\n"));
return MV_FAIL;
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index a3513f0a3ef..1ae36b5a348 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -351,6 +351,8 @@ config MTK_SPIM
config MVEBU_A3700_SPI
bool "Marvell Armada 3700 SPI driver"
+ depends on ARCH_MVEBU && ARM64
+ select CLK_MVEBU
select CLK_ARMADA_3720
help
Enable the Marvell Armada 3700 SPI driver. This driver can be
diff --git a/include/configs/ib62x0.h b/include/configs/ib62x0.h
index e1b62f78b21..01ab6edb05f 100644
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
+ * Copyright (C) 2025 Tony Dinh <mibodhi@gmail.com>
* Copyright (C) 2011-2012
* Gerald Kerma <dreagle@doukki.net>
* Luka Perkov <luka@openwrt.org>
@@ -11,19 +12,34 @@
#include "mv-common.h"
/*
- * Environment variables configuration
- */
-
-/*
- * Default environment variables
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
*/
+#include "mv-common.h"
-#define CFG_EXTRA_ENV_SETTINGS \
+#define EXTRA_ENV_SETTINGS_LEGACY \
"console=console=ttyS0,115200\0" \
"kernel=/boot/zImage\0" \
"fdt=/boot/ib62x0.dtb\0" \
"bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
+#define KERNEL_ADDR_R __stringify(0x800000)
+#define FDT_ADDR_R __stringify(0x2c00000)
+#define RAMDISK_ADDR_R __stringify(0x01100000)
+#define SCRIPT_ADDR_R __stringify(0x200000)
+
+#define LOAD_ADDRESS_ENV_SETTINGS \
+ "kernel_addr_r=" KERNEL_ADDR_R "\0" \
+ "fdt_addr_r=" FDT_ADDR_R "\0" \
+ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
+ "scriptaddr=" SCRIPT_ADDR_R "\0"
+
+#define CFG_EXTRA_ENV_SETTINGS \
+ EXTRA_ENV_SETTINGS_LEGACY \
+ LOAD_ADDRESS_ENV_SETTINGS \
+ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
+
/*
* SATA driver configuration
*/