Merge tag 'u-boot-amlogic-20210112' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic
- sync amlogic GX & AXG DT to Linux 5.10 - Add new MESON_EE driver support for GXBB & AXG - Add support for Libretech-CC v2, Wetek Core2, Beelink GT-King/Pro boards - add driver for TDO tl070wsh30 panel driver - meson: isolate loading of socinfo - Add soc_rev to environment - Enable G12A support for saradc - Add correct mmcdev on VIM3(L) & Odroid-N2(C4) - Read MAC from fuses for VIM3 & VIM3L boards
This commit is contained in:
9
board/amlogic/beelink-s922x/MAINTAINERS
Normal file
9
board/amlogic/beelink-s922x/MAINTAINERS
Normal file
@@ -0,0 +1,9 @@
|
||||
BEELINK-S922X
|
||||
M: Christian Hewitt <christianshewitt@gmail.com>
|
||||
S: Maintained
|
||||
L: u-boot-amlogic@groups.io
|
||||
F: board/amlogic/beelink-s922x/
|
||||
F: configs/beelink-gtking_defconfig
|
||||
F: configs/beelink-gtkingpro_defconfig
|
||||
F: doc/board/amlogic/beelink-gtking.rst
|
||||
F: doc/board/amlogic/beelink-gtkingpro.rst
|
||||
6
board/amlogic/beelink-s922x/Makefile
Normal file
6
board/amlogic/beelink-s922x/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2020 BayLibre, SAS
|
||||
# Author: Neil Armstrong <narmstrong@baylibre.com>
|
||||
|
||||
obj-y := beelink-s922x.o
|
||||
54
board/amlogic/beelink-s922x/beelink-s922x.c
Normal file
54
board/amlogic/beelink-s922x/beelink-s922x.c
Normal file
@@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2020 BayLibre, SAS
|
||||
* Author: Neil Armstrong <narmstrong@baylibre.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <env.h>
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sm.h>
|
||||
#include <asm/arch/eth.h>
|
||||
#include <asm/arch/boot.h>
|
||||
|
||||
#define EFUSE_MAC_OFFSET 20
|
||||
#define EFUSE_MAC_SIZE 12
|
||||
#define MAC_ADDR_LEN 6
|
||||
|
||||
int misc_init_r(void)
|
||||
{
|
||||
u8 mac_addr[MAC_ADDR_LEN];
|
||||
char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3];
|
||||
ssize_t len;
|
||||
|
||||
if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) &&
|
||||
meson_get_soc_rev(tmp, sizeof(tmp)) > 0)
|
||||
env_set("soc_rev", tmp);
|
||||
|
||||
meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
|
||||
|
||||
if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
|
||||
len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
|
||||
efuse_mac_addr, EFUSE_MAC_SIZE);
|
||||
if (len != EFUSE_MAC_SIZE)
|
||||
return 0;
|
||||
|
||||
/* MAC is stored in ASCII format, 1bytes = 2characters */
|
||||
for (int i = 0; i < 6; i++) {
|
||||
tmp[0] = efuse_mac_addr[i * 2];
|
||||
tmp[1] = efuse_mac_addr[i * 2 + 1];
|
||||
tmp[2] = '\0';
|
||||
mac_addr[i] = simple_strtoul(tmp, NULL, 16);
|
||||
}
|
||||
|
||||
if (is_valid_ethaddr(mac_addr))
|
||||
eth_env_set_enetaddr("ethaddr", mac_addr);
|
||||
else
|
||||
meson_generate_serial_ethaddr();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -10,19 +10,32 @@
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/boot.h>
|
||||
#include <asm/arch/sm.h>
|
||||
#include <asm/arch/eth.h>
|
||||
#include <asm/arch/boot.h>
|
||||
|
||||
#define EFUSE_MAC_OFFSET 20
|
||||
#define EFUSE_MAC_SIZE 12
|
||||
#define MAC_ADDR_LEN 6
|
||||
|
||||
int mmc_get_env_dev(void)
|
||||
{
|
||||
if (meson_get_boot_device() == BOOT_DEVICE_EMMC)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int misc_init_r(void)
|
||||
{
|
||||
u8 mac_addr[MAC_ADDR_LEN];
|
||||
char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3];
|
||||
ssize_t len;
|
||||
|
||||
if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) &&
|
||||
meson_get_soc_rev(tmp, sizeof(tmp)) > 0)
|
||||
env_set("soc_rev", tmp);
|
||||
|
||||
meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
|
||||
|
||||
if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ F: include/configs/p212.h
|
||||
F: configs/khadas-vim_defconfig
|
||||
F: configs/libretech-ac_defconfig
|
||||
F: configs/libretech-cc_defconfig
|
||||
F: configs/libretech-cc_v2_defconfig
|
||||
F: configs/p212_defconfig
|
||||
F: doc/board/amlogic/p212.rst
|
||||
F: doc/board/amlogic/libretech-ac.rst
|
||||
|
||||
@@ -7,4 +7,6 @@ F: include/configs/q200.h
|
||||
F: configs/khadas-vim2_defconfig
|
||||
F: configs/libretech-s905d-pc_defconfig
|
||||
F: configs/libretech-s912-pc_defconfig
|
||||
F: configs/wetek-core2_defconfig
|
||||
F: doc/board/amlogic/khadas-vim2.rst
|
||||
F: doc/board/amlogic/wetek-core2.rst
|
||||
|
||||
@@ -10,10 +10,19 @@
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/boot.h>
|
||||
#include <asm/arch/eth.h>
|
||||
#include <asm/arch/sm.h>
|
||||
#include <i2c.h>
|
||||
#include "khadas-mcu.h"
|
||||
|
||||
int mmc_get_env_dev(void)
|
||||
{
|
||||
if (meson_get_boot_device() == BOOT_DEVICE_EMMC)
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential
|
||||
* lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between
|
||||
@@ -129,9 +138,39 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define EFUSE_MAC_OFFSET 0
|
||||
#define EFUSE_MAC_SIZE 12
|
||||
#define MAC_ADDR_LEN 6
|
||||
|
||||
int misc_init_r(void)
|
||||
{
|
||||
u8 mac_addr[MAC_ADDR_LEN];
|
||||
char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3];
|
||||
ssize_t len;
|
||||
|
||||
meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
|
||||
|
||||
if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
|
||||
len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
|
||||
efuse_mac_addr, EFUSE_MAC_SIZE);
|
||||
if (len != EFUSE_MAC_SIZE)
|
||||
return 0;
|
||||
|
||||
/* MAC is stored in ASCII format, 1bytes = 2characters */
|
||||
for (int i = 0; i < 6; i++) {
|
||||
tmp[0] = efuse_mac_addr[i * 2];
|
||||
tmp[1] = efuse_mac_addr[i * 2 + 1];
|
||||
tmp[2] = '\0';
|
||||
mac_addr[i] = simple_strtoul(tmp, NULL, 16);
|
||||
}
|
||||
|
||||
if (is_valid_ethaddr(mac_addr))
|
||||
eth_env_set_enetaddr("ethaddr", mac_addr);
|
||||
else
|
||||
meson_generate_serial_ethaddr();
|
||||
|
||||
eth_env_get_enetaddr("ethaddr", mac_addr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user