Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion board/hisilicon/hi3516av100/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ static void do_phy_init(void)

int misc_init_r(void)
{
openipc_helper();
/* before the scan: a split image clears it, so bootm checks its CRC */
env_set("verify", "n");
openipc_helper();
do_phy_init();

return 0;
Expand Down
3 changes: 2 additions & 1 deletion board/hisilicon/hi3516av300/hi3516av300.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,12 @@ int is_auto_update(void)

int misc_init_r(void)
{
/* before the scan: a split image clears it, so bootm checks its CRC */
env_set("verify", "n");
openipc_helper();
#ifdef CONFIG_RANDOM_ETHADDR
random_init_r();
#endif
env_set("verify", "n");

#if (CONFIG_AUTO_UPDATE == 1)
/* auto update flag */
Expand Down
3 changes: 2 additions & 1 deletion board/hisilicon/hi3516cv500/hi3516cv500.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,12 @@ int is_auto_update(void)

int misc_init_r(void)
{
/* before the scan: a split image clears it, so bootm checks its CRC */
env_set("verify", "n");
openipc_helper();
#ifdef CONFIG_RANDOM_ETHADDR
random_init_r();
#endif
env_set("verify", "n");

#if (CONFIG_AUTO_UPDATE == 1)
/* auto update flag */
Expand Down
3 changes: 2 additions & 1 deletion board/hisilicon/hi3516dv300/hi3516dv300.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,12 @@ int is_auto_update(void)

int misc_init_r(void)
{
/* before the scan: a split image clears it, so bootm checks its CRC */
env_set("verify", "n");
openipc_helper();
#ifdef CONFIG_RANDOM_ETHADDR
random_init_r();
#endif
env_set("verify", "n");

#if (CONFIG_AUTO_UPDATE == 1)
/* auto update flag */
Expand Down
3 changes: 2 additions & 1 deletion board/hisilicon/hi3536dv100/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ int board_init(void)

int misc_init_r(void)
{
openipc_helper();
/* before the scan: a split image clears it, so bootm checks its CRC */
env_set("verify", "n");
openipc_helper();

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ config CMD_SDRAM

config CMD_SF
bool "sf"
depends on DM_SPI_FLASH || SPI_FLASH || FMC_SPI_NOR
depends on DM_SPI_FLASH || SPI_FLASH || FMC_SPI_NOR || HISFC350_SPI_NOR
default y if DM_SPI_FLASH
help
SPI Flash support
Expand Down
31 changes: 31 additions & 0 deletions common/openipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,11 +1081,42 @@ static void altbootcmd_migrate(void) {
env_save();
}

#if !defined(CONFIG_FMC_SPI_NAND) && defined(CONFIG_OPENIPC_NOR_SPLIT)
/*
* fwwrite writes only a file that fits fwsize, the firmware area from
* kernaddr to the end of the chip, and the layout scan sets it. Recovery
* runs before the scan, so a script.txt that runs fwupd would find no
* fwsize on a fresh environment and write nothing. Set it from the flash
* here; the scan sets it again from what it finds.
*/
static void nor_split_fwsize(void)
{
struct spi_flash *flash;
const char *ka = env_get("kernaddr");
ulong start = ka ? hextoul(ka, NULL) : CONFIG_ENV_KERNADDR;
char str[32];

flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS,
CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
if (!flash)
return;
if (start < flash->size) {
sprintf(str, "0x%lx", (ulong)(flash->size - start));
env_set("fwsize", str);
}
spi_flash_free(flash);
}
#endif

int openipc_helper(void) {
char msize[16];
sprintf(msize, "%ldM", gd->ram_size / 1024 / 1024);
env_set("totalmem", msize);

#if !defined(CONFIG_FMC_SPI_NAND) && defined(CONFIG_OPENIPC_NOR_SPLIT)
nor_split_fwsize();
#endif

/* Recovery checks what it runs: a board may already have set verify=n
* (so that the split scan below can clear it), and source would then run
* a wrapped script.txt without its data CRC. Drop it for recovery only
Expand Down
4 changes: 4 additions & 0 deletions openipc/hi3516av100_config
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
# CONFIG_NET_HISFV300 is not set
CONFIG_NET_HIGMACV300=y
CONFIG_MII=y

# The split NOR layout: the kernel (OpenIPC/linux hisilicon-hi3516av100)
# divides one firmware partition from its own device tree.
CONFIG_OPENIPC_NOR_SPLIT=y
4 changes: 4 additions & 0 deletions openipc/hi3516av300_config
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ CONFIG_NET_HISFV300=y
CONFIG_MMC=y
CONFIG_CMD_MMC=y
CONFIG_MMC_HS200_SUPPORT=y

# The split NOR layout: the kernel (OpenIPC/linux hisilicon-hi3516cv500)
# divides one firmware partition from its own device tree.
CONFIG_OPENIPC_NOR_SPLIT=y
4 changes: 4 additions & 0 deletions openipc/hi3516cv500_config
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ CONFIG_NET_HISFV300=y
CONFIG_MMC=y
CONFIG_CMD_MMC=y
CONFIG_MMC_HS200_SUPPORT=y

# The split NOR layout: the kernel (OpenIPC/linux hisilicon-hi3516cv500)
# divides one firmware partition from its own device tree.
CONFIG_OPENIPC_NOR_SPLIT=y
Comment thread
widgetii marked this conversation as resolved.
4 changes: 4 additions & 0 deletions openipc/hi3516dv100_config
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
# CONFIG_NET_HISFV300 is not set
CONFIG_NET_HIGMACV300=y
CONFIG_MII=y

# The split NOR layout: the kernel (OpenIPC/linux hisilicon-hi3516av100)
# divides one firmware partition from its own device tree.
CONFIG_OPENIPC_NOR_SPLIT=y
4 changes: 4 additions & 0 deletions openipc/hi3516dv300_config
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ CONFIG_NET_HISFV300=y
CONFIG_MMC=y
CONFIG_CMD_MMC=y
CONFIG_MMC_HS200_SUPPORT=y

# The split NOR layout: the kernel (OpenIPC/linux hisilicon-hi3516cv500)
# divides one firmware partition from its own device tree.
CONFIG_OPENIPC_NOR_SPLIT=y
4 changes: 4 additions & 0 deletions openipc/hi3536dv100_config
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ CONFIG_XMEDIA_DISABLE_DOWNLOAD=y
# CONFIG_CMD_CREAD is not set
# CONFIG_CMD_UGZIP is not set
# CONFIG_DDR_TRAINING_V2 is not set

# The split NOR layout: the kernel (OpenIPC/linux hisilicon-hi3536dv100)
# divides one firmware partition from its own device tree.
CONFIG_OPENIPC_NOR_SPLIT=y
Loading