aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/AndesTech/ax25-ae350/MAINTAINERS2
-rw-r--r--board/amlogic/khadas-vim/Kconfig12
-rw-r--r--board/amlogic/khadas-vim/MAINTAINERS6
-rw-r--r--board/amlogic/khadas-vim/khadas-vim.c57
-rw-r--r--board/amlogic/khadas-vim2/Kconfig12
-rw-r--r--board/amlogic/libretech-cc/Kconfig12
-rw-r--r--board/amlogic/libretech-cc/MAINTAINERS6
-rw-r--r--board/amlogic/libretech-cc/Makefile6
-rw-r--r--board/amlogic/libretech-cc/libretech-cc.c57
-rw-r--r--board/amlogic/nanopi-k2/Kconfig12
-rw-r--r--board/amlogic/nanopi-k2/MAINTAINERS6
-rw-r--r--board/amlogic/nanopi-k2/Makefile7
-rw-r--r--board/amlogic/nanopi-k2/nanopi-k2.c55
-rw-r--r--board/amlogic/odroid-c2/Kconfig12
-rw-r--r--board/amlogic/odroid-c2/MAINTAINERS2
-rw-r--r--board/amlogic/odroid-c2/README.nanopi-k2 (renamed from board/amlogic/nanopi-k2/README)0
-rw-r--r--board/amlogic/odroid-c2/README.odroid-c2 (renamed from board/amlogic/odroid-c2/README)0
-rw-r--r--board/amlogic/odroid-c2/odroid-c2.c16
-rw-r--r--board/amlogic/p212/Kconfig12
-rw-r--r--board/amlogic/p212/MAINTAINERS2
-rw-r--r--board/amlogic/p212/README.khadas-vim (renamed from board/amlogic/khadas-vim/README)0
-rw-r--r--board/amlogic/p212/README.libretech-cc (renamed from board/amlogic/libretech-cc/README)0
-rw-r--r--board/amlogic/p212/README.p212 (renamed from board/amlogic/p212/README)0
-rw-r--r--board/amlogic/p212/p212.c16
-rw-r--r--board/amlogic/q200/MAINTAINERS (renamed from board/amlogic/khadas-vim2/MAINTAINERS)6
-rw-r--r--board/amlogic/q200/Makefile (renamed from board/amlogic/khadas-vim/Makefile)2
-rw-r--r--board/amlogic/q200/README.khadas-vim2 (renamed from board/amlogic/khadas-vim2/README)0
-rw-r--r--board/amlogic/q200/README.q200102
-rw-r--r--board/amlogic/q200/q200.c (renamed from board/amlogic/khadas-vim2/khadas-vim2.c)14
-rw-r--r--board/amlogic/s400/MAINTAINERS6
-rw-r--r--board/amlogic/s400/Makefile (renamed from board/amlogic/khadas-vim2/Makefile)2
-rw-r--r--board/amlogic/s400/README110
-rw-r--r--board/amlogic/s400/s400.c21
-rw-r--r--board/armltd/integrator/README4
-rw-r--r--board/cssi/MCR3000/MCR3000.c16
-rw-r--r--board/cssi/MCR3000/u-boot.lds7
-rw-r--r--board/emulation/qemu-riscv/Kconfig2
-rw-r--r--board/emulation/qemu-riscv/qemu-riscv.c73
-rw-r--r--board/gardena/smart-gateway-mt7688/board.c269
-rw-r--r--board/gdsys/a38x/controlcenterdc.c25
-rw-r--r--board/gdsys/a38x/hre.c66
-rw-r--r--board/gdsys/a38x/hre.h2
-rw-r--r--board/gdsys/a38x/keyprogram.c12
-rw-r--r--board/gdsys/a38x/keyprogram.h4
-rw-r--r--board/gdsys/p1022/controlcenterd-id.c117
-rw-r--r--board/grinn/chiliboard/board.c61
-rw-r--r--board/mediatek/mt7623/Kconfig13
-rw-r--r--board/mediatek/mt7623/MAINTAINERS7
-rw-r--r--board/mediatek/mt7623/Makefile3
-rw-r--r--board/mediatek/mt7623/mt7623_rfb.c16
-rw-r--r--board/mediatek/mt7629/Kconfig17
-rw-r--r--board/mediatek/mt7629/MAINTAINERS7
-rw-r--r--board/mediatek/mt7629/Makefile3
-rw-r--r--board/mediatek/mt7629/mt7629_rfb.c16
-rw-r--r--board/raspberrypi/rpi/rpi.c14
-rw-r--r--board/sandbox/README.sandbox14
-rw-r--r--board/synopsys/axs10x/axs10x.c8
-rw-r--r--board/synopsys/emsdp/emsdp.c70
-rw-r--r--board/synopsys/hsdk/hsdk.c8
-rw-r--r--board/synopsys/iot_devkit/iot_devkit.c10
-rw-r--r--board/vscom/baltos/board.c7
-rw-r--r--board/vscom/baltos/mux.c7
62 files changed, 928 insertions, 523 deletions
diff --git a/board/AndesTech/ax25-ae350/MAINTAINERS b/board/AndesTech/ax25-ae350/MAINTAINERS
index 508c6ace72..d87446ee1c 100644
--- a/board/AndesTech/ax25-ae350/MAINTAINERS
+++ b/board/AndesTech/ax25-ae350/MAINTAINERS
@@ -3,4 +3,6 @@ M: Rick Chen <rick@andestech.com>
S: Maintained
F: board/AndesTech/ax25-ae350/
F: include/configs/ax25-ae350.h
+F: configs/a25-ae350_32_defconfig
+F: configs/ax25-ae350_64_defconfig
F: configs/ax25-ae350_defconfig
diff --git a/board/amlogic/khadas-vim/Kconfig b/board/amlogic/khadas-vim/Kconfig
deleted file mode 100644
index 0fa8db97ea..0000000000
--- a/board/amlogic/khadas-vim/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_KHADAS_VIM
-
-config SYS_BOARD
- default "khadas-vim"
-
-config SYS_VENDOR
- default "amlogic"
-
-config SYS_CONFIG_NAME
- default "khadas-vim"
-
-endif
diff --git a/board/amlogic/khadas-vim/MAINTAINERS b/board/amlogic/khadas-vim/MAINTAINERS
deleted file mode 100644
index 024220a526..0000000000
--- a/board/amlogic/khadas-vim/MAINTAINERS
+++ /dev/null
@@ -1,6 +0,0 @@
-KHADAS-VIM
-M: Neil Armstrong <narmstrong@baylibre.com>
-S: Maintained
-F: board/amlogic/khadas-vim/
-F: include/configs/khadas-vim.h
-F: configs/khadas-vim_defconfig
diff --git a/board/amlogic/khadas-vim/khadas-vim.c b/board/amlogic/khadas-vim/khadas-vim.c
deleted file mode 100644
index 692bf2add3..0000000000
--- a/board/amlogic/khadas-vim/khadas-vim.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2016 BayLibre, SAS
- * Author: Neil Armstrong <narmstrong@baylibre.com>
- */
-
-#include <common.h>
-#include <dm.h>
-#include <environment.h>
-#include <asm/io.h>
-#include <asm/arch/gx.h>
-#include <asm/arch/mem.h>
-#include <asm/arch/sm.h>
-#include <asm/arch/eth.h>
-
-#define EFUSE_SN_OFFSET 20
-#define EFUSE_SN_SIZE 16
-#define EFUSE_MAC_OFFSET 52
-#define EFUSE_MAC_SIZE 6
-
-int board_init(void)
-{
- return 0;
-}
-
-int misc_init_r(void)
-{
- u8 mac_addr[EFUSE_MAC_SIZE];
- char serial[EFUSE_SN_SIZE];
- ssize_t len;
-
- meson_gx_eth_init(PHY_INTERFACE_MODE_RMII,
- MESON_GXL_USE_INTERNAL_RMII_PHY);
-
- if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
- len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
- mac_addr, EFUSE_MAC_SIZE);
- if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
- eth_env_set_enetaddr("ethaddr", mac_addr);
- }
-
- if (!env_get("serial#")) {
- len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
- EFUSE_SN_SIZE);
- if (len == EFUSE_SN_SIZE)
- env_set("serial#", serial);
- }
-
- return 0;
-}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_gx_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/khadas-vim2/Kconfig b/board/amlogic/khadas-vim2/Kconfig
deleted file mode 100644
index d0af36264d..0000000000
--- a/board/amlogic/khadas-vim2/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_KHADAS_VIM2
-
-config SYS_BOARD
- default "khadas-vim2"
-
-config SYS_VENDOR
- default "amlogic"
-
-config SYS_CONFIG_NAME
- default "khadas-vim2"
-
-endif
diff --git a/board/amlogic/libretech-cc/Kconfig b/board/amlogic/libretech-cc/Kconfig
deleted file mode 100644
index 7a6f9169bd..0000000000
--- a/board/amlogic/libretech-cc/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_LIBRETECH_CC
-
-config SYS_BOARD
- default "libretech-cc"
-
-config SYS_VENDOR
- default "amlogic"
-
-config SYS_CONFIG_NAME
- default "libretech-cc"
-
-endif
diff --git a/board/amlogic/libretech-cc/MAINTAINERS b/board/amlogic/libretech-cc/MAINTAINERS
deleted file mode 100644
index 398ce57db2..0000000000
--- a/board/amlogic/libretech-cc/MAINTAINERS
+++ /dev/null
@@ -1,6 +0,0 @@
-LIBRETECH-CC
-M: Neil Armstrong <narmstrong@baylibre.com>
-S: Maintained
-F: board/amlogic/libretech-cc/
-F: include/configs/libretech-cc.h
-F: configs/libretech-cc_defconfig
diff --git a/board/amlogic/libretech-cc/Makefile b/board/amlogic/libretech-cc/Makefile
deleted file mode 100644
index 3b0adf8bf5..0000000000
--- a/board/amlogic/libretech-cc/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# (C) Copyright 2016 BayLibre, SAS
-# Author: Neil Armstrong <narmstrong@baylibre.com>
-
-obj-y := libretech-cc.o
diff --git a/board/amlogic/libretech-cc/libretech-cc.c b/board/amlogic/libretech-cc/libretech-cc.c
deleted file mode 100644
index ccab1272c5..0000000000
--- a/board/amlogic/libretech-cc/libretech-cc.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2016 BayLibre, SAS
- * Author: Neil Armstrong <narmstrong@baylibre.com>
- */
-
-#include <common.h>
-#include <dm.h>
-#include <environment.h>
-#include <asm/io.h>
-#include <asm/arch/gx.h>
-#include <asm/arch/sm.h>
-#include <asm/arch/eth.h>
-#include <asm/arch/mem.h>
-
-#define EFUSE_SN_OFFSET 20
-#define EFUSE_SN_SIZE 16
-#define EFUSE_MAC_OFFSET 52
-#define EFUSE_MAC_SIZE 6
-
-int board_init(void)
-{
- return 0;
-}
-
-int misc_init_r(void)
-{
- u8 mac_addr[EFUSE_MAC_SIZE];
- char serial[EFUSE_SN_SIZE];
- ssize_t len;
-
- meson_gx_eth_init(PHY_INTERFACE_MODE_RMII,
- MESON_GXL_USE_INTERNAL_RMII_PHY);
-
- if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
- len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
- mac_addr, EFUSE_MAC_SIZE);
- if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
- eth_env_set_enetaddr("ethaddr", mac_addr);
- }
-
- if (!env_get("serial#")) {
- len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
- EFUSE_SN_SIZE);
- if (len == EFUSE_SN_SIZE)
- env_set("serial#", serial);
- }
-
- return 0;
-}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_gx_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/nanopi-k2/Kconfig b/board/amlogic/nanopi-k2/Kconfig
deleted file mode 100644
index 374bda200c..0000000000
--- a/board/amlogic/nanopi-k2/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_NANOPI_K2
-
-config SYS_BOARD
- default "nanopi-k2"
-
-config SYS_VENDOR
- default "amlogic"
-
-config SYS_CONFIG_NAME
- default "nanopi-k2"
-
-endif
diff --git a/board/amlogic/nanopi-k2/MAINTAINERS b/board/amlogic/nanopi-k2/MAINTAINERS
deleted file mode 100644
index 0452bd1fa1..0000000000
--- a/board/amlogic/nanopi-k2/MAINTAINERS
+++ /dev/null
@@ -1,6 +0,0 @@
-NANOPI-K2
-M: Neil Armstrong <narmstrong@baylibre.com>
-S: Maintained
-F: board/amlogic/nanopi-k2/
-F: include/configs/nanopi-k2.h
-F: configs/nanopi-k2_defconfig
diff --git a/board/amlogic/nanopi-k2/Makefile b/board/amlogic/nanopi-k2/Makefile
deleted file mode 100644
index 7d9b666e76..0000000000
--- a/board/amlogic/nanopi-k2/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# (C) Copyright 2018 Thomas McKahan
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-obj-y := nanopi-k2.o
diff --git a/board/amlogic/nanopi-k2/nanopi-k2.c b/board/amlogic/nanopi-k2/nanopi-k2.c
deleted file mode 100644
index ae29dd6fa4..0000000000
--- a/board/amlogic/nanopi-k2/nanopi-k2.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2018 Thomas McKahan
- */
-
-#include <common.h>
-#include <dm.h>
-#include <environment.h>
-#include <asm/io.h>
-#include <asm/arch/gx.h>
-#include <asm/arch/sm.h>
-#include <asm/arch/eth.h>
-#include <asm/arch/mem.h>
-
-#define EFUSE_SN_OFFSET 20
-#define EFUSE_SN_SIZE 16
-#define EFUSE_MAC_OFFSET 52
-#define EFUSE_MAC_SIZE 6
-
-int board_init(void)
-{
- return 0;
-}
-
-int misc_init_r(void)
-{
- u8 mac_addr[EFUSE_MAC_SIZE];
- char serial[EFUSE_SN_SIZE];
- ssize_t len;
-
- meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
-
- if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
- len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
- mac_addr, EFUSE_MAC_SIZE);
- if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
- eth_env_set_enetaddr("ethaddr", mac_addr);
- }
-
- if (!env_get("serial#")) {
- len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
- EFUSE_SN_SIZE);
- if (len == EFUSE_SN_SIZE)
- env_set("serial#", serial);
- }
-
- return 0;
-}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_gx_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/odroid-c2/Kconfig b/board/amlogic/odroid-c2/Kconfig
deleted file mode 100644
index 2b16889b07..0000000000
--- a/board/amlogic/odroid-c2/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_ODROID_C2
-
-config SYS_BOARD
- default "odroid-c2"
-
-config SYS_VENDOR
- default "amlogic"
-
-config SYS_CONFIG_NAME
- default "odroid-c2"
-
-endif
diff --git a/board/amlogic/odroid-c2/MAINTAINERS b/board/amlogic/odroid-c2/MAINTAINERS
index 699850fd0c..6a853066d7 100644
--- a/board/amlogic/odroid-c2/MAINTAINERS
+++ b/board/amlogic/odroid-c2/MAINTAINERS
@@ -1,6 +1,8 @@
ODROID-C2
M: Beniamino Galvani <b.galvani@gmail.com>
+M: Neil Armstrong <narmstrong@baylibre.com>
S: Maintained
F: board/amlogic/odroid-c2/
F: include/configs/odroid-c2.h
+F: configs/nanopi-k2_defconfig
F: configs/odroid-c2_defconfig
diff --git a/board/amlogic/nanopi-k2/README b/board/amlogic/odroid-c2/README.nanopi-k2
index d450d3c2b2..d450d3c2b2 100644
--- a/board/amlogic/nanopi-k2/README
+++ b/board/amlogic/odroid-c2/README.nanopi-k2
diff --git a/board/amlogic/odroid-c2/README b/board/amlogic/odroid-c2/README.odroid-c2
index bed48c5728..bed48c5728 100644
--- a/board/amlogic/odroid-c2/README
+++ b/board/amlogic/odroid-c2/README.odroid-c2
diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c
index 2a2755c387..62f0f4c871 100644
--- a/board/amlogic/odroid-c2/odroid-c2.c
+++ b/board/amlogic/odroid-c2/odroid-c2.c
@@ -17,18 +17,13 @@
#define EFUSE_MAC_OFFSET 52
#define EFUSE_MAC_SIZE 6
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
char serial[EFUSE_SN_SIZE];
ssize_t len;
- meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
+ meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
@@ -40,16 +35,9 @@ int misc_init_r(void)
if (!env_get("serial#")) {
len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
EFUSE_SN_SIZE);
- if (len == EFUSE_SN_SIZE)
+ if (len == EFUSE_SN_SIZE)
env_set("serial#", serial);
}
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_gx_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/p212/Kconfig b/board/amlogic/p212/Kconfig
deleted file mode 100644
index 720c92b1ee..0000000000
--- a/board/amlogic/p212/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_P212
-
-config SYS_BOARD
- default "p212"
-
-config SYS_VENDOR
- default "amlogic"
-
-config SYS_CONFIG_NAME
- default "p212"
-
-endif
diff --git a/board/amlogic/p212/MAINTAINERS b/board/amlogic/p212/MAINTAINERS
index 6575f17e14..07ca6f204d 100644
--- a/board/amlogic/p212/MAINTAINERS
+++ b/board/amlogic/p212/MAINTAINERS
@@ -3,4 +3,6 @@ M: Neil Armstrong <narmstrong@baylibre.com>
S: Maintained
F: board/amlogic/p212/
F: include/configs/p212.h
+F: configs/khadas-vim_defconfig
+F: configs/libretech-cc_defconfig
F: configs/p212_defconfig
diff --git a/board/amlogic/khadas-vim/README b/board/amlogic/p212/README.khadas-vim
index b1942364f8..b1942364f8 100644
--- a/board/amlogic/khadas-vim/README
+++ b/board/amlogic/p212/README.khadas-vim
diff --git a/board/amlogic/libretech-cc/README b/board/amlogic/p212/README.libretech-cc
index d007f58764..d007f58764 100644
--- a/board/amlogic/libretech-cc/README
+++ b/board/amlogic/p212/README.libretech-cc
diff --git a/board/amlogic/p212/README b/board/amlogic/p212/README.p212
index ef5370c763..ef5370c763 100644
--- a/board/amlogic/p212/README
+++ b/board/amlogic/p212/README.p212
diff --git a/board/amlogic/p212/p212.c b/board/amlogic/p212/p212.c
index 00e07d77ad..546c4d9c86 100644
--- a/board/amlogic/p212/p212.c
+++ b/board/amlogic/p212/p212.c
@@ -18,19 +18,14 @@
#define EFUSE_MAC_OFFSET 52
#define EFUSE_MAC_SIZE 6
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
char serial[EFUSE_SN_SIZE];
ssize_t len;
- meson_gx_eth_init(PHY_INTERFACE_MODE_RMII,
- MESON_GXL_USE_INTERNAL_RMII_PHY);
+ meson_eth_init(PHY_INTERFACE_MODE_RMII,
+ MESON_USE_INTERNAL_RMII_PHY);
if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
@@ -48,10 +43,3 @@ int misc_init_r(void)
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_gx_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/khadas-vim2/MAINTAINERS b/board/amlogic/q200/MAINTAINERS
index ca63e311c6..be86386619 100644
--- a/board/amlogic/khadas-vim2/MAINTAINERS
+++ b/board/amlogic/q200/MAINTAINERS
@@ -1,6 +1,6 @@
-KHADAS-VIM2
+Q200
M: Neil Armstrong <narmstrong@baylibre.com>
S: Maintained
-F: board/amlogic/khadas-vim2/
-F: include/configs/khadas-vim2.h
+F: board/amlogic/q200/
+F: include/configs/q200.h
F: configs/khadas-vim2_defconfig
diff --git a/board/amlogic/khadas-vim/Makefile b/board/amlogic/q200/Makefile
index 558c0769b7..fd78fd068a 100644
--- a/board/amlogic/khadas-vim/Makefile
+++ b/board/amlogic/q200/Makefile
@@ -3,4 +3,4 @@
# (C) Copyright 2016 BayLibre, SAS
# Author: Neil Armstrong <narmstrong@baylibre.com>
-obj-y := khadas-vim.o
+obj-y := q200.o
diff --git a/board/amlogic/khadas-vim2/README b/board/amlogic/q200/README.khadas-vim2
index 578693fd2d..578693fd2d 100644
--- a/board/amlogic/khadas-vim2/README
+++ b/board/amlogic/q200/README.khadas-vim2
diff --git a/board/amlogic/q200/README.q200 b/board/amlogic/q200/README.q200
new file mode 100644
index 0000000000..55d730a0d2
--- /dev/null
+++ b/board/amlogic/q200/README.q200
@@ -0,0 +1,102 @@
+U-Boot for Amlogic Q200
+=======================
+
+Q200 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz
+ - ARM Mali T860 GPU
+ - 2/3GB DDR4 SDRAM
+ - 10/100/1000 Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host, 1 x USB 2.0 Device
+ - 16GB/32GB/64GB eMMC
+ - 2MB SPI Flash
+ - microSD
+ - SDIO Wifi Module, Bluetooth
+ - IR receiver
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+U-Boot compilation
+==================
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make khadas-vim2_defconfig
+ > make
+
+Image creation
+==============
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxm_q200_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-Boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+ fip/bl30.bin \
+ fip/zero_tmp \
+ fip/bl30_zero.bin \
+ fip/bl301.bin \
+ fip/bl301_zero.bin \
+ fip/bl30_new.bin \
+ bl30
+
+ > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+ fip/bl2_acs.bin \
+ fip/zero_tmp \
+ fip/bl2_zero.bin \
+ fip/bl21.bin \
+ fip/bl21_zero.bin \
+ fip/bl2_new.bin \
+ bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+ --output fip/u-boot.bin \
+ --bl2 fip/bl2.n.bin.sig \
+ --bl30 fip/bl30_new.bin.enc \
+ --bl31 fip/bl31.img.enc \
+ --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/khadas-vim2/khadas-vim2.c b/board/amlogic/q200/q200.c
index ff56569f17..6db1b26e08 100644
--- a/board/amlogic/khadas-vim2/khadas-vim2.c
+++ b/board/amlogic/q200/q200.c
@@ -18,18 +18,13 @@
#define EFUSE_MAC_OFFSET 52
#define EFUSE_MAC_SIZE 6
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
char serial[EFUSE_SN_SIZE];
ssize_t len;
- meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
+ meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
/* Reset PHY on GPIOZ_14 */
clrbits_le32(GX_GPIO_EN(3), BIT(14));
@@ -53,10 +48,3 @@ int misc_init_r(void)
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_gx_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/s400/MAINTAINERS b/board/amlogic/s400/MAINTAINERS
new file mode 100644
index 0000000000..9ca9836016
--- /dev/null
+++ b/board/amlogic/s400/MAINTAINERS
@@ -0,0 +1,6 @@
+S400
+M: Neil Armstrong <narmstrong@baylibre.com>
+S: Maintained
+F: board/amlogic/s400/
+F: include/configs/s400.h
+F: configs/s400_defconfig
diff --git a/board/amlogic/khadas-vim2/Makefile b/board/amlogic/s400/Makefile
index 4e7c9a0592..bf03862b90 100644
--- a/board/amlogic/khadas-vim2/Makefile
+++ b/board/amlogic/s400/Makefile
@@ -3,4 +3,4 @@
# (C) Copyright 2016 BayLibre, SAS
# Author: Neil Armstrong <narmstrong@baylibre.com>
-obj-y := khadas-vim2.o
+obj-y := s400.o
diff --git a/board/amlogic/s400/README b/board/amlogic/s400/README
new file mode 100644
index 0000000000..ab21998dc8
--- /dev/null
+++ b/board/amlogic/s400/README
@@ -0,0 +1,110 @@
+U-Boot for Amlogic S400
+=======================
+
+S400 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic A113DX ARM Cortex-A53 quad-core SoC @ 1.2GHz
+ - 1GB DDR4 SDRAM
+ - 10/100 Ethernet
+ - 2 x USB 2.0 Host
+ - eMMC
+ - Infrared receiver
+ - SDIO WiFi Module
+ - MIPI DSI Connector
+ - Audio HAT Connector
+ - PCI-E M.2 Connectors
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==================
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make s400_defconfig
+ > make
+
+Image creation
+==============
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make axg_s400_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/axg/bl2.bin fip/
+ > cp $FIPDIR/axg/acs.bin fip/
+ > cp $FIPDIR/axg/bl21.bin fip/
+ > cp $FIPDIR/axg/bl30.bin fip/
+ > cp $FIPDIR/axg/bl301.bin fip/
+ > cp $FIPDIR/axg/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+ fip/bl30.bin \
+ fip/zero_tmp \
+ fip/bl30_zero.bin \
+ fip/bl301.bin \
+ fip/bl301_zero.bin \
+ fip/bl30_new.bin \
+ bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+ fip/bl2_acs.bin \
+ fip/zero_tmp \
+ fip/bl2_zero.bin \
+ fip/bl21.bin \
+ fip/bl21_zero.bin \
+ fip/bl2_new.bin \
+ bl2
+
+ > $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \
+ --output fip/bl30_new.bin.enc \
+ --level v3 --type bl30
+ > $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl31.img \
+ --output fip/bl31.img.enc \
+ --level v3 --type bl31
+ > $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \
+ --output fip/bl33.bin.enc \
+ --level v3 --type bl33
+ > $FIPDIR/axg/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \
+ --output fip/bl2.n.bin.sig
+ > $FIPDIR/axg/aml_encrypt_axg --bootmk \
+ --output fip/u-boot.bin \
+ --bl2 fip/bl2.n.bin.sig \
+ --bl30 fip/bl30_new.bin.enc \
+ --bl31 fip/bl31.img.enc \
+ --bl33 fip/bl33.bin.enc --level v3
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/s400/s400.c b/board/amlogic/s400/s400.c
new file mode 100644
index 0000000000..02a0e9286c
--- /dev/null
+++ b/board/amlogic/s400/s400.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <environment.h>
+#include <asm/io.h>
+#include <asm/arch/axg.h>
+#include <asm/arch/sm.h>
+#include <asm/arch/eth.h>
+#include <asm/arch/mem.h>
+
+int misc_init_r(void)
+{
+ meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
+
+ return 0;
+}
diff --git a/board/armltd/integrator/README b/board/armltd/integrator/README
index 5a0e934924..af9dcc1f4f 100644
--- a/board/armltd/integrator/README
+++ b/board/armltd/integrator/README
@@ -36,9 +36,7 @@ In case c) it may be necessary for U-Boot to perform CM dependent initialization
Configuring U-Boot :
------------------
The makefile contains targets for Integrator platforms of both types
-fitted with all current variants of CM. If these targets are to be used with
-boot process c) above then CONFIG_INIT_CRITICAL may need to be defined to ensure
-that the CM is correctly configured.
+fitted with all current variants of CM.
There are also targets independent of CM. These may not be suitable for
boot process c) above. They have been preserved for backward compatibility with
diff --git a/board/cssi/MCR3000/MCR3000.c b/board/cssi/MCR3000/MCR3000.c
index ffbeb14ed0..d26ac35b44 100644
--- a/board/cssi/MCR3000/MCR3000.c
+++ b/board/cssi/MCR3000/MCR3000.c
@@ -12,6 +12,8 @@
#include <mpc8xx.h>
#include <fdt_support.h>
#include <asm/io.h>
+#include <dm/uclass.h>
+#include <wdt.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -143,3 +145,17 @@ int board_early_init_f(void)
return 0;
}
+
+int board_early_init_r(void)
+{
+ struct udevice *watchdog_dev = NULL;
+
+ if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
+ puts("Cannot find watchdog!\n");
+ } else {
+ puts("Enabling watchdog.\n");
+ wdt_start(watchdog_dev, 0xffff, 0);
+ }
+
+ return 0;
+}
diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds
index a32c0e721e..70aef3241c 100644
--- a/board/cssi/MCR3000/u-boot.lds
+++ b/board/cssi/MCR3000/u-boot.lds
@@ -19,7 +19,6 @@ SECTIONS
arch/powerpc/cpu/mpc8xx/start.o (.text)
arch/powerpc/cpu/mpc8xx/traps.o (.text*)
arch/powerpc/lib/built-in.o (.text*)
- board/cssi/MCR3000/built-in.o (.text*)
drivers/net/built-in.o (.text*)
. = DEFINED(env_offset) ? env_offset : .;
@@ -69,6 +68,12 @@ SECTIONS
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
+ /*
+ * _end - This is end of u-boot.bin image.
+ * dtb will be appended here to make u-boot-dtb.bin
+ */
+ _end = .;
+
. = ALIGN(4096);
__init_begin = .;
.text.init : { *(.text.init) }
diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index 37a80db6a9..33ca253432 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -29,5 +29,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply CMD_EXT2
imply CMD_EXT4
imply CMD_FAT
+ imply BOARD_LATE_INIT
+ imply OF_BOARD_SETUP
endif
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c
index 2730a288fb..d6167aaef1 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -9,8 +9,6 @@
#include <virtio_types.h>
#include <virtio.h>
-#define MROM_FDT_ADDR 0x1020
-
int board_init(void)
{
/*
@@ -22,11 +20,70 @@ int board_init(void)
return 0;
}
-void *board_fdt_blob_setup(void)
+int board_late_init(void)
{
- /*
- * QEMU loads a generated DTB for us immediately
- * after the reset vectors in the MROM
- */
- return (void *)MROM_FDT_ADDR;
+ ulong kernel_start;
+ ofnode chosen_node;
+ int ret;
+
+ chosen_node = ofnode_path("/chosen");
+ if (!ofnode_valid(chosen_node)) {
+ debug("No chosen node found, can't get kernel start address\n");
+ return 0;
+ }
+
+#ifdef CONFIG_ARCH_RV64I
+ ret = ofnode_read_u64(chosen_node, "riscv,kernel-start",
+ (u64 *)&kernel_start);
+#else
+ ret = ofnode_read_u32(chosen_node, "riscv,kernel-start",
+ (u32 *)&kernel_start);
+#endif
+ if (ret) {
+ debug("Can't find kernel start address in device tree\n");
+ return 0;
+ }
+
+ env_set_hex("kernel_start", kernel_start);
+
+ return 0;
+}
+
+/*
+ * QEMU specifies the location of Linux (supplied with the -kernel argument)
+ * in the device tree using the riscv,kernel-start and riscv,kernel-end
+ * properties. We currently rely on the SBI implementation of BBL to run
+ * Linux and therefore embed Linux as payload in BBL. This causes an issue,
+ * because BBL detects the kernel properties in the device tree and ignores
+ * the Linux payload as a result. To work around this issue, we clear the
+ * kernel properties before booting Linux.
+ *
+ * This workaround can be removed, once we do not require BBL for its SBI
+ * implementation anymore.
+ */
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ int chosen_offset, ret;
+
+ chosen_offset = fdt_path_offset(blob, "/chosen");
+ if (chosen_offset < 0)
+ return 0;
+
+#ifdef CONFIG_ARCH_RV64I
+ ret = fdt_setprop_u64(blob, chosen_offset, "riscv,kernel-start", 0);
+#else
+ ret = fdt_setprop_u32(blob, chosen_offset, "riscv,kernel-start", 0);
+#endif
+ if (ret)
+ return ret;
+
+#ifdef CONFIG_ARCH_RV64I
+ ret = fdt_setprop_u64(blob, chosen_offset, "riscv,kernel-end", 0);
+#else
+ ret = fdt_setprop_u32(blob, chosen_offset, "riscv,kernel-end", 0);
+#endif
+ if (ret)
+ return ret;
+
+ return 0;
}
diff --git a/board/gardena/smart-gateway-mt7688/board.c b/board/gardena/smart-gateway-mt7688/board.c
index 3a1838e44a..6e11077977 100644
--- a/board/gardena/smart-gateway-mt7688/board.c
+++ b/board/gardena/smart-gateway-mt7688/board.c
@@ -4,11 +4,44 @@
*/
#include <common.h>
+#include <environment.h>
#include <led.h>
+#include <net.h>
+#include <spi.h>
+#include <spi_flash.h>
+#include <uuid.h>
+#include <linux/ctype.h>
#include <linux/io.h>
#define MT76XX_AGPIO_CFG 0x1000003c
+#define FACTORY_DATA_OFFS 0xc0000
+#define FACTORY_DATA_SECT_SIZE 0x10000
+#if ((CONFIG_ENV_OFFSET_REDUND + CONFIG_ENV_SIZE_REDUND) > FACTORY_DATA_OFFS)
+#error "U-Boot image with environment too big (overlapping with factory-data)!"
+#endif
+#define FACTORY_DATA_USER_OFFS 0x140
+#define FACTORY_DATA_SIZE 0x1f0
+#define FACTORY_DATA_CRC_LEN (FACTORY_DATA_SIZE - \
+ FACTORY_DATA_USER_OFFS - sizeof(u32))
+
+#define FACTORY_DATA_MAGIC 0xCAFEBABE
+
+struct factory_data_values {
+ u8 pad_1[4];
+ u8 wifi_mac[6]; /* offs: 0x004: binary value */
+ u8 pad_2[30];
+ u8 eth_mac[6]; /* offs: 0x028: binary value */
+ u8 pad_3[FACTORY_DATA_USER_OFFS - 4 - 6 - 30 - 6];
+ /* User values start here at offset 0x140 */
+ u32 crc;
+ u32 magic;
+ u32 version;
+ char ipr_id[UUID_STR_LEN]; /* UUID as string w/o ending \0 */
+ char hqv_id[UUID_STR_LEN]; /* UUID as string w/o ending \0 */
+ char unielec_id[UUID_STR_LEN]; /* UUID as string w/o ending \0 */
+};
+
int board_early_init_f(void)
{
void __iomem *gpio_mode;
@@ -20,10 +53,246 @@ int board_early_init_f(void)
return 0;
}
+static bool prepare_uuid_var(const char *fd_ptr, const char *env_var_name,
+ char errorchar)
+{
+ char str[UUID_STR_LEN + 1] = { 0 }; /* Enough for UUID stuff */
+ bool env_updated = false;
+ char *env;
+ int i;
+
+ memcpy(str, fd_ptr, UUID_STR_LEN);
+
+ /* Convert non-ascii character to 'X' */
+ for (i = 0; i < UUID_STR_LEN; i++) {
+ if (!(isascii(str[i]) && isprint(str[i])))
+ str[i] = errorchar;
+ }
+
+ env = env_get(env_var_name);
+ if (strcmp(env, str)) {
+ env_set(env_var_name, str);
+ env_updated = true;
+ }
+
+ return env_updated;
+}
+
+static void factory_data_env_config(void)
+{
+ struct factory_data_values *fd;
+ struct spi_flash *sf;
+ int env_updated = 0;
+ char str[UUID_STR_LEN + 1]; /* Enough for UUID stuff */
+ char *env;
+ u8 *buf;
+ u32 crc;
+ int ret;
+ u8 *ptr;
+
+ buf = malloc(FACTORY_DATA_SIZE);
+ if (!buf) {
+ printf("F-Data:Unable to allocate buffer\n");
+ return;
+ }
+
+ /*
+ * Get values from factory-data area in SPI NOR
+ */
+ sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
+ CONFIG_SF_DEFAULT_CS,
+ CONFIG_SF_DEFAULT_SPEED,
+ CONFIG_SF_DEFAULT_MODE);
+ if (!sf) {
+ printf("F-Data:Unable to access SPI NOR flash\n");
+ goto err_free;
+ }
+
+ ret = spi_flash_read(sf, FACTORY_DATA_OFFS, FACTORY_DATA_SIZE,
+ (void *)buf);
+ if (ret) {
+ printf("F-Data:Unable to read factory-data from SPI NOR\n");
+ goto err_spi_flash;
+ }
+
+ fd = (struct factory_data_values *)buf;
+
+ if (fd->magic != FACTORY_DATA_MAGIC)
+ printf("F-Data:Magic value not correct\n");
+
+ crc = crc32(0, (u8 *)&fd->magic, FACTORY_DATA_CRC_LEN);
+ if (crc != fd->crc)
+ printf("F-Data:CRC not correct\n");
+ else
+ printf("F-Data:factory-data version %x detected\n",
+ fd->version);
+
+ /* Handle wifi_mac env variable */
+ ptr = fd->wifi_mac;
+ sprintf(str, "%pM", ptr);
+ if (!is_valid_ethaddr(ptr))
+ printf("F-Data:Invalid MAC addr: wifi_mac %s\n", str);
+
+ env = env_get("wifiaddr");
+ if (strcmp(env, str)) {
+ env_set("wifiaddr", str);
+ env_updated = 1;
+ }
+
+ /* Handle eth_mac env variable */
+ ptr = fd->eth_mac;
+ sprintf(str, "%pM", ptr);
+ if (!is_valid_ethaddr(ptr))
+ printf("F-Data:Invalid MAC addr: eth_mac %s\n", str);
+
+ env = env_get("ethaddr");
+ if (strcmp(env, str)) {
+ env_set("ethaddr", str);
+ env_updated = 1;
+ }
+
+ /* Handle UUID env variables */
+ env_updated |= prepare_uuid_var(fd->ipr_id, "linuxmoduleid", 'X');
+ env_updated |= prepare_uuid_var(fd->hqv_id, "linuxmodulehqvid", '\0');
+ env_updated |= prepare_uuid_var(fd->unielec_id,
+ "linuxmoduleunielecid", '\0');
+
+ /* Check if the environment was updated and needs to get stored */
+ if (env_updated != 0) {
+ printf("F-Data:Values don't match env values -> saving\n");
+ env_save();
+ } else {
+ debug("F-Data:Values match current env values\n");
+ }
+
+err_spi_flash:
+ spi_flash_free(sf);
+
+err_free:
+ free(buf);
+}
+
int board_late_init(void)
{
if (IS_ENABLED(CONFIG_LED))
led_default_state();
+ factory_data_env_config();
+
return 0;
}
+
+static void copy_or_generate_uuid(char *fd_ptr, const char *env_var_name)
+{
+ char str[UUID_STR_LEN + 1] = { 0 }; /* Enough for UUID stuff */
+ char *env;
+
+ /* Don't use the UUID dest place, as the \0 char won't fit */
+ env = env_get(env_var_name);
+ if (env)
+ strncpy(str, env, UUID_STR_LEN);
+ else
+ gen_rand_uuid_str(str, UUID_STR_FORMAT_STD);
+
+ memcpy(fd_ptr, str, UUID_STR_LEN);
+}
+
+/*
+ * Helper function to provide some sane factory-data values for testing
+ * purpose, when these values are not programmed correctly
+ */
+int do_fd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ struct factory_data_values *fd;
+ struct spi_flash *sf;
+ u8 *buf;
+ int ret = CMD_RET_FAILURE;
+
+ buf = malloc(FACTORY_DATA_SECT_SIZE);
+ if (!buf) {
+ printf("F-Data:Unable to allocate buffer\n");
+ return CMD_RET_FAILURE;
+ }
+
+ sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
+ CONFIG_SF_DEFAULT_CS,
+ CONFIG_SF_DEFAULT_SPEED,
+ CONFIG_SF_DEFAULT_MODE);
+ if (!sf) {
+ printf("F-Data:Unable to access SPI NOR flash\n");
+ goto err_free;
+ }
+
+ /* Generate the factory-data struct */
+
+ /* Fist read complete sector into buffer */
+ ret = spi_flash_read(sf, FACTORY_DATA_OFFS, FACTORY_DATA_SECT_SIZE,
+ (void *)buf);
+ if (ret) {
+ printf("F-Data:spi_flash_read failed (%d)\n", ret);
+ goto err_spi_flash;
+ }
+
+ fd = (struct factory_data_values *)buf;
+ fd->magic = FACTORY_DATA_MAGIC;
+ fd->version = 0x1;
+
+ /* Use existing MAC and UUID values or generate some random ones */
+ if (!eth_env_get_enetaddr("wifiaddr", fd->wifi_mac)) {
+ net_random_ethaddr(fd->wifi_mac);
+ /* to get a different seed value for the MAC address */
+ mdelay(10);
+ }
+
+ if (!eth_env_get_enetaddr("ethaddr", fd->eth_mac))
+ net_random_ethaddr(fd->eth_mac);
+
+ copy_or_generate_uuid(fd->ipr_id, "linuxmoduleid");
+ copy_or_generate_uuid(fd->hqv_id, "linuxmodulehqvid");
+ copy_or_generate_uuid(fd->unielec_id, "linuxmoduleunielecid");
+
+ printf("New factory-data values:\n");
+ printf("wifiaddr=%pM\n", fd->wifi_mac);
+ printf("ethaddr=%pM\n", fd->eth_mac);
+
+ /*
+ * We don't have the \0 char at the end, so we need to specify the
+ * length in the printf format instead
+ */
+ printf("linuxmoduleid=%." __stringify(UUID_STR_LEN) "s\n", fd->ipr_id);
+ printf("linuxmodulehqvid=%." __stringify(UUID_STR_LEN) "s\n",
+ fd->hqv_id);
+ printf("linuxmoduleunielecid=%." __stringify(UUID_STR_LEN) "s\n",
+ fd->unielec_id);
+
+ fd->crc = crc32(0, (u8 *)&fd->magic, FACTORY_DATA_CRC_LEN);
+
+ ret = spi_flash_erase(sf, FACTORY_DATA_OFFS, FACTORY_DATA_SECT_SIZE);
+ if (ret) {
+ printf("F-Data:spi_flash_erase failed (%d)\n", ret);
+ goto err_spi_flash;
+ }
+
+ ret = spi_flash_write(sf, FACTORY_DATA_OFFS, FACTORY_DATA_SECT_SIZE,
+ buf);
+ if (ret) {
+ printf("F-Data:spi_flash_write failed (%d)\n", ret);
+ goto err_spi_flash;
+ }
+
+ printf("F-Data:factory-data values written to SPI NOR flash\n");
+
+err_spi_flash:
+ spi_flash_free(sf);
+
+err_free:
+ free(buf);
+
+ return ret;
+}
+
+U_BOOT_CMD(
+ fd_write, 1, 0, do_fd_write,
+ "Write test factory-data values to SPI NOR",
+ "\n"
+);
diff --git a/board/gdsys/a38x/controlcenterdc.c b/board/gdsys/a38x/controlcenterdc.c
index 824a08f12a..dd4c083fbd 100644
--- a/board/gdsys/a38x/controlcenterdc.c
+++ b/board/gdsys/a38x/controlcenterdc.c
@@ -34,6 +34,19 @@ DECLARE_GLOBAL_DATA_PTR;
#define DB_GP_88F68XX_GPP_POL_LOW 0x0
#define DB_GP_88F68XX_GPP_POL_MID 0x0
+static int get_tpm(struct udevice **devp)
+{
+ int rc;
+
+ rc = uclass_first_device_err(UCLASS_TPM, devp);
+ if (rc) {
+ printf("Could not find TPM (ret=%d)\n", rc);
+ return CMD_RET_FAILURE;
+ }
+
+ return 0;
+}
+
/*
* 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
@@ -266,18 +279,22 @@ int board_fix_fdt(void *rw_fdt_blob)
int last_stage_init(void)
{
+ struct udevice *tpm;
+ int ret;
+
#ifndef CONFIG_SPL_BUILD
ccdc_eth_init();
#endif
- if (tpm_init() || tpm_startup(TPM_ST_CLEAR) ||
- tpm_continue_self_test()) {
+ ret = get_tpm(&tpm);
+ if (ret || tpm_init(tpm) || tpm_startup(tpm, TPM_ST_CLEAR) ||
+ tpm_continue_self_test(tpm)) {
return 1;
}
mdelay(37);
- flush_keys();
- load_and_run_keyprog();
+ flush_keys(tpm);
+ load_and_run_keyprog(tpm);
return 0;
}
diff --git a/board/gdsys/a38x/hre.c b/board/gdsys/a38x/hre.c
index 34c4df71b2..82b84284ef 100644
--- a/board/gdsys/a38x/hre.c
+++ b/board/gdsys/a38x/hre.c
@@ -93,19 +93,20 @@ static const uint8_t vendor[] = "Guntermann & Drunck";
/**
* @brief get the size of a given (TPM) NV area
+ * @param tpm TPM device
* @param index NV index of the area to get size for
* @param size pointer to the size
* @return 0 on success, != 0 on error
*/
-static int get_tpm_nv_size(uint32_t index, uint32_t *size)
+static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size)
{
uint32_t err;
uint8_t info[72];
uint8_t *ptr;
uint16_t v16;
- err = tpm_get_capability(TPM_CAP_NV_INDEX, index,
- info, sizeof(info));
+ err = tpm_get_capability(tpm, TPM_CAP_NV_INDEX, index,
+ info, sizeof(info));
if (err) {
printf("tpm_get_capability(CAP_NV_INDEX, %08x) failed: %u\n",
index, err);
@@ -128,13 +129,14 @@ static int get_tpm_nv_size(uint32_t index, uint32_t *size)
/**
* @brief search for a key by usage auth and pub key hash.
+ * @param tpm TPM device
* @param auth usage auth of the key to search for
* @param pubkey_digest (SHA1) hash of the pub key structure of the key
* @param[out] handle the handle of the key iff found
* @return 0 if key was found in TPM; != 0 if not.
*/
-static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
- uint32_t *handle)
+static int find_key(struct udevice *tpm, const uint8_t auth[20],
+ const uint8_t pubkey_digest[20], uint32_t *handle)
{
uint16_t key_count;
uint32_t key_handles[10];
@@ -146,7 +148,8 @@ static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
unsigned int i;
/* fetch list of already loaded keys in the TPM */
- err = tpm_get_capability(TPM_CAP_HANDLE, TPM_RT_KEY, buf, sizeof(buf));
+ err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
+ sizeof(buf));
if (err)
return -1;
key_count = get_unaligned_be16(buf);
@@ -157,7 +160,8 @@ static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
/* now search a(/ the) key which we can access with the given auth */
for (i = 0; i < key_count; ++i) {
buf_len = sizeof(buf);
- err = tpm_get_pub_key_oiap(key_handles[i], auth, buf, &buf_len);
+ err = tpm_get_pub_key_oiap(tpm, key_handles[i], auth, buf,
+ &buf_len);
if (err && err != TPM_AUTHFAIL)
return -1;
if (err)
@@ -173,20 +177,21 @@ static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
/**
* @brief read CCDM common data from TPM NV
+ * @param tpm TPM device
* @return 0 if CCDM common data was found and read, !=0 if something failed.
*/
-static int read_common_data(void)
+static int read_common_data(struct udevice *tpm)
{
uint32_t size = 0;
uint32_t err;
uint8_t buf[256];
sha1_context ctx;
- if (get_tpm_nv_size(NV_COMMON_DATA_INDEX, &size) ||
+ if (get_tpm_nv_size(tpm, NV_COMMON_DATA_INDEX, &size) ||
size < NV_COMMON_DATA_MIN_SIZE)
return 1;
- err = tpm_nv_read_value(NV_COMMON_DATA_INDEX,
- buf, min(sizeof(buf), size));
+ err = tpm_nv_read_value(tpm, NV_COMMON_DATA_INDEX,
+ buf, min(sizeof(buf), size));
if (err) {
printf("tpm_nv_read_value() failed: %u\n", err);
return 1;
@@ -235,6 +240,7 @@ static struct h_reg *get_hreg(uint8_t spec)
/**
* @brief get pointer of a hash register by specification and usage.
+ * @param tpm TPM device
* @param spec specification of a hash register
* @param mode access mode (read or write or read/write)
* @return pointer to hash register if found and valid; NULL else.
@@ -244,7 +250,8 @@ static struct h_reg *get_hreg(uint8_t spec)
* The value of automatic registers (PCR register and fixed registers) is
* loaded or computed on read access.
*/
-static struct h_reg *access_hreg(uint8_t spec, enum access_mode mode)
+static struct h_reg *access_hreg(struct udevice *tpm, uint8_t spec,
+ enum access_mode mode)
{
struct h_reg *result;
@@ -261,13 +268,13 @@ static struct h_reg *access_hreg(uint8_t spec, enum access_mode mode)
if (mode & HREG_RD) {
if (!result->valid) {
if (IS_PCR_HREG(spec)) {
- hre_tpm_err = tpm_pcr_read(HREG_IDX(spec),
+ hre_tpm_err = tpm_pcr_read(tpm, HREG_IDX(spec),
result->digest, 20);
result->valid = (hre_tpm_err == TPM_SUCCESS);
} else if (IS_FIX_HREG(spec)) {
switch (HREG_IDX(spec)) {
case FIX_HREG_DEVICE_ID_HASH:
- read_common_data();
+ read_common_data(tpm);
break;
case FIX_HREG_VENDOR:
memcpy(result->digest, vendor, 20);
@@ -337,18 +344,19 @@ static void *compute_extend(void *_dst, const void *_src, size_t n)
return _dst;
}
-static int hre_op_loadkey(struct h_reg *src_reg, struct h_reg *dst_reg,
- const void *key, size_t key_size)
+static int hre_op_loadkey(struct udevice *tpm, struct h_reg *src_reg,
+ struct h_reg *dst_reg, const void *key,
+ size_t key_size)
{
uint32_t parent_handle;
uint32_t key_handle;
if (!src_reg || !dst_reg || !src_reg->valid || !dst_reg->valid)
return -1;
- if (find_key(src_reg->digest, dst_reg->digest, &parent_handle))
+ if (find_key(tpm, src_reg->digest, dst_reg->digest, &parent_handle))
return -1;
- hre_tpm_err = tpm_load_key2_oiap(parent_handle, key, key_size,
- src_reg->digest, &key_handle);
+ hre_tpm_err = tpm_load_key2_oiap(tpm, parent_handle, key, key_size,
+ src_reg->digest, &key_handle);
if (hre_tpm_err) {
hre_err = HRE_E_TPM_FAILURE;
return -1;
@@ -359,11 +367,13 @@ static int hre_op_loadkey(struct h_reg *src_reg, struct h_reg *dst_reg,
/**
* @brief executes the next opcode on the hash register engine.
+ * @param tpm TPM device
* @param[in,out] ip pointer to the opcode (instruction pointer)
* @param[in,out] code_size (remaining) size of the code
* @return new instruction pointer on success, NULL on error.
*/
-static const uint8_t *hre_execute_op(const uint8_t **ip, size_t *code_size)
+static const uint8_t *hre_execute_op(struct udevice *tpm, const uint8_t **ip,
+ size_t *code_size)
{
bool dst_modified = false;
uint32_t ins;
@@ -394,10 +404,11 @@ static const uint8_t *hre_execute_op(const uint8_t **ip, size_t *code_size)
if ((opcode & 0x80) && (data_size + 4) > *code_size)
return NULL;
- src_reg = access_hreg(src_spec, HREG_RD);
+ src_reg = access_hreg(tpm, src_spec, HREG_RD);
if (hre_err || hre_tpm_err)
return NULL;
- dst_reg = access_hreg(dst_spec, (opcode & 0x40) ? HREG_RDWR : HREG_WR);
+ dst_reg = access_hreg(tpm, dst_spec,
+ (opcode & 0x40) ? HREG_RDWR : HREG_WR);
if (hre_err || hre_tpm_err)
return NULL;
@@ -453,7 +464,7 @@ do_bin_func:
dst_modified = true;
break;
case HRE_LOADKEY:
- if (hre_op_loadkey(src_reg, dst_reg, data, data_size))
+ if (hre_op_loadkey(tpm, src_reg, dst_reg, data, data_size))
return NULL;
break;
default:
@@ -461,8 +472,8 @@ do_bin_func:
}
if (dst_reg && dst_modified && IS_PCR_HREG(dst_spec)) {
- hre_tpm_err = tpm_extend(HREG_IDX(dst_spec), dst_reg->digest,
- dst_reg->digest);
+ hre_tpm_err = tpm_extend(tpm, HREG_IDX(dst_spec),
+ dst_reg->digest, dst_reg->digest);
if (hre_tpm_err) {
hre_err = HRE_E_TPM_FAILURE;
return NULL;
@@ -481,11 +492,12 @@ end:
/**
* @brief runs a program on the hash register engine.
+ * @param tpm TPM device
* @param code pointer to the (HRE) code.
* @param code_size size of the code (in bytes).
* @return 0 on success, != 0 on failure.
*/
-int hre_run_program(const uint8_t *code, size_t code_size)
+int hre_run_program(struct udevice *tpm, const uint8_t *code, size_t code_size)
{
size_t code_left;
const uint8_t *ip = code;
@@ -494,7 +506,7 @@ int hre_run_program(const uint8_t *code, size_t code_size)
hre_tpm_err = 0;
hre_err = HRE_E_OK;
while (code_left > 0)
- if (!hre_execute_op(&ip, &code_left))
+ if (!hre_execute_op(tpm, &ip, &code_left))
return -1;
return hre_err;
diff --git a/board/gdsys/a38x/hre.h b/board/gdsys/a38x/hre.h
index b562928a64..da983aa452 100644
--- a/board/gdsys/a38x/hre.h
+++ b/board/gdsys/a38x/hre.h
@@ -32,6 +32,6 @@ enum {
};
int hre_verify_program(struct key_program *prg);
-int hre_run_program(const uint8_t *code, size_t code_size);
+int hre_run_program(struct udevice *tpm, const uint8_t *code, size_t code_size);
#endif /* __HRE_H */
diff --git a/board/gdsys/a38x/keyprogram.c b/board/gdsys/a38x/keyprogram.c
index 1fb5306b50..291edc340d 100644
--- a/board/gdsys/a38x/keyprogram.c
+++ b/board/gdsys/a38x/keyprogram.c
@@ -12,7 +12,7 @@
#include "hre.h"
-int flush_keys(void)
+int flush_keys(struct udevice *tpm)
{
u16 key_count;
u8 buf[288];
@@ -21,13 +21,15 @@ int flush_keys(void)
uint i;
/* fetch list of already loaded keys in the TPM */
- err = tpm_get_capability(TPM_CAP_HANDLE, TPM_RT_KEY, buf, sizeof(buf));
+ err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
+ sizeof(buf));
if (err)
return -1;
key_count = get_unaligned_be16(buf);
ptr = buf + 2;
for (i = 0; i < key_count; ++i, ptr += 4) {
- err = tpm_flush_specific(get_unaligned_be32(ptr), TPM_RT_KEY);
+ err = tpm_flush_specific(tpm, get_unaligned_be32(ptr),
+ TPM_RT_KEY);
if (err && err != TPM_KEY_OWNER_CONTROL)
return err;
}
@@ -121,7 +123,7 @@ struct key_program *parse_and_check_keyprog(u8 *progdata)
return result;
}
-int load_and_run_keyprog(void)
+int load_and_run_keyprog(struct udevice *tpm)
{
char *cmd = NULL;
u8 *binprog = NULL;
@@ -144,7 +146,7 @@ int load_and_run_keyprog(void)
if (!prog)
return 1;
- if (hre_run_program(prog->code, prog->code_size)) {
+ if (hre_run_program(tpm, prog->code, prog->code_size)) {
free(prog);
return 1;
}
diff --git a/board/gdsys/a38x/keyprogram.h b/board/gdsys/a38x/keyprogram.h
index a4877c73a8..06889c67e4 100644
--- a/board/gdsys/a38x/keyprogram.h
+++ b/board/gdsys/a38x/keyprogram.h
@@ -7,7 +7,7 @@
#ifndef __KEYPROGRAM_H
#define __KEYPROGRAM_H
-int load_and_run_keyprog(void);
-int flush_keys(void);
+int load_and_run_keyprog(struct udevice *tpm);
+int flush_keys(struct udevice *tpm);
#endif /* __KEYPROGRAM_H */
diff --git a/board/gdsys/p1022/controlcenterd-id.c b/board/gdsys/p1022/controlcenterd-id.c
index 7e082dff05..6ac956caca 100644
--- a/board/gdsys/p1022/controlcenterd-id.c
+++ b/board/gdsys/p1022/controlcenterd-id.c
@@ -11,6 +11,7 @@
#endif
#include <common.h>
+#include <dm.h>
#include <malloc.h>
#include <fs.h>
#include <i2c.h>
@@ -141,6 +142,19 @@ static int hre_err = HRE_E_OK;
#define IS_VAR_HREG(spec) (((spec) & 0x38) == 0x10)
#define HREG_IDX(spec) ((spec) & (IS_PCR_HREG(spec) ? 0x1f : 0x7))
+static int get_tpm(struct udevice **devp)
+{
+ int rc;
+
+ rc = uclass_first_device_err(UCLASS_TPM, devp);
+ if (rc) {
+ printf("Could not find TPM (ret=%d)\n", rc);
+ return CMD_RET_FAILURE;
+ }
+
+ return 0;
+}
+
static const uint8_t vendor[] = "Guntermann & Drunck";
/**
@@ -245,15 +259,15 @@ static u8 *get_image_location(void)
* @param size pointer to the size
* @return 0 on success, != 0 on error
*/
-static int get_tpm_nv_size(uint32_t index, uint32_t *size)
+static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size)
{
uint32_t err;
uint8_t info[72];
uint8_t *ptr;
uint16_t v16;
- err = tpm_get_capability(TPM_CAP_NV_INDEX, index,
- info, sizeof(info));
+ err = tpm_get_capability(tpm, TPM_CAP_NV_INDEX, index,
+ info, sizeof(info));
if (err) {
printf("tpm_get_capability(CAP_NV_INDEX, %08x) failed: %u\n",
index, err);
@@ -281,8 +295,8 @@ static int get_tpm_nv_size(uint32_t index, uint32_t *size)
* @param[out] handle the handle of the key iff found
* @return 0 if key was found in TPM; != 0 if not.
*/
-static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
- uint32_t *handle)
+static int find_key(struct udevice *tpm, const uint8_t auth[20],
+ const uint8_t pubkey_digest[20], uint32_t *handle)
{
uint16_t key_count;
uint32_t key_handles[10];
@@ -294,7 +308,8 @@ static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
unsigned int i;
/* fetch list of already loaded keys in the TPM */
- err = tpm_get_capability(TPM_CAP_HANDLE, TPM_RT_KEY, buf, sizeof(buf));
+ err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
+ sizeof(buf));
if (err)
return -1;
key_count = get_unaligned_be16(buf);
@@ -305,7 +320,8 @@ static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
/* now search a(/ the) key which we can access with the given auth */
for (i = 0; i < key_count; ++i) {
buf_len = sizeof(buf);
- err = tpm_get_pub_key_oiap(key_handles[i], auth, buf, &buf_len);
+ err = tpm_get_pub_key_oiap(tpm, key_handles[i], auth, buf,
+ &buf_len);
if (err && err != TPM_AUTHFAIL)
return -1;
if (err)
@@ -323,18 +339,18 @@ static int find_key(const uint8_t auth[20], const uint8_t pubkey_digest[20],
* @brief read CCDM common data from TPM NV
* @return 0 if CCDM common data was found and read, !=0 if something failed.
*/
-static int read_common_data(void)
+static int read_common_data(struct udevice *tpm)
{
uint32_t size;
uint32_t err;
uint8_t buf[256];
sha1_context ctx;
- if (get_tpm_nv_size(NV_COMMON_DATA_INDEX, &size) ||
+ if (get_tpm_nv_size(tpm, NV_COMMON_DATA_INDEX, &size) ||
size < NV_COMMON_DATA_MIN_SIZE)
return 1;
- err = tpm_nv_read_value(NV_COMMON_DATA_INDEX,
- buf, min(sizeof(buf), size));
+ err = tpm_nv_read_value(tpm, NV_COMMON_DATA_INDEX,
+ buf, min(sizeof(buf), size));
if (err) {
printf("tpm_nv_read_value() failed: %u\n", err);
return 1;
@@ -467,7 +483,8 @@ static struct h_reg *get_hreg(uint8_t spec)
* The value of automatic registers (PCR register and fixed registers) is
* loaded or computed on read access.
*/
-static struct h_reg *access_hreg(uint8_t spec, enum access_mode mode)
+static struct h_reg *access_hreg(struct udevice *tpm, uint8_t spec,
+ enum access_mode mode)
{
struct h_reg *result;
@@ -484,13 +501,13 @@ static struct h_reg *access_hreg(uint8_t spec, enum access_mode mode)
if (mode & HREG_RD) {
if (!result->valid) {
if (IS_PCR_HREG(spec)) {
- hre_tpm_err = tpm_pcr_read(HREG_IDX(spec),
+ hre_tpm_err = tpm_pcr_read(tpm, HREG_IDX(spec),
result->digest, 20);
result->valid = (hre_tpm_err == TPM_SUCCESS);
} else if (IS_FIX_HREG(spec)) {
switch (HREG_IDX(spec)) {
case FIX_HREG_DEVICE_ID_HASH:
- read_common_data();
+ read_common_data(tpm);
break;
case FIX_HREG_SELF_HASH:
ccdm_compute_self_hash();
@@ -566,18 +583,19 @@ static void *compute_extend(void *_dst, const void *_src, size_t n)
return _dst;
}
-static int hre_op_loadkey(struct h_reg *src_reg, struct h_reg *dst_reg,
- const void *key, size_t key_size)
+static int hre_op_loadkey(struct udevice *tpm, struct h_reg *src_reg,
+ struct h_reg *dst_reg, const void *key,
+ size_t key_size)
{
uint32_t parent_handle;
uint32_t key_handle;
if (!src_reg || !dst_reg || !src_reg->valid || !dst_reg->valid)
return -1;
- if (find_key(src_reg->digest, dst_reg->digest, &parent_handle))
+ if (find_key(tpm, src_reg->digest, dst_reg->digest, &parent_handle))
return -1;
- hre_tpm_err = tpm_load_key2_oiap(parent_handle, key, key_size,
- src_reg->digest, &key_handle);
+ hre_tpm_err = tpm_load_key2_oiap(tpm, parent_handle, key, key_size,
+ src_reg->digest, &key_handle);
if (hre_tpm_err) {
hre_err = HRE_E_TPM_FAILURE;
return -1;
@@ -593,7 +611,8 @@ static int hre_op_loadkey(struct h_reg *src_reg, struct h_reg *dst_reg,
* @param[in,out] code_size (remaining) size of the code
* @return new instruction pointer on success, NULL on error.
*/
-static const uint8_t *hre_execute_op(const uint8_t **ip, size_t *code_size)
+static const uint8_t *hre_execute_op(struct udevice *tpm, const uint8_t **ip,
+ size_t *code_size)
{
bool dst_modified = false;
uint32_t ins;
@@ -624,10 +643,11 @@ static const uint8_t *hre_execute_op(const uint8_t **ip, size_t *code_size)
if ((opcode & 0x80) && (data_size + 4) > *code_size)
return NULL;
- src_reg = access_hreg(src_spec, HREG_RD);
+ src_reg = access_hreg(tpm, src_spec, HREG_RD);
if (hre_err || hre_tpm_err)
return NULL;
- dst_reg = access_hreg(dst_spec, (opcode & 0x40) ? HREG_RDWR : HREG_WR);
+ dst_reg = access_hreg(tpm, dst_spec,
+ (opcode & 0x40) ? HREG_RDWR : HREG_WR);
if (hre_err || hre_tpm_err)
return NULL;
@@ -683,7 +703,7 @@ do_bin_func:
dst_modified = true;
break;
case HRE_LOADKEY:
- if (hre_op_loadkey(src_reg, dst_reg, data, data_size))
+ if (hre_op_loadkey(tpm, src_reg, dst_reg, data, data_size))
return NULL;
break;
default:
@@ -691,8 +711,8 @@ do_bin_func:
}
if (dst_reg && dst_modified && IS_PCR_HREG(dst_spec)) {
- hre_tpm_err = tpm_extend(HREG_IDX(dst_spec), dst_reg->digest,
- dst_reg->digest);
+ hre_tpm_err = tpm_extend(tpm, HREG_IDX(dst_spec),
+ dst_reg->digest, dst_reg->digest);
if (hre_tpm_err) {
hre_err = HRE_E_TPM_FAILURE;
return NULL;
@@ -715,7 +735,8 @@ end:
* @param code_size size of the code (in bytes).
* @return 0 on success, != 0 on failure.
*/
-static int hre_run_program(const uint8_t *code, size_t code_size)
+static int hre_run_program(struct udevice *tpm, const uint8_t *code,
+ size_t code_size)
{
size_t code_left;
const uint8_t *ip = code;
@@ -724,7 +745,7 @@ static int hre_run_program(const uint8_t *code, size_t code_size)
hre_tpm_err = 0;
hre_err = HRE_E_OK;
while (code_left > 0)
- if (!hre_execute_op(&ip, &code_left))
+ if (!hre_execute_op(tpm, &ip, &code_left))
return -1;
return hre_err;
@@ -929,26 +950,27 @@ static const uint8_t prg_stage1_prepare[] = {
0x81, 0x2e, 0x30, 0x00, /* opcode: LOAD PCR3, f3 */
};
-static int first_stage_actions(void)
+static int first_stage_actions(struct udevice *tpm)
{
int result = 0;
struct key_program *sd_prg = NULL;
puts("CCDM S1: start actions\n");
#ifndef CCDM_SECOND_STAGE
- if (tpm_continue_self_test())
+ if (tpm_continue_self_test(tpm))
goto failure;
#else
- tpm_continue_self_test();
+ tpm_continue_self_test(tpm);
#endif
mdelay(37);
- if (hre_run_program(prg_stage1_prepare, sizeof(prg_stage1_prepare)))
+ if (hre_run_program(tpm, prg_stage1_prepare,
+ sizeof(prg_stage1_prepare)))
goto failure;
sd_prg = load_sd_key_program();
if (sd_prg) {
- if (hre_run_program(sd_prg->code, sd_prg->code_size))
+ if (hre_run_program(tpm, sd_prg->code, sd_prg->code_size))
goto failure;
puts("SD code run successfully\n");
} else {
@@ -969,19 +991,22 @@ end:
#ifdef CCDM_FIRST_STAGE
static int first_stage_init(void)
{
- int res = 0;
+ struct udevice *tpm;
+ int ret;
+
puts("CCDM S1\n");
- if (tpm_init() || tpm_startup(TPM_ST_CLEAR))
+ ret = get_tpm(&tpm);
+ if (ret || tpm_init(tpm) || tpm_startup(tpm, TPM_ST_CLEAR))
return 1;
- res = first_stage_actions();
+ ret = first_stage_actions(tpm);
#ifndef CCDM_SECOND_STAGE
- if (!res) {
+ if (!ret) {
if (bl2_entry)
(*bl2_entry)();
- res = 1;
+ ret = 1;
}
#endif
- return res;
+ return ret;
}
#endif
@@ -1021,24 +1046,28 @@ static int second_stage_init(void)
char *mac_path = NULL;
ulong image_addr;
loff_t image_size;
+ struct udevice *tpm;
uint32_t err;
+ int ret;
printf("CCDM S2\n");
- if (tpm_init())
+ ret = get_tpm(&tpm);
+ if (ret || tpm_init(tpm))
return 1;
- err = tpm_startup(TPM_ST_CLEAR);
+ err = tpm_startup(tpm, TPM_ST_CLEAR);
if (err != TPM_INVALID_POSTINIT)
did_first_stage_run = false;
#ifdef CCDM_AUTO_FIRST_STAGE
- if (!did_first_stage_run && first_stage_actions())
+ if (!did_first_stage_run && first_stage_actions(tpm))
goto failure;
#else
if (!did_first_stage_run)
goto failure;
#endif
- if (hre_run_program(prg_stage2_prepare, sizeof(prg_stage2_prepare)))
+ if (hre_run_program(tpm, prg_stage2_prepare,
+ sizeof(prg_stage2_prepare)))
goto failure;
/* run "prepboot" from env to get "mmcdev" set */
@@ -1083,12 +1112,12 @@ static int second_stage_init(void)
}
puts("CCDM image OK\n");
- hre_run_program(prg_stage2_success, sizeof(prg_stage2_success));
+ hre_run_program(tpm, prg_stage2_success, sizeof(prg_stage2_success));
goto end;
failure:
result = 1;
- hre_run_program(prg_stage_fail, sizeof(prg_stage_fail));
+ hre_run_program(tpm, prg_stage_fail, sizeof(prg_stage_fail));
end:
if (hmac_blob)
free(hmac_blob);
diff --git a/board/grinn/chiliboard/board.c b/board/grinn/chiliboard/board.c
index 73a7d8281c..dc0de620fc 100644
--- a/board/grinn/chiliboard/board.c
+++ b/board/grinn/chiliboard/board.c
@@ -19,7 +19,6 @@
#include <environment.h>
#include <errno.h>
#include <miiphy.h>
-#include <serial.h>
#include <spl.h>
#include <watchdog.h>
@@ -69,13 +68,6 @@ static void enable_board_pin_mux(void)
}
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
-#ifndef CONFIG_DM_SERIAL
-struct serial_device *default_serial_console(void)
-{
- return &eserial1_device;
-}
-#endif
-
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
void set_uart_mux_conf(void)
{
@@ -150,56 +142,3 @@ int board_late_init(void)
return 0;
}
#endif
-
-#if !defined(CONFIG_DM_ETH) && defined(CONFIG_DRIVER_TI_CPSW) && \
- !defined(CONFIG_SPL_BUILD)
-static void cpsw_control(int enabled)
-{
- /* VTP can be added here */
-
- return;
-}
-
-static struct cpsw_slave_data cpsw_slaves[] = {
- {
- .slave_reg_ofs = 0x208,
- .sliver_reg_ofs = 0xd80,
- .phy_addr = 0,
- }
-};
-
-static struct cpsw_platform_data cpsw_data = {
- .mdio_base = CPSW_MDIO_BASE,
- .cpsw_base = CPSW_BASE,
- .mdio_div = 0xff,
- .channels = 8,
- .cpdma_reg_ofs = 0x800,
- .slaves = 1,
- .slave_data = cpsw_slaves,
- .ale_reg_ofs = 0xd00,
- .ale_entries = 1024,
- .host_port_reg_ofs = 0x108,
- .hw_stats_reg_ofs = 0x900,
- .bd_ram_ofs = 0x2000,
- .mac_control = (1 << 5),
- .control = cpsw_control,
- .host_port_num = 0,
- .version = CPSW_CTRL_VERSION_2,
-};
-
-int board_eth_init(bd_t *bis)
-{
- int rv, n = 0;
-
- writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
- cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
-
- rv = cpsw_register(&cpsw_data);
- if (rv < 0)
- printf("Error %d registering CPSW switch\n", rv);
- else
- n += rv;
-
- return n;
-}
-#endif
diff --git a/board/mediatek/mt7623/Kconfig b/board/mediatek/mt7623/Kconfig
new file mode 100644
index 0000000000..a8c670e71f
--- /dev/null
+++ b/board/mediatek/mt7623/Kconfig
@@ -0,0 +1,13 @@
+if TARGET_MT7623
+
+config SYS_BOARD
+ default "mt7623"
+
+config SYS_CONFIG_NAME
+ default "mt7623"
+
+config MTK_BROM_HEADER_INFO
+ string
+ default "lk=1"
+
+endif
diff --git a/board/mediatek/mt7623/MAINTAINERS b/board/mediatek/mt7623/MAINTAINERS
new file mode 100644
index 0000000000..eeb0375d70
--- /dev/null
+++ b/board/mediatek/mt7623/MAINTAINERS
@@ -0,0 +1,7 @@
+MT7623
+M: Ryder Lee <ryder.lee@mediatek.com>
+M: Weijie Gao <weijie.gao@mediatek.com>
+S: Maintained
+F: board/mediatek/mt7623
+F: include/configs/mt7623.h
+F: configs/mt7623n_bpir2_defconfig
diff --git a/board/mediatek/mt7623/Makefile b/board/mediatek/mt7623/Makefile
new file mode 100644
index 0000000000..2b42071c47
--- /dev/null
+++ b/board/mediatek/mt7623/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-y += mt7623_rfb.o
diff --git a/board/mediatek/mt7623/mt7623_rfb.c b/board/mediatek/mt7623/mt7623_rfb.c
new file mode 100644
index 0000000000..08468b50ea
--- /dev/null
+++ b/board/mediatek/mt7623/mt7623_rfb.c
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018 MediaTek Inc.
+ */
+
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+ /* address of boot parameters */
+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+ return 0;
+}
diff --git a/board/mediatek/mt7629/Kconfig b/board/mediatek/mt7629/Kconfig
new file mode 100644
index 0000000000..6055164b52
--- /dev/null
+++ b/board/mediatek/mt7629/Kconfig
@@ -0,0 +1,17 @@
+if TARGET_MT7629
+
+config SYS_BOARD
+ default "mt7629"
+
+config SYS_CONFIG_NAME
+ default "mt7629"
+
+config MTK_SPL_PAD_SIZE
+ hex
+ default 0x10000
+
+config MTK_BROM_HEADER_INFO
+ string
+ default "media=nor"
+
+endif
diff --git a/board/mediatek/mt7629/MAINTAINERS b/board/mediatek/mt7629/MAINTAINERS
new file mode 100644
index 0000000000..424f115167
--- /dev/null
+++ b/board/mediatek/mt7629/MAINTAINERS
@@ -0,0 +1,7 @@
+MT7629
+M: Ryder Lee <ryder.lee@mediatek.com>
+M: Weijie Gao <weijie.gao@mediatek.com>
+S: Maintained
+F: board/mediatek/mt7629
+F: include/configs/mt7629.h
+F: configs/mt7629_rfb_defconfig
diff --git a/board/mediatek/mt7629/Makefile b/board/mediatek/mt7629/Makefile
new file mode 100644
index 0000000000..83ccbba8c4
--- /dev/null
+++ b/board/mediatek/mt7629/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-y += mt7629_rfb.o
diff --git a/board/mediatek/mt7629/mt7629_rfb.c b/board/mediatek/mt7629/mt7629_rfb.c
new file mode 100644
index 0000000000..08468b50ea
--- /dev/null
+++ b/board/mediatek/mt7629/mt7629_rfb.c
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018 MediaTek Inc.
+ */
+
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+ /* address of boot parameters */
+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+ return 0;
+}
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 649127c5bf..153a1fdcb7 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -68,14 +68,7 @@ struct msg_get_clock_rate {
#endif
/*
- * http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/
- * http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=32733
- * http://git.drogon.net/?p=wiringPi;a=blob;f=wiringPi/wiringPi.c;h=503151f61014418b9c42f4476a6086f75cd4e64b;hb=refs/heads/master#l922
- *
- * In http://lists.denx.de/pipermail/u-boot/2016-January/243752.html
- * ("[U-Boot] [PATCH] rpi: fix up Model B entries") Dom Cobley at the RPi
- * Foundation stated that the following source was accurate:
- * https://github.com/AndrewFromMelbourne/raspberry_pi_revision
+ * https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
*/
struct rpi_model {
const char *name;
@@ -145,6 +138,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {
DTB_DIR "bcm2837-rpi-3-b-plus.dtb",
true,
},
+ [0xE] = {
+ "3 Model A+",
+ DTB_DIR "bcm2837-rpi-3-a-plus.dtb",
+ false,
+ },
};
static const struct rpi_model rpi_models_old_scheme[] = {
diff --git a/board/sandbox/README.sandbox b/board/sandbox/README.sandbox
index 0f59da4400..9b09404294 100644
--- a/board/sandbox/README.sandbox
+++ b/board/sandbox/README.sandbox
@@ -422,7 +422,19 @@ coverage in U-Boot is limited, as we need to work to improve it.
Note that many of these tests are implemented as commands which you can
run natively on your board if desired (and enabled).
-It would be useful to have a central script to run all of these.
+To run all tests use "make check".
+
+
+Memory Map
+----------
+
+Sandbox has its own emulated memory starting at 0. Here are some of the things
+that are mapped into that memory:
+
+ 0 CONFIG_SYS_FDT_LOAD_ADDR Device tree
+ e000 CONFIG_BLOBLIST_ADDR Blob list
+ 10000 CONFIG_MALLOC_F_ADDR Early memory allocation
+
--
Simon Glass <sjg@chromium.org>
diff --git a/board/synopsys/axs10x/axs10x.c b/board/synopsys/axs10x/axs10x.c
index c95f7af7a7..ffa7c154b5 100644
--- a/board/synopsys/axs10x/axs10x.c
+++ b/board/synopsys/axs10x/axs10x.c
@@ -109,3 +109,11 @@ void smp_kick_all_cpus(void)
writel(cmd, (void __iomem *)AXC003_CREG_CPU_START);
}
#endif
+
+int checkboard(void)
+{
+ printf("Board: ARC Software Development Platform AXS%s\n",
+ is_isa_arcv2() ? "103" : "101");
+
+ return 0;
+};
diff --git a/board/synopsys/emsdp/emsdp.c b/board/synopsys/emsdp/emsdp.c
index b5ec7f17ec..c0770b58c1 100644
--- a/board/synopsys/emsdp/emsdp.c
+++ b/board/synopsys/emsdp/emsdp.c
@@ -7,10 +7,46 @@
#include <dwmmc.h>
#include <malloc.h>
+#include <asm/arcregs.h>
+
DECLARE_GLOBAL_DATA_PTR;
-#define ARC_PERIPHERAL_BASE 0xF0000000
-#define SDIO_BASE (ARC_PERIPHERAL_BASE + 0x10000)
+#define ARC_PERIPHERAL_BASE 0xF0000000
+
+#define CGU_ARC_FMEAS_ARC (void *)(ARC_PERIPHERAL_BASE + 0x84)
+#define CGU_ARC_FMEAS_ARC_START BIT(31)
+#define CGU_ARC_FMEAS_ARC_DONE BIT(30)
+#define CGU_ARC_FMEAS_ARC_CNT_MASK GENMASK(14, 0)
+#define CGU_ARC_FMEAS_ARC_RCNT_OFFSET 0
+#define CGU_ARC_FMEAS_ARC_FCNT_OFFSET 15
+
+#define SDIO_BASE (void *)(ARC_PERIPHERAL_BASE + 0x10000)
+
+int mach_cpu_init(void)
+{
+ int rcnt, fcnt;
+ u32 data;
+
+ /* Start frequency measurement */
+ writel(CGU_ARC_FMEAS_ARC_START, CGU_ARC_FMEAS_ARC);
+
+ /* Poll DONE bit */
+ do {
+ data = readl(CGU_ARC_FMEAS_ARC);
+ } while (!(data & CGU_ARC_FMEAS_ARC_DONE));
+
+ /* Amount of reference 100 MHz clocks */
+ rcnt = ((data >> CGU_ARC_FMEAS_ARC_RCNT_OFFSET) &
+ CGU_ARC_FMEAS_ARC_CNT_MASK);
+
+ /* Amount of CPU clocks */
+ fcnt = ((data >> CGU_ARC_FMEAS_ARC_FCNT_OFFSET) &
+ CGU_ARC_FMEAS_ARC_CNT_MASK);
+
+ gd->cpu_clk = ((100 * fcnt) / rcnt) * 1000000;
+
+ return 0;
+}
int board_mmc_init(bd_t *bis)
{
@@ -24,7 +60,7 @@ int board_mmc_init(bd_t *bis)
memset(host, 0, sizeof(struct dwmci_host));
host->name = "Synopsys Mobile storage";
- host->ioaddr = (void *)SDIO_BASE;
+ host->ioaddr = SDIO_BASE;
host->buswidth = 4;
host->dev_index = 0;
host->bus_hz = 50000000;
@@ -42,31 +78,32 @@ int board_mmc_getcd(struct mmc *mmc)
}
#define CREG_BASE 0xF0001000
-#define CREG_BOOT_OFFSET 0
-#define CREG_BOOT_WP_OFFSET 8
+#define CREG_BOOT (void *)(CREG_BASE + 0x0FF0)
+#define CREG_IP_SW_RESET (void *)(CREG_BASE + 0x0FF0)
+#define CREG_IP_VERSION (void *)(CREG_BASE + 0x0FF8)
-#define CGU_BASE 0xF0000000
-#define CGU_IP_SW_RESET 0x0FF0
+/* Bits in CREG_BOOT register */
+#define CREG_BOOT_WP_BIT BIT(8)
void reset_cpu(ulong addr)
{
- writel(1, (u32 *)(CGU_BASE + CGU_IP_SW_RESET));
+ writel(1, CREG_IP_SW_RESET);
while (1)
; /* loop forever till reset */
}
static int do_emsdp_rom(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
- u32 creg_boot = readl((u32 *)(CREG_BASE + CREG_BOOT_OFFSET));
+ u32 creg_boot = readl(CREG_BOOT);
if (!strcmp(argv[1], "unlock"))
- creg_boot &= ~BIT(CREG_BOOT_WP_OFFSET);
+ creg_boot &= ~CREG_BOOT_WP_BIT;
else if (!strcmp(argv[1], "lock"))
- creg_boot |= BIT(CREG_BOOT_WP_OFFSET);
+ creg_boot |= CREG_BOOT_WP_BIT;
else
return CMD_RET_USAGE;
- writel(creg_boot, (u32 *)(CREG_BASE + CREG_BOOT_OFFSET));
+ writel(creg_boot, CREG_BOOT);
return CMD_RET_SUCCESS;
}
@@ -97,3 +134,12 @@ U_BOOT_CMD(
"rom unlock - Unlock non-volatile memory for writing\n"
"emsdp rom lock - Lock non-volatile memory to prevent writing\n"
);
+
+int checkboard(void)
+{
+ int version = readl(CREG_IP_VERSION);
+
+ printf("Board: ARC EM Software Development Platform v%d.%d\n",
+ (version >> 16) & 0xff, version & 0xff);
+ return 0;
+};
diff --git a/board/synopsys/hsdk/hsdk.c b/board/synopsys/hsdk/hsdk.c
index b6aefdbe6d..8a2c201477 100644
--- a/board/synopsys/hsdk/hsdk.c
+++ b/board/synopsys/hsdk/hsdk.c
@@ -1054,10 +1054,8 @@ int board_mmc_init(bd_t *bis)
return 0;
}
-#ifdef CONFIG_DISPLAY_CPUINFO
-int print_cpuinfo(void)
+int checkboard(void)
{
- printf("CPU: ARC HS38 v2.1c\n");
+ puts("Board: Synopsys ARC HS Development Kit\n");
return 0;
-}
-#endif /* CONFIG_DISPLAY_CPUINFO */
+};
diff --git a/board/synopsys/iot_devkit/iot_devkit.c b/board/synopsys/iot_devkit/iot_devkit.c
index f8838fb3ce..8424e09bd3 100644
--- a/board/synopsys/iot_devkit/iot_devkit.c
+++ b/board/synopsys/iot_devkit/iot_devkit.c
@@ -189,13 +189,3 @@ int checkboard(void)
puts("Board: Synopsys IoT Development Kit\n");
return 0;
};
-
-#ifdef CONFIG_DISPLAY_CPUINFO
-int print_cpuinfo(void)
-{
- char mhz[8];
-
- printf("CPU: ARC EM9D at %s MHz\n", strmhz(mhz, gd->cpu_clk));
- return 0;
-}
-#endif /* CONFIG_DISPLAY_CPUINFO */
diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c
index df0a2d2b7a..c5949ad267 100644
--- a/board/vscom/baltos/board.c
+++ b/board/vscom/baltos/board.c
@@ -27,7 +27,6 @@
#include <i2c.h>
#include <miiphy.h>
#include <cpsw.h>
-#include <power/tps65217.h>
#include <power/tps65910.h>
#include <environment.h>
#include <watchdog.h>
@@ -35,8 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
-/* GPIO that controls power to DDR on EVM-SK */
-#define GPIO_DDR_VTT_EN 7
+/* GPIO that controls DIP switch and mPCIe slot */
#define DIP_S1 44
#define MPCIE_SW 100
@@ -248,9 +246,6 @@ const struct ctrl_ioregs ioregs_baltos = {
void sdram_init(void)
{
- gpio_request(GPIO_DDR_VTT_EN, "ddr_vtt_en");
- gpio_direction_output(GPIO_DDR_VTT_EN, 1);
-
config_ddr(400, &ioregs_baltos,
&ddr3_baltos_data,
&ddr3_baltos_cmd_ctrl_data,
diff --git a/board/vscom/baltos/mux.c b/board/vscom/baltos/mux.c
index 94410ae35e..9c5542ea02 100644
--- a/board/vscom/baltos/mux.c
+++ b/board/vscom/baltos/mux.c
@@ -34,7 +34,6 @@ static struct module_pin_mux mmc0_pin_mux[] = {
{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */
{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */
{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */
- //{OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */
{-1},
};
@@ -46,11 +45,6 @@ static struct module_pin_mux i2c1_pin_mux[] = {
{-1},
};
-static struct module_pin_mux gpio0_7_pin_mux[] = {
- {OFFSET(ecap0_in_pwm0_out), (MODE(7) | PULLUDEN)}, /* GPIO0_7 */
- {-1},
-};
-
static struct module_pin_mux rmii1_pin_mux[] = {
{OFFSET(mii1_crs), MODE(1) | RXACTIVE}, /* RGMII1_TCTL */
{OFFSET(mii1_txen), MODE(1)}, /* RGMII1_TCTL */
@@ -114,7 +108,6 @@ void enable_i2c1_pin_mux(void)
void enable_board_pin_mux()
{
configure_module_pin_mux(i2c1_pin_mux);
- configure_module_pin_mux(gpio0_7_pin_mux);
configure_module_pin_mux(rgmii2_pin_mux);
configure_module_pin_mux(rmii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);