mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-22 20:46:29 +00:00
Add board support (#2687)
* Initial commit of Home Assistant Green board support * Add Home Assistant Green boot files * HA Green board configs * board/nabucasa: Unsupport rtc rk808 * Use odroid-m1 as Supervisor machine for now * Green: linux: pmic: set set PWRON_LP_OFF_TIME 12s * green: Update U-Boot to 2023.07.02 * green: supports usb boot * green: uboot-boot.ush use rk3566-ha-green.dtb * green: spinor supports uboot * green: use U-Boot provided devtype as boot device type * green: Fix polarity of power key The power key is low active. Add patch to avoid accidential long press being reported to user space. * green: uboot: eeprom: add CONFIG_ENV_OVERWRITE * green: uboot: eerprom: add mac read * green: fix-cpufreq null issue * green: board aliases ethernet0 * green: uboot mac set ethernet0 * green: uboot add serial-number read * green: Update kernel 6.1.39 * green: add green to the build matrix * green: fix 339d13 & 9b9416 can not boot from usb * green: changfe sd mode, change led default state * green: uboot add board.c to read eeprom info * green: enable uboot to read eeprom info * green: delete boot.scr read eeprom function * green: change spl loader uboot order:sd-emmc-spi_nor * green: serialnum change to 18 bytes * green: Update kernel 6.1.43 * green: use hwrng support from ODROID-M1 * green: Use latest Rockchip BL31/DDR binaries * change led_act polarity * green: Disable watchdog The watchdog on Green seems to not reliably reset the system. For now disable the driver to avoid systemd making use of it. * green: Update kernel 6.1.44 * green: Fix Supervisor Machine Use odroid-m1 for now as Supervisor machine (used to download the landing page). * green: emmc use hs200 to increase speed * green: use green as Supervisor machine * green: Update kernel 6.1.45 * green: add Green to the kernel documentation --------- Co-authored-by: Zhangqun Ming <north_sea@qq.com> Co-authored-by: syan <syan.cham@gmail.com>
This commit is contained in:
parent
425fc31190
commit
b5fdd0e0e2
6
.github/workflows/matrix.json
vendored
6
.github/workflows/matrix.json
vendored
@ -89,6 +89,12 @@
|
||||
"architecture": "aarch64",
|
||||
"label": "board/yellow"
|
||||
},
|
||||
{
|
||||
"id": "green",
|
||||
"defconfig": "green",
|
||||
"architecture": "aarch64",
|
||||
"label": "board/green"
|
||||
},
|
||||
{
|
||||
"id": "tinker",
|
||||
"defconfig": "tinker",
|
||||
|
@ -12,6 +12,7 @@ Default Kernel tree: 6.1
|
||||
| Raspberry Pi 3 | 6.1.21 |
|
||||
| Raspberry Pi 4 | 6.1.21 |
|
||||
| Home Assistant Yellow | 6.1.21 |
|
||||
| Home Assistant Green | 6.1.45 |
|
||||
| Tinker Board | 6.1.45 |
|
||||
| ODROID-C2 | 6.1.45 |
|
||||
| ODROID-C4 | 6.1.45 |
|
||||
|
0
buildroot-external/board/nabucasa/green/cmdline.txt
Normal file
0
buildroot-external/board/nabucasa/green/cmdline.txt
Normal file
25
buildroot-external/board/nabucasa/green/hassos-hook.sh
Normal file
25
buildroot-external/board/nabucasa/green/hassos-hook.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2155
|
||||
|
||||
function hassos_pre_image() {
|
||||
local BOOT_DATA="$(path_boot_dir)"
|
||||
local SPL_IMG="$(path_spl_img)"
|
||||
|
||||
cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
|
||||
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
|
||||
|
||||
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
|
||||
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
|
||||
|
||||
# SPL
|
||||
create_spl_image
|
||||
|
||||
dd if="${BINARIES_DIR}/idbloader.img" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
|
||||
dd if="${BINARIES_DIR}/u-boot.itb" of="${SPL_IMG}" conv=notrunc bs=512 seek=16384
|
||||
}
|
||||
|
||||
|
||||
function hassos_post_image() {
|
||||
convert_disk_image_xz
|
||||
}
|
||||
|
14
buildroot-external/board/nabucasa/green/kernel.config
Normal file
14
buildroot-external/board/nabucasa/green/kernel.config
Normal file
@ -0,0 +1,14 @@
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
|
||||
CONFIG_THERMAL_GOV_BANG_BANG=y
|
||||
CONFIG_SENSORS_GPIO_FAN=y
|
||||
|
||||
CONFIG_KEYBOARD_GPIO=y
|
||||
CONFIG_KEYBOARD_GPIO_POLLED=y
|
||||
|
||||
CONFIG_MMC_SDHCI_OF_DWCMSHC=y
|
||||
|
||||
CONFIG_REGULATOR_RK808=y
|
||||
CONFIG_REGULATOR_RK860X=y
|
||||
|
||||
# CONFIG_DW_WATCHDOG is not set
|
12
buildroot-external/board/nabucasa/green/meta
Normal file
12
buildroot-external/board/nabucasa/green/meta
Normal file
@ -0,0 +1,12 @@
|
||||
BOARD_ID=green
|
||||
BOARD_NAME="Home Assistant Green"
|
||||
CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=gpt
|
||||
BOOT_SIZE=16M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=16M
|
||||
BOOT_ENV_SIZE=0x8000
|
||||
SUPERVISOR_MACHINE=green
|
||||
SUPERVISOR_ARCH=aarch64
|
@ -0,0 +1,662 @@
|
||||
From b7957b94fe2649a1e8032b10ea293b106cda4532 Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Thu, 6 Jul 2023 10:04:39 +0000
|
||||
Subject: [PATCH 1/2] drivers: regulator: Supports rk860x
|
||||
|
||||
---
|
||||
drivers/regulator/Kconfig | 11 +
|
||||
drivers/regulator/Makefile | 1 +
|
||||
drivers/regulator/rk860x-regulator.c | 607 +++++++++++++++++++++++++++
|
||||
3 files changed, 619 insertions(+)
|
||||
create mode 100644 drivers/regulator/rk860x-regulator.c
|
||||
|
||||
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
|
||||
index 070e4403c..6a3c00c24 100644
|
||||
--- a/drivers/regulator/Kconfig
|
||||
+++ b/drivers/regulator/Kconfig
|
||||
@@ -1047,6 +1047,17 @@ config REGULATOR_RK808
|
||||
through regulator interface. The device supports multiple DCDC/LDO
|
||||
outputs which can be controlled by i2c communication.
|
||||
|
||||
+config REGULATOR_RK860X
|
||||
+ tristate "Rockchip RK860X Regulator"
|
||||
+ depends on I2C
|
||||
+ select REGMAP_I2C
|
||||
+ help
|
||||
+ This driver supports Rockchip RK860X Digitally Programmable
|
||||
+ Buck Regulator. The RK860X is a step-down switching voltage
|
||||
+ regulator that delivers a digitally programmable output from an
|
||||
+ input voltage supply of 2.5V to 5.5V. The output voltage is
|
||||
+ programmed through an I2C interface.
|
||||
+
|
||||
config REGULATOR_RN5T618
|
||||
tristate "Ricoh RN5T567/618 voltage regulators"
|
||||
depends on MFD_RN5T618
|
||||
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
|
||||
index 5962307e1..76a156e98 100644
|
||||
--- a/drivers/regulator/Makefile
|
||||
+++ b/drivers/regulator/Makefile
|
||||
@@ -125,6 +125,7 @@ obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY) += rpi-panel-attiny-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o
|
||||
+obj-$(CONFIG_REGULATOR_RK860X) += rk860x-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_RN5T618) += rn5t618-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_ROHM) += rohm-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_RT4801) += rt4801-regulator.o
|
||||
diff --git a/drivers/regulator/rk860x-regulator.c b/drivers/regulator/rk860x-regulator.c
|
||||
new file mode 100644
|
||||
index 000000000..4596761bd
|
||||
--- /dev/null
|
||||
+++ b/drivers/regulator/rk860x-regulator.c
|
||||
@@ -0,0 +1,607 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2021 Fuzhou Rockchip Electronics Co., Ltd
|
||||
+ */
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <linux/of_gpio.h>
|
||||
+#include <linux/param.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regmap.h>
|
||||
+#include <linux/regulator/driver.h>
|
||||
+#include <linux/regulator/machine.h>
|
||||
+#include <linux/regulator/of_regulator.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+/* Voltage setting */
|
||||
+
|
||||
+#define RK860X_VSEL0_A 0x00
|
||||
+#define RK860X_VSEL1_A 0x01
|
||||
+#define RK860X_VSEL0_B 0x06
|
||||
+#define RK860X_VSEL1_B 0x07
|
||||
+#define RK860X_MAX_SET 0x08
|
||||
+
|
||||
+/* Control register */
|
||||
+#define RK860X_CONTROL 0x02
|
||||
+/* IC Type */
|
||||
+#define RK860X_ID1 0x03
|
||||
+/* IC mask version */
|
||||
+#define RK860X_ID2 0x04
|
||||
+/* Monitor register */
|
||||
+#define RK860X_MONITOR 0x05
|
||||
+
|
||||
+/* VSEL bit definitions */
|
||||
+#define VSEL_BUCK_EN BIT(7)
|
||||
+#define VSEL_MODE BIT(6)
|
||||
+#define VSEL_A_NSEL_MASK 0x3F
|
||||
+#define VSEL_B_NSEL_MASK 0xff
|
||||
+
|
||||
+/* Chip ID */
|
||||
+#define DIE_ID 0x0f
|
||||
+#define DIE_REV 0x0f
|
||||
+/* Control bit definitions */
|
||||
+#define CTL_OUTPUT_DISCHG BIT(7)
|
||||
+#define CTL_SLEW_MASK (0x7 << 4)
|
||||
+#define CTL_SLEW_SHIFT 4
|
||||
+#define CTL_RESET BIT(2)
|
||||
+
|
||||
+#define RK860X_NVOLTAGES_64 64
|
||||
+#define RK860X_NVOLTAGES_160 160
|
||||
+
|
||||
+/* IC Type */
|
||||
+enum {
|
||||
+ RK860X_CHIP_ID_00 = 0,
|
||||
+ RK860X_CHIP_ID_01,
|
||||
+ RK860X_CHIP_ID_02,
|
||||
+ RK860X_CHIP_ID_03,
|
||||
+};
|
||||
+
|
||||
+struct rk860x_platform_data {
|
||||
+ struct regulator_init_data *regulator;
|
||||
+ unsigned int slew_rate;
|
||||
+ /* Sleep VSEL ID */
|
||||
+ unsigned int sleep_vsel_id;
|
||||
+ int limit_volt;
|
||||
+ struct gpio_desc *vsel_gpio;
|
||||
+};
|
||||
+
|
||||
+struct rk860x_device_info {
|
||||
+ struct regmap *regmap;
|
||||
+ struct device *dev;
|
||||
+ struct regulator_desc desc;
|
||||
+ struct regulator_dev *rdev;
|
||||
+ struct regulator_init_data *regulator;
|
||||
+ /* IC Type and Rev */
|
||||
+ int chip_id;
|
||||
+ /* Voltage setting register */
|
||||
+ unsigned int vol_reg;
|
||||
+ unsigned int sleep_reg;
|
||||
+ unsigned int en_reg;
|
||||
+ unsigned int sleep_en_reg;
|
||||
+ unsigned int mode_reg;
|
||||
+ unsigned int vol_mask;
|
||||
+ unsigned int mode_mask;
|
||||
+ unsigned int slew_reg;
|
||||
+ unsigned int slew_mask;
|
||||
+ unsigned int slew_shift;
|
||||
+ /* Voltage range and step(linear) */
|
||||
+ unsigned int vsel_min;
|
||||
+ unsigned int vsel_step;
|
||||
+ unsigned int n_voltages;
|
||||
+ /* Voltage slew rate limiting */
|
||||
+ unsigned int slew_rate;
|
||||
+ struct gpio_desc *vsel_gpio;
|
||||
+ unsigned int sleep_vsel_id;
|
||||
+};
|
||||
+
|
||||
+static unsigned int rk860x_map_mode(unsigned int mode)
|
||||
+{
|
||||
+ return mode == REGULATOR_MODE_FAST ?
|
||||
+ REGULATOR_MODE_FAST : REGULATOR_MODE_NORMAL;
|
||||
+}
|
||||
+
|
||||
+static int rk860x_get_voltage(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, RK860X_MAX_SET, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ ret = regulator_get_voltage_sel_regmap(rdev);
|
||||
+ if (ret > val)
|
||||
+ return val;
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int rk860x_set_suspend_voltage(struct regulator_dev *rdev, int uV)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = regulator_map_voltage_linear(rdev, uV, uV);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ ret = regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ di->vol_mask, ret);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int rk860x_set_suspend_enable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->sleep_en_reg,
|
||||
+ VSEL_BUCK_EN, VSEL_BUCK_EN);
|
||||
+}
|
||||
+
|
||||
+static int rk860x_set_suspend_disable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->sleep_en_reg,
|
||||
+ VSEL_BUCK_EN, 0);
|
||||
+}
|
||||
+
|
||||
+static int rk860x_resume(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!rdev->constraints->state_mem.changeable)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = rk860x_set_suspend_enable(rdev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return regulator_suspend_enable(rdev, PM_SUSPEND_MEM);
|
||||
+}
|
||||
+
|
||||
+static int rk860x_set_enable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ gpiod_set_raw_value(di->vsel_gpio, !di->sleep_vsel_id);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->en_reg,
|
||||
+ VSEL_BUCK_EN, VSEL_BUCK_EN);
|
||||
+}
|
||||
+
|
||||
+static int rk860x_set_disable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ gpiod_set_raw_value(di->vsel_gpio, di->sleep_vsel_id);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->en_reg,
|
||||
+ VSEL_BUCK_EN, 0);
|
||||
+}
|
||||
+
|
||||
+static int rk860x_is_enabled(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ if (di->sleep_vsel_id)
|
||||
+ return !gpiod_get_raw_value(di->vsel_gpio);
|
||||
+ else
|
||||
+ return gpiod_get_raw_value(di->vsel_gpio);
|
||||
+ }
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, di->en_reg, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (val & VSEL_BUCK_EN)
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int rk860x_set_mode(struct regulator_dev *rdev, unsigned int mode)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ switch (mode) {
|
||||
+ case REGULATOR_MODE_FAST:
|
||||
+ regmap_update_bits(di->regmap, di->mode_reg,
|
||||
+ di->mode_mask, di->mode_mask);
|
||||
+ break;
|
||||
+ case REGULATOR_MODE_NORMAL:
|
||||
+ regmap_update_bits(di->regmap, di->mode_reg, di->mode_mask, 0);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static unsigned int rk860x_get_mode(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, di->mode_reg, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (val & di->mode_mask)
|
||||
+ return REGULATOR_MODE_FAST;
|
||||
+ else
|
||||
+ return REGULATOR_MODE_NORMAL;
|
||||
+}
|
||||
+
|
||||
+static const int slew_rates[] = {
|
||||
+ 64000,
|
||||
+ 32000,
|
||||
+ 16000,
|
||||
+ 8000,
|
||||
+ 4000,
|
||||
+ 2000,
|
||||
+ 1000,
|
||||
+ 500,
|
||||
+};
|
||||
+
|
||||
+static int rk860x_set_ramp(struct regulator_dev *rdev, int ramp)
|
||||
+{
|
||||
+ struct rk860x_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ int regval = -1, i;
|
||||
+ const int *slew_rate_t;
|
||||
+ int slew_rate_n;
|
||||
+
|
||||
+ slew_rate_t = slew_rates;
|
||||
+ slew_rate_n = ARRAY_SIZE(slew_rates);
|
||||
+
|
||||
+ for (i = 0; i < slew_rate_n; i++) {
|
||||
+ if (ramp <= slew_rate_t[i])
|
||||
+ regval = i;
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (regval < 0) {
|
||||
+ dev_err(di->dev, "unsupported ramp value %d\n", ramp);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->slew_reg,
|
||||
+ di->slew_mask, regval << di->slew_shift);
|
||||
+}
|
||||
+
|
||||
+static const struct regulator_ops rk860x_regulator_ops = {
|
||||
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
|
||||
+ .get_voltage_sel = rk860x_get_voltage,
|
||||
+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
|
||||
+ .map_voltage = regulator_map_voltage_linear,
|
||||
+ .list_voltage = regulator_list_voltage_linear,
|
||||
+ .set_suspend_voltage = rk860x_set_suspend_voltage,
|
||||
+ .enable = rk860x_set_enable,
|
||||
+ .disable = rk860x_set_disable,
|
||||
+ .is_enabled = rk860x_is_enabled,
|
||||
+ .set_mode = rk860x_set_mode,
|
||||
+ .get_mode = rk860x_get_mode,
|
||||
+ .set_ramp_delay = rk860x_set_ramp,
|
||||
+ .set_suspend_enable = rk860x_set_suspend_enable,
|
||||
+ .set_suspend_disable = rk860x_set_suspend_disable,
|
||||
+ .resume = rk860x_resume,
|
||||
+};
|
||||
+
|
||||
+/* For 00,01 options:
|
||||
+ * VOUT = 0.7125V + NSELx * 12.5mV, from 0.7125 to 1.5V.
|
||||
+ * For 02,03 options:
|
||||
+ * VOUT = 0.5V + NSELx * 6.25mV, from 0.5 to 1.5V.
|
||||
+ */
|
||||
+static int rk860x_device_setup(struct rk860x_device_info *di,
|
||||
+ struct rk860x_platform_data *pdata)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ u32 val = 0;
|
||||
+
|
||||
+ switch (di->chip_id) {
|
||||
+ case RK860X_CHIP_ID_00:
|
||||
+ case RK860X_CHIP_ID_01:
|
||||
+ di->vsel_min = 712500;
|
||||
+ di->vsel_step = 12500;
|
||||
+ di->n_voltages = RK860X_NVOLTAGES_64;
|
||||
+ di->vol_mask = VSEL_A_NSEL_MASK;
|
||||
+ if (di->sleep_vsel_id) {
|
||||
+ di->sleep_reg = RK860X_VSEL1_A;
|
||||
+ di->vol_reg = RK860X_VSEL0_A;
|
||||
+ di->mode_reg = RK860X_VSEL0_A;
|
||||
+ di->en_reg = RK860X_VSEL0_A;
|
||||
+ di->sleep_en_reg = RK860X_VSEL1_A;
|
||||
+ } else {
|
||||
+ di->sleep_reg = RK860X_VSEL0_A;
|
||||
+ di->vol_reg = RK860X_VSEL1_A;
|
||||
+ di->mode_reg = RK860X_VSEL1_A;
|
||||
+ di->en_reg = RK860X_VSEL1_A;
|
||||
+ di->sleep_en_reg = RK860X_VSEL0_A;
|
||||
+ }
|
||||
+ break;
|
||||
+ case RK860X_CHIP_ID_02:
|
||||
+ case RK860X_CHIP_ID_03:
|
||||
+ di->vsel_min = 500000;
|
||||
+ di->vsel_step = 6250;
|
||||
+ di->n_voltages = RK860X_NVOLTAGES_160;
|
||||
+ di->vol_mask = VSEL_B_NSEL_MASK;
|
||||
+ if (di->sleep_vsel_id) {
|
||||
+ di->sleep_reg = RK860X_VSEL1_B;
|
||||
+ di->vol_reg = RK860X_VSEL0_B;
|
||||
+ di->mode_reg = RK860X_VSEL0_A;
|
||||
+ di->en_reg = RK860X_VSEL0_A;
|
||||
+ di->sleep_en_reg = RK860X_VSEL1_A;
|
||||
+ } else {
|
||||
+ di->sleep_reg = RK860X_VSEL0_B;
|
||||
+ di->vol_reg = RK860X_VSEL1_B;
|
||||
+ di->mode_reg = RK860X_VSEL1_A;
|
||||
+ di->en_reg = RK860X_VSEL1_A;
|
||||
+ di->sleep_en_reg = RK860X_VSEL0_A;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_err(di->dev, "Chip ID %d not supported!\n", di->chip_id);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ di->mode_mask = VSEL_MODE;
|
||||
+ di->slew_reg = RK860X_CONTROL;
|
||||
+ di->slew_mask = CTL_SLEW_MASK;
|
||||
+ di->slew_shift = CTL_SLEW_SHIFT;
|
||||
+
|
||||
+ if (pdata->limit_volt) {
|
||||
+ if (pdata->limit_volt < di->vsel_min ||
|
||||
+ pdata->limit_volt > 1500000)
|
||||
+ pdata->limit_volt = 1500000;
|
||||
+ val = (pdata->limit_volt - di->vsel_min) / di->vsel_step;
|
||||
+ ret = regmap_write(di->regmap, RK860X_MAX_SET, val);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(di->dev, "Failed to set limit voltage!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int rk860x_regulator_register(struct rk860x_device_info *di,
|
||||
+ struct regulator_config *config)
|
||||
+{
|
||||
+ struct regulator_desc *rdesc = &di->desc;
|
||||
+
|
||||
+ rdesc->name = "rk860x-reg";
|
||||
+ rdesc->supply_name = "vin";
|
||||
+ rdesc->ops = &rk860x_regulator_ops;
|
||||
+ rdesc->type = REGULATOR_VOLTAGE;
|
||||
+ rdesc->n_voltages = di->n_voltages;
|
||||
+ rdesc->enable_reg = di->en_reg;
|
||||
+ rdesc->enable_mask = VSEL_BUCK_EN;
|
||||
+ rdesc->min_uV = di->vsel_min;
|
||||
+ rdesc->uV_step = di->vsel_step;
|
||||
+ rdesc->vsel_reg = di->vol_reg;
|
||||
+ rdesc->vsel_mask = di->vol_mask;
|
||||
+ rdesc->owner = THIS_MODULE;
|
||||
+ rdesc->enable_time = 400;
|
||||
+
|
||||
+ di->rdev = devm_regulator_register(di->dev, &di->desc, config);
|
||||
+ return PTR_ERR_OR_ZERO(di->rdev);
|
||||
+}
|
||||
+
|
||||
+static const struct regmap_config rk860x_regmap_config = {
|
||||
+ .reg_bits = 8,
|
||||
+ .val_bits = 8,
|
||||
+};
|
||||
+
|
||||
+static struct rk860x_platform_data *
|
||||
+rk860x_parse_dt(struct device *dev, struct device_node *np,
|
||||
+ const struct regulator_desc *desc)
|
||||
+{
|
||||
+ struct rk860x_platform_data *pdata;
|
||||
+ int ret, flag, limit_volt;
|
||||
+ u32 tmp;
|
||||
+
|
||||
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
||||
+ if (!pdata)
|
||||
+ return NULL;
|
||||
+
|
||||
+ pdata->regulator = of_get_regulator_init_data(dev, np, desc);
|
||||
+ pdata->regulator->constraints.initial_state = PM_SUSPEND_MEM;
|
||||
+
|
||||
+ if (!(of_property_read_u32(np, "limit-microvolt", &limit_volt)))
|
||||
+ pdata->limit_volt = limit_volt;
|
||||
+
|
||||
+ ret = of_property_read_u32(np, "rockchip,suspend-voltage-selector",
|
||||
+ &tmp);
|
||||
+ if (!ret)
|
||||
+ pdata->sleep_vsel_id = tmp;
|
||||
+
|
||||
+ if (pdata->sleep_vsel_id)
|
||||
+ flag = GPIOD_OUT_LOW;
|
||||
+ else
|
||||
+ flag = GPIOD_OUT_HIGH;
|
||||
+
|
||||
+ pdata->vsel_gpio = devm_gpiod_get_index_optional(dev, "vsel", 0, flag);
|
||||
+ if (IS_ERR(pdata->vsel_gpio)) {
|
||||
+ ret = PTR_ERR(pdata->vsel_gpio);
|
||||
+ dev_err(dev, "failed to get vesl gpio (%d)\n", ret);
|
||||
+ pdata->vsel_gpio = NULL;
|
||||
+ }
|
||||
+
|
||||
+ return pdata;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id rk860x_dt_ids[] = {
|
||||
+ {
|
||||
+ .compatible = "rockchip,rk8600",
|
||||
+ .data = (void *)RK860X_CHIP_ID_00
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "rockchip,rk8601",
|
||||
+ .data = (void *)RK860X_CHIP_ID_01
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "rockchip,rk8602",
|
||||
+ .data = (void *)RK860X_CHIP_ID_02
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "rockchip,rk8603",
|
||||
+ .data = (void *)RK860X_CHIP_ID_03
|
||||
+ },
|
||||
+
|
||||
+ { }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, rk860x_dt_ids);
|
||||
+
|
||||
+static int rk860x_regulator_probe(struct i2c_client *client,
|
||||
+ const struct i2c_device_id *id)
|
||||
+{
|
||||
+ struct device_node *np = client->dev.of_node;
|
||||
+ struct rk860x_device_info *di;
|
||||
+ struct rk860x_platform_data *pdata;
|
||||
+ struct regulator_config config = { };
|
||||
+ unsigned int val;
|
||||
+ int ret;
|
||||
+
|
||||
+ di = devm_kzalloc(&client->dev, sizeof(*di), GFP_KERNEL);
|
||||
+ if (!di)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ di->desc.of_map_mode = rk860x_map_mode;
|
||||
+
|
||||
+ pdata = dev_get_platdata(&client->dev);
|
||||
+ if (!pdata)
|
||||
+ pdata = rk860x_parse_dt(&client->dev, np, &di->desc);
|
||||
+
|
||||
+ if (!pdata || !pdata->regulator) {
|
||||
+ dev_err(&client->dev, "Platform data not found!\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ di->vsel_gpio = pdata->vsel_gpio;
|
||||
+ di->sleep_vsel_id = pdata->sleep_vsel_id;
|
||||
+
|
||||
+ di->regulator = pdata->regulator;
|
||||
+ if (client->dev.of_node) {
|
||||
+ di->chip_id =
|
||||
+ (unsigned long)of_device_get_match_data(&client->dev);
|
||||
+ } else {
|
||||
+ /* if no ramp constraint set, get the pdata ramp_delay */
|
||||
+ if (!di->regulator->constraints.ramp_delay) {
|
||||
+ int slew_idx = (pdata->slew_rate & 0x7)
|
||||
+ ? pdata->slew_rate : 0;
|
||||
+
|
||||
+ di->regulator->constraints.ramp_delay =
|
||||
+ slew_rates[slew_idx];
|
||||
+ }
|
||||
+ di->chip_id = id->driver_data;
|
||||
+ }
|
||||
+
|
||||
+ di->regmap = devm_regmap_init_i2c(client, &rk860x_regmap_config);
|
||||
+ if (IS_ERR(di->regmap)) {
|
||||
+ dev_err(&client->dev, "Failed to allocate regmap!\n");
|
||||
+ return PTR_ERR(di->regmap);
|
||||
+ }
|
||||
+ di->dev = &client->dev;
|
||||
+ i2c_set_clientdata(client, di);
|
||||
+ /* Get chip ID */
|
||||
+ ret = regmap_read(di->regmap, RK860X_ID1, &val);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to get chip ID!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ switch (di->chip_id) {
|
||||
+ case RK860X_CHIP_ID_00:
|
||||
+ case RK860X_CHIP_ID_01:
|
||||
+ if ((val & DIE_ID) != 0x8) {
|
||||
+ dev_err(&client->dev, "Failed to match chip ID!\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ break;
|
||||
+ case RK860X_CHIP_ID_02:
|
||||
+ case RK860X_CHIP_ID_03:
|
||||
+ if ((val & DIE_ID) != 0xa) {
|
||||
+ dev_err(&client->dev, "Failed to match chip ID!\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ /* Device init */
|
||||
+ ret = rk860x_device_setup(di, pdata);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to setup device!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ /* Register regulator */
|
||||
+ config.dev = di->dev;
|
||||
+ config.init_data = di->regulator;
|
||||
+ config.regmap = di->regmap;
|
||||
+ config.driver_data = di;
|
||||
+ config.of_node = np;
|
||||
+
|
||||
+ ret = rk860x_regulator_register(di, &config);
|
||||
+ if (ret < 0)
|
||||
+ dev_err(&client->dev, "Failed to register regulator!\n");
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void rk860x_regulator_shutdown(struct i2c_client *client)
|
||||
+{
|
||||
+ struct rk860x_device_info *di;
|
||||
+ int ret;
|
||||
+
|
||||
+ di = i2c_get_clientdata(client);
|
||||
+
|
||||
+ dev_info(di->dev, "rk860..... reset\n");
|
||||
+
|
||||
+ ret = regmap_update_bits(di->regmap, di->slew_reg,
|
||||
+ CTL_RESET, CTL_RESET);
|
||||
+
|
||||
+ if (ret < 0)
|
||||
+ dev_err(di->dev, "force rk860x_reset error! ret=%d\n", ret);
|
||||
+ else
|
||||
+ dev_info(di->dev, "force rk860x_reset ok!\n");
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_device_id rk860x_id[] = {
|
||||
+ { .name = "rk8600", .driver_data = RK860X_CHIP_ID_00 },
|
||||
+ { .name = "rk8601", .driver_data = RK860X_CHIP_ID_01 },
|
||||
+ { .name = "rk8602", .driver_data = RK860X_CHIP_ID_02 },
|
||||
+ { .name = "rk8603", .driver_data = RK860X_CHIP_ID_03 },
|
||||
+ {},
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(i2c, rk860x_id);
|
||||
+
|
||||
+static struct i2c_driver rk860x_regulator_driver = {
|
||||
+ .driver = {
|
||||
+ .name = "rk860-regulator",
|
||||
+ .of_match_table = of_match_ptr(rk860x_dt_ids),
|
||||
+ },
|
||||
+ .probe = rk860x_regulator_probe,
|
||||
+ .shutdown = rk860x_regulator_shutdown,
|
||||
+ .id_table = rk860x_id,
|
||||
+};
|
||||
+
|
||||
+module_i2c_driver(rk860x_regulator_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Elaine Zhang <zhangqing@rock-chips.com>");
|
||||
+MODULE_DESCRIPTION("rk860x regulator driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,714 @@
|
||||
From 2a76efca88402072b61e4cb83d6707400da8dfae Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Thu, 6 Jul 2023 10:05:04 +0000
|
||||
Subject: [PATCH 2/2] arm64: dts: rockchip: Add NabuCasa Green board
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
||||
.../boot/dts/rockchip/rk3566-ha-green.dts | 685 ++++++++++++++++++
|
||||
2 files changed, 686 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
||||
index 8c15593c0..997051975 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
||||
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
||||
@@ -72,3 +72,4 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-soquartz-cm4.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bpi-r2-pro.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb
|
||||
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-ha-green.dtb
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts b/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
new file mode 100644
|
||||
index 000000000..d0830df48
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
@@ -0,0 +1,685 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2023 Seeed Co., Ltd.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+#include <dt-bindings/pinctrl/rockchip.h>
|
||||
+#include <dt-bindings/soc/rockchip,vop2.h>
|
||||
+#include "rk3566.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Home Assistant Green";
|
||||
+ compatible = "rockchip,rk3566-ha-green", "rockchip,rk3566";
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet0 = &gmac1;
|
||||
+ mmc0 = &sdhci;
|
||||
+ mmc1 = &sdmmc0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial2:1500000n8";
|
||||
+ };
|
||||
+
|
||||
+ dc_12v: dc-12v-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "dc_12v";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <12000000>;
|
||||
+ regulator-max-microvolt = <12000000>;
|
||||
+ };
|
||||
+
|
||||
+ hdmi-con {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led_power: led-0 {
|
||||
+ gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_POWER;
|
||||
+ color = <LED_COLOR_ID_RED>;
|
||||
+ default-state = "keep";
|
||||
+ linux,default-trigger = "default-on";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_power_pin>;
|
||||
+ };
|
||||
+ led_act: led-1 {
|
||||
+ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_ACTIVITY;
|
||||
+ color = <LED_COLOR_ID_GREEN>;
|
||||
+ linux,default-trigger = "activity";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_act_pin>;
|
||||
+ };
|
||||
+ led_user: led-2 {
|
||||
+ gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_HEARTBEAT;
|
||||
+ color = <LED_COLOR_ID_YELLOW>;
|
||||
+ linux,default-trigger = "heartbeat";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_usr_pin>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk809-sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "Analog RK817";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,mclk-fs = <256>;
|
||||
+ simple-audio-card,widgets =
|
||||
+ "Headphone", "Headphones",
|
||||
+ "Speaker", "Speaker";
|
||||
+ simple-audio-card,routing =
|
||||
+ "Headphones", "HPOL",
|
||||
+ "Headphones", "HPOR",
|
||||
+ "Speaker", "SPKO";
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s1_8ch>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&rk809>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_sys: vcc3v3-sys-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+ vcc5v0_sys: vcc5v0-sys-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc5v0_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+ vcc5v0_usb_host: vcc5v0-usb-host-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc5v0_usb_host";
|
||||
+ enable-active-high;
|
||||
+ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&vcc5v0_usb_host_en_pin>;
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ vin-supply = <&vcc5v0_sys>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu1 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu2 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu3 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&gmac1 {
|
||||
+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
|
||||
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
|
||||
+ assigned-clock-rates = <0>, <125000000>;
|
||||
+ clock_in_out = "output";
|
||||
+
|
||||
+ snps,reset-gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
|
||||
+ snps,reset-active-low;
|
||||
+ /* Reset time is 20ms, 100ms for rtl8211f */
|
||||
+ snps,reset-delays-us = <0 20000 100000>;
|
||||
+
|
||||
+ phy-handle = <&rgmii_phy1>;
|
||||
+ phy-mode = "rgmii";
|
||||
+
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac1m0_miim
|
||||
+ &gmac1m0_tx_bus2
|
||||
+ &gmac1m0_rx_bus2
|
||||
+ &gmac1m0_rgmii_clk
|
||||
+ &gmac1m0_rgmii_bus>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ tx_delay = <0x47>;
|
||||
+ rx_delay = <0x27>;
|
||||
+};
|
||||
+
|
||||
+&gpu {
|
||||
+ mali-supply = <&vdd_gpu>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ avdd-0v9-supply = <&vdda0v9_image>;
|
||||
+ avdd-1v8-supply = <&vcca1v8_image>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_in {
|
||||
+ hdmi_in_vp0: endpoint {
|
||||
+ remote-endpoint = <&vp0_out_hdmi>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi_sound {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c0 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdd_cpu: rk8601@41 {
|
||||
+ compatible = "rockchip,rk8601";
|
||||
+ reg = <0x41>;
|
||||
+ vin-supply = <&vcc5v0_sys>;
|
||||
+ regulator-compatible = "rk860x-reg";
|
||||
+ regulator-name = "vdd_cpu";
|
||||
+ regulator-min-microvolt = <712500>;
|
||||
+ regulator-max-microvolt = <1500000>;
|
||||
+ regulator-ramp-delay = <2300>;
|
||||
+ rockchip,suspend-voltage-selector = <1>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk809: pmic@20 {
|
||||
+ compatible = "rockchip,rk809";
|
||||
+ reg = <0x20>;
|
||||
+ interrupt-parent = <&gpio0>;
|
||||
+ interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
|
||||
+ assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
|
||||
+ #clock-cells = <1>;
|
||||
+ clock-names = "mclk";
|
||||
+ clocks = <&cru I2S1_MCLKOUT_TX>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pmic_int_l>, <&i2s1m0_mclk>;
|
||||
+
|
||||
+ rockchip,system-power-controller;
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ wakeup-source;
|
||||
+
|
||||
+ vcc1-supply = <&vcc3v3_sys>;
|
||||
+ vcc2-supply = <&vcc3v3_sys>;
|
||||
+ vcc3-supply = <&vcc3v3_sys>;
|
||||
+ vcc4-supply = <&vcc3v3_sys>;
|
||||
+ vcc5-supply = <&vcc3v3_sys>;
|
||||
+ vcc6-supply = <&vcc3v3_sys>;
|
||||
+ vcc7-supply = <&vcc3v3_sys>;
|
||||
+ vcc8-supply = <&vcc3v3_sys>;
|
||||
+ vcc9-supply = <&vcc3v3_sys>;
|
||||
+
|
||||
+ regulators {
|
||||
+ vdd_logic: DCDC_REG1 {
|
||||
+ regulator-name = "vdd_logic";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-init-microvolt = <900000>;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_gpu: DCDC_REG2 {
|
||||
+ regulator-name = "vdd_gpu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-init-microvolt = <900000>;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_ddr: DCDC_REG3 {
|
||||
+ regulator-name = "vcc_ddr";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_npu: DCDC_REG4 {
|
||||
+ regulator-name = "vdd_npu";
|
||||
+ regulator-init-microvolt = <900000>;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_1v8: DCDC_REG5 {
|
||||
+ regulator-name = "vcc_1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda0v9_image: LDO_REG1 {
|
||||
+ regulator-name = "vdda0v9_image";
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda_0v9: LDO_REG2 {
|
||||
+ regulator-name = "vdda_0v9";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda0v9_pmu: LDO_REG3 {
|
||||
+ regulator-name = "vdda0v9_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <900000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_acodec: LDO_REG4 {
|
||||
+ regulator-name = "vccio_acodec";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_sd: LDO_REG5 {
|
||||
+ regulator-name = "vccio_sd";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_pmu: LDO_REG6 {
|
||||
+ regulator-name = "vcc3v3_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca_1v8: LDO_REG7 {
|
||||
+ regulator-name = "vcca_1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca1v8_pmu: LDO_REG8 {
|
||||
+ regulator-name = "vcca1v8_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <1800000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca1v8_image: LDO_REG9 {
|
||||
+ regulator-name = "vcca1v8_image";
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_3v3: SWITCH_REG1 {
|
||||
+ regulator-name = "vcc_3v3";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_sd: SWITCH_REG2 {
|
||||
+ regulator-name = "vcc3v3_sd";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c1 {
|
||||
+ clock-frequency = <400000>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ rtc: rtc@51 {
|
||||
+ compatible = "nxp,pcf8563";
|
||||
+ reg = <0x51>;
|
||||
+ #clock-cells = <0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s0_8ch {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s1_8ch {
|
||||
+ rockchip,trcm-sync-tx-only;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio1 {
|
||||
+ rgmii_phy1: ethernet-phy@0 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <0x0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ fspi {
|
||||
+ fspi_dual_io_pins: fspi-dual-io-pins {
|
||||
+ rockchip,pins =
|
||||
+ /* fspi_clk */
|
||||
+ <1 RK_PD0 1 &pcfg_pull_none>,
|
||||
+ /* fspi_cs0n */
|
||||
+ <1 RK_PD3 1 &pcfg_pull_none>,
|
||||
+ /* fspi_d0 */
|
||||
+ <1 RK_PD1 1 &pcfg_pull_none>,
|
||||
+ /* fspi_d1 */
|
||||
+ <1 RK_PD2 1 &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ ethernet {
|
||||
+ eth_phy_rst: eth_phy_rst {
|
||||
+ rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ led_power_pin: led-power-pin {
|
||||
+ rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ led_act_pin: led-act-pin {
|
||||
+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ led_usr_pin: led-user-pin {
|
||||
+ rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pmic {
|
||||
+ pmic_int_l: pmic-int-l {
|
||||
+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ usb {
|
||||
+ vcc5v0_usb_host_en_pin: vcc5v0-usb-host-en-pin {
|
||||
+ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pmu_io_domains {
|
||||
+ pmuio1-supply = <&vcc3v3_pmu>;
|
||||
+ pmuio2-supply = <&vcc3v3_pmu>;
|
||||
+ vccio1-supply = <&vccio_acodec>;
|
||||
+ vccio2-supply = <&vcc_1v8>;
|
||||
+ vccio3-supply = <&vccio_sd>;
|
||||
+ vccio4-supply = <&vcc_1v8>; /* float */
|
||||
+ vccio5-supply = <&vcc_1v8>;
|
||||
+ vccio6-supply = <&vcc_1v8>;
|
||||
+ vccio7-supply = <&vcc_3v3>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&saradc {
|
||||
+ vref-supply = <&vcca_1v8>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdhci {
|
||||
+ bus-width = <8>;
|
||||
+ max-frequency = <200000000>;
|
||||
+ non-removable;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe &emmc_rstnout>;
|
||||
+ vmmc-supply = <&vcc_3v3>;
|
||||
+ vqmmc-supply = <&vcc_1v8>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdmmc0 {
|
||||
+ bus-width = <4>;
|
||||
+ cap-sd-highspeed;
|
||||
+ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
|
||||
+ disable-wp;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
|
||||
+ sd-uhs-sdr104;
|
||||
+ vmmc-supply = <&vcc3v3_sd>;
|
||||
+ vqmmc-supply = <&vccio_sd>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sfc {
|
||||
+ /* Dual I/O mode as the D2 pin conflicts with the eMMC */
|
||||
+ pinctrl-0 = <&fspi_dual_io_pins>;
|
||||
+ pinctrl-names = "default";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ flash@0 {
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <100000000>;
|
||||
+ spi-rx-bus-width = <4>;
|
||||
+ spi-tx-bus-width = <1>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "SPL";
|
||||
+ reg = <0x0 0xe0000>;
|
||||
+ };
|
||||
+ partition@e0000 {
|
||||
+ label = "U-Boot Env";
|
||||
+ reg = <0xe0000 0x20000>;
|
||||
+ };
|
||||
+ partition@100000 {
|
||||
+ label = "U-Boot";
|
||||
+ reg = <0x100000 0x200000>;
|
||||
+ };
|
||||
+ partition@300000 {
|
||||
+ label = "splash";
|
||||
+ reg = <0x300000 0x100000>;
|
||||
+ };
|
||||
+ partition@400000 {
|
||||
+ label = "Filesystem";
|
||||
+ reg = <0x400000 0xc00000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&tsadc {
|
||||
+ rockchip,hw-tshut-mode = <1>;
|
||||
+ rockchip,hw-tshut-polarity = <0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host0_ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host0_ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host0_xhci {
|
||||
+ dr_mode = "host";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_xhci {
|
||||
+ status = "okay";
|
||||
+ phys = <&usb2phy0_host>;
|
||||
+ phy-names = "usb2-phy";
|
||||
+ snps,dis_u2_susphy_quirk;
|
||||
+ extcon = <&usb2phy0>;
|
||||
+ maximum-speed = "high-speed";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0_host {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0_otg {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy1_host {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy1_otg {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vop {
|
||||
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
|
||||
+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vop_mmu {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vp0 {
|
||||
+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
|
||||
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
|
||||
+ remote-endpoint = <&hdmi_in_vp0>;
|
||||
+ };
|
||||
+};
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,41 @@
|
||||
From e86272fa8063a047a55a9548400a95742f1c2d2a Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Wed, 12 Jul 2023 02:33:03 +0000
|
||||
Subject: [PATCH] drivers: mfd: rk808: set PWRON_LP_OFF_TIME 12s
|
||||
|
||||
---
|
||||
drivers/mfd/rk808.c | 1 +
|
||||
include/linux/mfd/rk808.h | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
|
||||
index e00da7c7e..ae3c99809 100644
|
||||
--- a/drivers/mfd/rk808.c
|
||||
+++ b/drivers/mfd/rk808.c
|
||||
@@ -300,6 +300,7 @@ static const struct rk808_reg_data rk817_pre_init_reg[] = {
|
||||
{RK817_GPIO_INT_CFG, RK817_INT_POL_MSK, RK817_INT_POL_L},
|
||||
{RK817_SYS_CFG(1), RK817_HOTDIE_TEMP_MSK | RK817_TSD_TEMP_MSK,
|
||||
RK817_HOTDIE_105 | RK817_TSD_140},
|
||||
+ {RK817_PMIC_PWRON_KEY, RK817_PMIC_PWRON_KEY_MSK, RK817_PWRON_LP_OFF_TIME},
|
||||
};
|
||||
|
||||
static const struct rk808_reg_data rk818_pre_init_reg[] = {
|
||||
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
|
||||
index 9af1f3105..d02e56e09 100644
|
||||
--- a/include/linux/mfd/rk808.h
|
||||
+++ b/include/linux/mfd/rk808.h
|
||||
@@ -644,6 +644,11 @@ enum rk809_reg_id {
|
||||
#define RK817_ON_SOURCE_REG 0xf5
|
||||
#define RK817_OFF_SOURCE_REG 0xf6
|
||||
|
||||
+#define RK817_PMIC_PWRON_KEY 0xf7
|
||||
+#define RK817_PMIC_PWRON_KEY_MSK (0x3 << 4)
|
||||
+/* 00: 6s, 01: 8s, 10: 10s, 11: 12s */
|
||||
+#define RK817_PWRON_LP_OFF_TIME (0x3 << 4)
|
||||
+
|
||||
/* INTERRUPT REGISTER */
|
||||
#define RK817_INT_STS_REG0 0xf8
|
||||
#define RK817_INT_STS_MSK_REG0 0xf9
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,55 @@
|
||||
From 5f1f9863bf1031e608537945fdc97e099cb9e42c Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Sat, 15 Jul 2023 08:28:16 +0000
|
||||
Subject: [PATCH] arch: arm64: dts: green: Remove spiflash partitions
|
||||
|
||||
---
|
||||
.../boot/dts/rockchip/rk3566-ha-green.dts | 31 ++-----------------
|
||||
1 file changed, 2 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts b/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
index d0830df48..66ef38600 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
@@ -566,36 +566,9 @@ &sfc {
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
- spi-max-frequency = <100000000>;
|
||||
- spi-rx-bus-width = <4>;
|
||||
+ spi-max-frequency = <25000000>;
|
||||
+ spi-rx-bus-width = <1>;
|
||||
spi-tx-bus-width = <1>;
|
||||
-
|
||||
- partitions {
|
||||
- compatible = "fixed-partitions";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <1>;
|
||||
-
|
||||
- partition@0 {
|
||||
- label = "SPL";
|
||||
- reg = <0x0 0xe0000>;
|
||||
- };
|
||||
- partition@e0000 {
|
||||
- label = "U-Boot Env";
|
||||
- reg = <0xe0000 0x20000>;
|
||||
- };
|
||||
- partition@100000 {
|
||||
- label = "U-Boot";
|
||||
- reg = <0x100000 0x200000>;
|
||||
- };
|
||||
- partition@300000 {
|
||||
- label = "splash";
|
||||
- reg = <0x300000 0x100000>;
|
||||
- };
|
||||
- partition@400000 {
|
||||
- label = "Filesystem";
|
||||
- reg = <0x400000 0xc00000>;
|
||||
- };
|
||||
- };
|
||||
};
|
||||
};
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 32ee0c67a53f541f42b3a953e992bac12d5375d6 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <32ee0c67a53f541f42b3a953e992bac12d5375d6.1689754249.git.stefan@agner.ch>
|
||||
In-Reply-To: <fa0e84b5fbb7b6ce0b161bfcfe495f3648d02110.1689754249.git.stefan@agner.ch>
|
||||
References: <fa0e84b5fbb7b6ce0b161bfcfe495f3648d02110.1689754249.git.stefan@agner.ch>
|
||||
From: Stefan Agner <stefan@agner.ch>
|
||||
Date: Wed, 19 Jul 2023 10:08:06 +0200
|
||||
Subject: [PATCH] Input: rk805-pwrkey: reverse polarity of pwrkey
|
||||
|
||||
The power key is low active. Reverse logic to avoid involuntary long
|
||||
press being reported to user space.
|
||||
|
||||
Signed-off-by: Stefan Agner <stefan@agner.ch>
|
||||
---
|
||||
drivers/input/misc/rk805-pwrkey.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/misc/rk805-pwrkey.c b/drivers/input/misc/rk805-pwrkey.c
|
||||
index 76873aa005b4..139419033c84 100644
|
||||
--- a/drivers/input/misc/rk805-pwrkey.c
|
||||
+++ b/drivers/input/misc/rk805-pwrkey.c
|
||||
@@ -19,7 +19,7 @@ static irqreturn_t pwrkey_fall_irq(int irq, void *_pwr)
|
||||
{
|
||||
struct input_dev *pwr = _pwr;
|
||||
|
||||
- input_report_key(pwr, KEY_POWER, 1);
|
||||
+ input_report_key(pwr, KEY_POWER, 0);
|
||||
input_sync(pwr);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
@@ -29,7 +29,7 @@ static irqreturn_t pwrkey_rise_irq(int irq, void *_pwr)
|
||||
{
|
||||
struct input_dev *pwr = _pwr;
|
||||
|
||||
- input_report_key(pwr, KEY_POWER, 0);
|
||||
+ input_report_key(pwr, KEY_POWER, 1);
|
||||
input_sync(pwr);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
--
|
||||
2.41.0
|
||||
|
@ -0,0 +1,24 @@
|
||||
From 10c2c3afa62f58c4f795a0777aa8635428e3c78a Mon Sep 17 00:00:00 2001
|
||||
From: zhangcy <chengyu.zhang@seeed.cc>
|
||||
Date: Mon, 14 Aug 2023 01:27:34 +0000
|
||||
Subject: [PATCH] green: emmc use HS200 mode
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts b/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
index f742b904a..3b564950f 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3566-ha-green.dts
|
||||
@@ -533,6 +533,7 @@ &saradc {
|
||||
|
||||
&sdhci {
|
||||
bus-width = <8>;
|
||||
+ mmc-hs200-1_8v;
|
||||
max-frequency = <200000000>;
|
||||
non-removable;
|
||||
pinctrl-names = "default";
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,836 @@
|
||||
From 377934f736699077b3622949231f171b4f3c4386 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <377934f736699077b3622949231f171b4f3c4386.1689232931.git.stefan@agner.ch>
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Thu, 6 Jul 2023 10:06:35 +0000
|
||||
Subject: [PATCH] arch: arm: dts: Add NabuCasa Green board
|
||||
|
||||
---
|
||||
arch/arm/dts/Makefile | 1 +
|
||||
arch/arm/dts/rk3566-ha-green-u-boot.dtsi | 28 +
|
||||
arch/arm/dts/rk3566-ha-green.dts | 685 +++++++++++++++++++++++
|
||||
configs/green_defconfig | 74 +++
|
||||
4 files changed, 788 insertions(+)
|
||||
create mode 100644 arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
create mode 100644 arch/arm/dts/rk3566-ha-green.dts
|
||||
create mode 100644 configs/green_defconfig
|
||||
|
||||
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
|
||||
index 480269fa60..b82ebfe371 100644
|
||||
--- a/arch/arm/dts/Makefile
|
||||
+++ b/arch/arm/dts/Makefile
|
||||
@@ -167,6 +167,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
|
||||
|
||||
dtb-$(CONFIG_ROCKCHIP_RK3568) += \
|
||||
rk3566-anbernic-rgxx3.dtb \
|
||||
+ rk3566-ha-green.dtb \
|
||||
rk3566-radxa-cm3-io.dtb \
|
||||
rk3568-evb.dtb \
|
||||
rk3568-rock-3a.dtb
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
new file mode 100644
|
||||
index 0000000000..83fa66d591
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
@@ -0,0 +1,28 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+/*
|
||||
+ * (C) Copyright 2021 Rockchip Electronics Co., Ltd
|
||||
+ * (C) Copyright 2023 Akash Gajjar <gajjar04akash@gmail.com>
|
||||
+ */
|
||||
+
|
||||
+#include "rk356x-u-boot.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ chosen {
|
||||
+ stdout-path = &uart2;
|
||||
+ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&sdmmc0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdhci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ clock-frequency = <24000000>;
|
||||
+ bootph-all;
|
||||
+ u-boot,dm-pre-reloc;
|
||||
+};
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green.dts b/arch/arm/dts/rk3566-ha-green.dts
|
||||
new file mode 100644
|
||||
index 0000000000..d0830df48d
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/rk3566-ha-green.dts
|
||||
@@ -0,0 +1,685 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2023 Seeed Co., Ltd.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+#include <dt-bindings/pinctrl/rockchip.h>
|
||||
+#include <dt-bindings/soc/rockchip,vop2.h>
|
||||
+#include "rk3566.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Home Assistant Green";
|
||||
+ compatible = "rockchip,rk3566-ha-green", "rockchip,rk3566";
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet1 = &gmac1;
|
||||
+ mmc0 = &sdhci;
|
||||
+ mmc1 = &sdmmc0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial2:1500000n8";
|
||||
+ };
|
||||
+
|
||||
+ dc_12v: dc-12v-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "dc_12v";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <12000000>;
|
||||
+ regulator-max-microvolt = <12000000>;
|
||||
+ };
|
||||
+
|
||||
+ hdmi-con {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led_power: led-0 {
|
||||
+ gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_POWER;
|
||||
+ color = <LED_COLOR_ID_RED>;
|
||||
+ default-state = "keep";
|
||||
+ linux,default-trigger = "default-on";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_power_pin>;
|
||||
+ };
|
||||
+ led_act: led-1 {
|
||||
+ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_ACTIVITY;
|
||||
+ color = <LED_COLOR_ID_GREEN>;
|
||||
+ linux,default-trigger = "activity";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_act_pin>;
|
||||
+ };
|
||||
+ led_user: led-2 {
|
||||
+ gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_HEARTBEAT;
|
||||
+ color = <LED_COLOR_ID_YELLOW>;
|
||||
+ linux,default-trigger = "heartbeat";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_usr_pin>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk809-sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "Analog RK817";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,mclk-fs = <256>;
|
||||
+ simple-audio-card,widgets =
|
||||
+ "Headphone", "Headphones",
|
||||
+ "Speaker", "Speaker";
|
||||
+ simple-audio-card,routing =
|
||||
+ "Headphones", "HPOL",
|
||||
+ "Headphones", "HPOR",
|
||||
+ "Speaker", "SPKO";
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s1_8ch>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&rk809>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_sys: vcc3v3-sys-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+ vcc5v0_sys: vcc5v0-sys-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc5v0_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+ vcc5v0_usb_host: vcc5v0-usb-host-regulator {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc5v0_usb_host";
|
||||
+ enable-active-high;
|
||||
+ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&vcc5v0_usb_host_en_pin>;
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ vin-supply = <&vcc5v0_sys>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu1 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu2 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu3 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&gmac1 {
|
||||
+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
|
||||
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
|
||||
+ assigned-clock-rates = <0>, <125000000>;
|
||||
+ clock_in_out = "output";
|
||||
+
|
||||
+ snps,reset-gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
|
||||
+ snps,reset-active-low;
|
||||
+ /* Reset time is 20ms, 100ms for rtl8211f */
|
||||
+ snps,reset-delays-us = <0 20000 100000>;
|
||||
+
|
||||
+ phy-handle = <&rgmii_phy1>;
|
||||
+ phy-mode = "rgmii";
|
||||
+
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac1m0_miim
|
||||
+ &gmac1m0_tx_bus2
|
||||
+ &gmac1m0_rx_bus2
|
||||
+ &gmac1m0_rgmii_clk
|
||||
+ &gmac1m0_rgmii_bus>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ tx_delay = <0x47>;
|
||||
+ rx_delay = <0x27>;
|
||||
+};
|
||||
+
|
||||
+&gpu {
|
||||
+ mali-supply = <&vdd_gpu>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ avdd-0v9-supply = <&vdda0v9_image>;
|
||||
+ avdd-1v8-supply = <&vcca1v8_image>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_in {
|
||||
+ hdmi_in_vp0: endpoint {
|
||||
+ remote-endpoint = <&vp0_out_hdmi>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi_sound {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c0 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdd_cpu: rk8601@41 {
|
||||
+ compatible = "rockchip,rk8601";
|
||||
+ reg = <0x41>;
|
||||
+ vin-supply = <&vcc5v0_sys>;
|
||||
+ regulator-compatible = "rk860x-reg";
|
||||
+ regulator-name = "vdd_cpu";
|
||||
+ regulator-min-microvolt = <712500>;
|
||||
+ regulator-max-microvolt = <1500000>;
|
||||
+ regulator-ramp-delay = <2300>;
|
||||
+ rockchip,suspend-voltage-selector = <1>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk809: pmic@20 {
|
||||
+ compatible = "rockchip,rk809";
|
||||
+ reg = <0x20>;
|
||||
+ interrupt-parent = <&gpio0>;
|
||||
+ interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
|
||||
+ assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
|
||||
+ #clock-cells = <1>;
|
||||
+ clock-names = "mclk";
|
||||
+ clocks = <&cru I2S1_MCLKOUT_TX>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pmic_int_l>, <&i2s1m0_mclk>;
|
||||
+
|
||||
+ rockchip,system-power-controller;
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ wakeup-source;
|
||||
+
|
||||
+ vcc1-supply = <&vcc3v3_sys>;
|
||||
+ vcc2-supply = <&vcc3v3_sys>;
|
||||
+ vcc3-supply = <&vcc3v3_sys>;
|
||||
+ vcc4-supply = <&vcc3v3_sys>;
|
||||
+ vcc5-supply = <&vcc3v3_sys>;
|
||||
+ vcc6-supply = <&vcc3v3_sys>;
|
||||
+ vcc7-supply = <&vcc3v3_sys>;
|
||||
+ vcc8-supply = <&vcc3v3_sys>;
|
||||
+ vcc9-supply = <&vcc3v3_sys>;
|
||||
+
|
||||
+ regulators {
|
||||
+ vdd_logic: DCDC_REG1 {
|
||||
+ regulator-name = "vdd_logic";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-init-microvolt = <900000>;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_gpu: DCDC_REG2 {
|
||||
+ regulator-name = "vdd_gpu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-init-microvolt = <900000>;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_ddr: DCDC_REG3 {
|
||||
+ regulator-name = "vcc_ddr";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_npu: DCDC_REG4 {
|
||||
+ regulator-name = "vdd_npu";
|
||||
+ regulator-init-microvolt = <900000>;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_1v8: DCDC_REG5 {
|
||||
+ regulator-name = "vcc_1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda0v9_image: LDO_REG1 {
|
||||
+ regulator-name = "vdda0v9_image";
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda_0v9: LDO_REG2 {
|
||||
+ regulator-name = "vdda_0v9";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda0v9_pmu: LDO_REG3 {
|
||||
+ regulator-name = "vdda0v9_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <900000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_acodec: LDO_REG4 {
|
||||
+ regulator-name = "vccio_acodec";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_sd: LDO_REG5 {
|
||||
+ regulator-name = "vccio_sd";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_pmu: LDO_REG6 {
|
||||
+ regulator-name = "vcc3v3_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca_1v8: LDO_REG7 {
|
||||
+ regulator-name = "vcca_1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca1v8_pmu: LDO_REG8 {
|
||||
+ regulator-name = "vcca1v8_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <1800000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca1v8_image: LDO_REG9 {
|
||||
+ regulator-name = "vcca1v8_image";
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_3v3: SWITCH_REG1 {
|
||||
+ regulator-name = "vcc_3v3";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_sd: SWITCH_REG2 {
|
||||
+ regulator-name = "vcc3v3_sd";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c1 {
|
||||
+ clock-frequency = <400000>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ rtc: rtc@51 {
|
||||
+ compatible = "nxp,pcf8563";
|
||||
+ reg = <0x51>;
|
||||
+ #clock-cells = <0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s0_8ch {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s1_8ch {
|
||||
+ rockchip,trcm-sync-tx-only;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio1 {
|
||||
+ rgmii_phy1: ethernet-phy@0 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <0x0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ fspi {
|
||||
+ fspi_dual_io_pins: fspi-dual-io-pins {
|
||||
+ rockchip,pins =
|
||||
+ /* fspi_clk */
|
||||
+ <1 RK_PD0 1 &pcfg_pull_none>,
|
||||
+ /* fspi_cs0n */
|
||||
+ <1 RK_PD3 1 &pcfg_pull_none>,
|
||||
+ /* fspi_d0 */
|
||||
+ <1 RK_PD1 1 &pcfg_pull_none>,
|
||||
+ /* fspi_d1 */
|
||||
+ <1 RK_PD2 1 &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ ethernet {
|
||||
+ eth_phy_rst: eth_phy_rst {
|
||||
+ rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ led_power_pin: led-power-pin {
|
||||
+ rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ led_act_pin: led-act-pin {
|
||||
+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ led_usr_pin: led-user-pin {
|
||||
+ rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pmic {
|
||||
+ pmic_int_l: pmic-int-l {
|
||||
+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ usb {
|
||||
+ vcc5v0_usb_host_en_pin: vcc5v0-usb-host-en-pin {
|
||||
+ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pmu_io_domains {
|
||||
+ pmuio1-supply = <&vcc3v3_pmu>;
|
||||
+ pmuio2-supply = <&vcc3v3_pmu>;
|
||||
+ vccio1-supply = <&vccio_acodec>;
|
||||
+ vccio2-supply = <&vcc_1v8>;
|
||||
+ vccio3-supply = <&vccio_sd>;
|
||||
+ vccio4-supply = <&vcc_1v8>; /* float */
|
||||
+ vccio5-supply = <&vcc_1v8>;
|
||||
+ vccio6-supply = <&vcc_1v8>;
|
||||
+ vccio7-supply = <&vcc_3v3>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&saradc {
|
||||
+ vref-supply = <&vcca_1v8>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdhci {
|
||||
+ bus-width = <8>;
|
||||
+ max-frequency = <200000000>;
|
||||
+ non-removable;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe &emmc_rstnout>;
|
||||
+ vmmc-supply = <&vcc_3v3>;
|
||||
+ vqmmc-supply = <&vcc_1v8>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdmmc0 {
|
||||
+ bus-width = <4>;
|
||||
+ cap-sd-highspeed;
|
||||
+ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
|
||||
+ disable-wp;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
|
||||
+ sd-uhs-sdr104;
|
||||
+ vmmc-supply = <&vcc3v3_sd>;
|
||||
+ vqmmc-supply = <&vccio_sd>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sfc {
|
||||
+ /* Dual I/O mode as the D2 pin conflicts with the eMMC */
|
||||
+ pinctrl-0 = <&fspi_dual_io_pins>;
|
||||
+ pinctrl-names = "default";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ flash@0 {
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <100000000>;
|
||||
+ spi-rx-bus-width = <4>;
|
||||
+ spi-tx-bus-width = <1>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "SPL";
|
||||
+ reg = <0x0 0xe0000>;
|
||||
+ };
|
||||
+ partition@e0000 {
|
||||
+ label = "U-Boot Env";
|
||||
+ reg = <0xe0000 0x20000>;
|
||||
+ };
|
||||
+ partition@100000 {
|
||||
+ label = "U-Boot";
|
||||
+ reg = <0x100000 0x200000>;
|
||||
+ };
|
||||
+ partition@300000 {
|
||||
+ label = "splash";
|
||||
+ reg = <0x300000 0x100000>;
|
||||
+ };
|
||||
+ partition@400000 {
|
||||
+ label = "Filesystem";
|
||||
+ reg = <0x400000 0xc00000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&tsadc {
|
||||
+ rockchip,hw-tshut-mode = <1>;
|
||||
+ rockchip,hw-tshut-polarity = <0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host0_ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host0_ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host0_xhci {
|
||||
+ dr_mode = "host";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_ehci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_ohci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_xhci {
|
||||
+ status = "okay";
|
||||
+ phys = <&usb2phy0_host>;
|
||||
+ phy-names = "usb2-phy";
|
||||
+ snps,dis_u2_susphy_quirk;
|
||||
+ extcon = <&usb2phy0>;
|
||||
+ maximum-speed = "high-speed";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0_host {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0_otg {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy1_host {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy1_otg {
|
||||
+ phy-supply = <&vcc5v0_usb_host>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vop {
|
||||
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
|
||||
+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vop_mmu {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vp0 {
|
||||
+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
|
||||
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
|
||||
+ remote-endpoint = <&hdmi_in_vp0>;
|
||||
+ };
|
||||
+};
|
||||
diff --git a/configs/green_defconfig b/configs/green_defconfig
|
||||
new file mode 100644
|
||||
index 0000000000..0617d308aa
|
||||
--- /dev/null
|
||||
+++ b/configs/green_defconfig
|
||||
@@ -0,0 +1,74 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
+CONFIG_COUNTER_FREQUENCY=24000000
|
||||
+CONFIG_ARCH_ROCKCHIP=y
|
||||
+CONFIG_TEXT_BASE=0x00a00000
|
||||
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
+CONFIG_NR_DRAM_BANKS=2
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="rk3566-ha-green"
|
||||
+CONFIG_ROCKCHIP_RK3568=y
|
||||
+CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
|
||||
+CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
|
||||
+CONFIG_SPL_MMC=y
|
||||
+CONFIG_SPL_SERIAL=y
|
||||
+CONFIG_SPL_STACK_R_ADDR=0x600000
|
||||
+CONFIG_TARGET_EVB_RK3568=y
|
||||
+CONFIG_DEBUG_UART_BASE=0xFE660000
|
||||
+CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0xc00800
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-ha-green.dtb"
|
||||
+# CONFIG_DISPLAY_CPUINFO is not set
|
||||
+CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
+CONFIG_SPL_MAX_SIZE=0x20000
|
||||
+CONFIG_SPL_PAD_TO=0x7f8000
|
||||
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
|
||||
+CONFIG_SPL_BSS_START_ADDR=0x4000000
|
||||
+CONFIG_SPL_BSS_MAX_SIZE=0x4000
|
||||
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
+# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
|
||||
+CONFIG_DM_PMIC=y
|
||||
+CONFIG_PMIC_RK8XX=y
|
||||
+CONFIG_SPL_PMIC_RK8XX=y
|
||||
+CONFIG_SPL_STACK=0x400000
|
||||
+CONFIG_SPL_STACK_R=y
|
||||
+CONFIG_SPL_ATF=y
|
||||
+CONFIG_CMD_I2C=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+# CONFIG_CMD_SETEXPR is not set
|
||||
+# CONFIG_SPL_DOS_PARTITION is not set
|
||||
+CONFIG_SPL_OF_CONTROL=y
|
||||
+CONFIG_OF_LIVE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGULATOR_RK8XX=y
|
||||
+CONFIG_SPL_REGMAP=y
|
||||
+CONFIG_SPL_SYSCON=y
|
||||
+CONFIG_SPL_CLK=y
|
||||
+CONFIG_ROCKCHIP_GPIO=y
|
||||
+CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
+CONFIG_MISC=y
|
||||
+CONFIG_SUPPORT_EMMC_RPMB=y
|
||||
+CONFIG_MMC_DW=y
|
||||
+CONFIG_MMC_DW_ROCKCHIP=y
|
||||
+CONFIG_MMC_SDHCI=y
|
||||
+CONFIG_MMC_SDHCI_SDMA=y
|
||||
+CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
+CONFIG_ETH_DESIGNWARE=y
|
||||
+CONFIG_GMAC_ROCKCHIP=y
|
||||
+CONFIG_REGULATOR_PWM=y
|
||||
+CONFIG_PWM_ROCKCHIP=y
|
||||
+CONFIG_SPL_RAM=y
|
||||
+CONFIG_DM_RESET=y
|
||||
+CONFIG_BAUDRATE=1500000
|
||||
+CONFIG_DEBUG_UART_SHIFT=2
|
||||
+CONFIG_SYS_NS16550_MEM32=y
|
||||
+CONFIG_SYSRESET=y
|
||||
+# CONFIG_BINMAN_FDT is not set
|
||||
+CONFIG_ERRNO_STR=y
|
||||
--
|
||||
2.41.0
|
||||
|
@ -0,0 +1,117 @@
|
||||
From 4ebfe11def93e82d9bd0c43414cb7c6f01a54d19 Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Fri, 14 Jul 2023 14:13:39 +0000
|
||||
Subject: [PATCH 1/2] configs: green: Support USB boot
|
||||
|
||||
---
|
||||
configs/green_defconfig | 52 ++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 36 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/configs/green_defconfig b/configs/green_defconfig
|
||||
index 0617d308..14960b67 100644
|
||||
--- a/configs/green_defconfig
|
||||
+++ b/configs/green_defconfig
|
||||
@@ -6,48 +6,54 @@ CONFIG_TEXT_BASE=0x00a00000
|
||||
CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
CONFIG_NR_DRAM_BANKS=2
|
||||
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
|
||||
+CONFIG_SF_DEFAULT_SPEED=24000000
|
||||
+CONFIG_SF_DEFAULT_MODE=0x2000
|
||||
CONFIG_DEFAULT_DEVICE_TREE="rk3566-ha-green"
|
||||
CONFIG_ROCKCHIP_RK3568=y
|
||||
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
|
||||
CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
|
||||
-CONFIG_SPL_MMC=y
|
||||
+CONFIG_ROCKCHIP_SPI_IMAGE=y
|
||||
CONFIG_SPL_SERIAL=y
|
||||
CONFIG_SPL_STACK_R_ADDR=0x600000
|
||||
-CONFIG_TARGET_EVB_RK3568=y
|
||||
+CONFIG_SPL_STACK=0x400000
|
||||
CONFIG_DEBUG_UART_BASE=0xFE660000
|
||||
CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
|
||||
+CONFIG_SPL_SPI=y
|
||||
CONFIG_SYS_LOAD_ADDR=0xc00800
|
||||
CONFIG_DEBUG_UART=y
|
||||
-CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
|
||||
CONFIG_FIT=y
|
||||
CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_SPL_FIT_SIGNATURE=y
|
||||
CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-ha-green.dtb"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
-CONFIG_SPL_MAX_SIZE=0x20000
|
||||
+CONFIG_SPL_MAX_SIZE=0x40000
|
||||
CONFIG_SPL_PAD_TO=0x7f8000
|
||||
CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
|
||||
CONFIG_SPL_BSS_START_ADDR=0x4000000
|
||||
CONFIG_SPL_BSS_MAX_SIZE=0x4000
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
|
||||
-CONFIG_DM_PMIC=y
|
||||
-CONFIG_PMIC_RK8XX=y
|
||||
-CONFIG_SPL_PMIC_RK8XX=y
|
||||
-CONFIG_SPL_STACK=0x400000
|
||||
CONFIG_SPL_STACK_R=y
|
||||
+CONFIG_SPL_SPI_LOAD=y
|
||||
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
|
||||
CONFIG_SPL_ATF=y
|
||||
-CONFIG_CMD_I2C=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_USB=y
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
+CONFIG_CMD_PMIC=y
|
||||
+CONFIG_CMD_REGULATOR=y
|
||||
# CONFIG_SPL_DOS_PARTITION is not set
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
CONFIG_OF_LIVE=y
|
||||
-CONFIG_NET_RANDOM_ETHADDR=y
|
||||
-CONFIG_REGULATOR_RK8XX=y
|
||||
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
CONFIG_SPL_REGMAP=y
|
||||
CONFIG_SPL_SYSCON=y
|
||||
CONFIG_SPL_CLK=y
|
||||
@@ -60,15 +66,29 @@ CONFIG_MMC_DW_ROCKCHIP=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
+CONFIG_SPI_FLASH_MACRONIX=y
|
||||
+CONFIG_SPI_FLASH_XTX=y
|
||||
CONFIG_ETH_DESIGNWARE=y
|
||||
CONFIG_GMAC_ROCKCHIP=y
|
||||
-CONFIG_REGULATOR_PWM=y
|
||||
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
|
||||
+CONFIG_SPL_PINCTRL=y
|
||||
+CONFIG_DM_PMIC=y
|
||||
+CONFIG_PMIC_RK8XX=y
|
||||
+CONFIG_REGULATOR_RK8XX=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_SPL_RAM=y
|
||||
-CONFIG_DM_RESET=y
|
||||
CONFIG_BAUDRATE=1500000
|
||||
CONFIG_DEBUG_UART_SHIFT=2
|
||||
CONFIG_SYS_NS16550_MEM32=y
|
||||
+CONFIG_ROCKCHIP_SFC=y
|
||||
CONFIG_SYSRESET=y
|
||||
-# CONFIG_BINMAN_FDT is not set
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_DWC3=y
|
||||
+CONFIG_USB_EHCI_HCD=y
|
||||
+CONFIG_USB_EHCI_GENERIC=y
|
||||
+CONFIG_USB_OHCI_HCD=y
|
||||
+CONFIG_USB_OHCI_GENERIC=y
|
||||
+CONFIG_USB_DWC3=y
|
||||
CONFIG_ERRNO_STR=y
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,50 @@
|
||||
From fee073b1c267ac318b7eb7b52b1098bd2aaf09df Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Fri, 14 Jul 2023 14:14:10 +0000
|
||||
Subject: [PATCH 2/2] arch: arm: dts: rk3566: green: boot order
|
||||
|
||||
---
|
||||
arch/arm/dts/rk3566-ha-green-u-boot.dtsi | 6 +++++-
|
||||
arch/arm/dts/rk3566-ha-green.dts | 2 +-
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
index 83fa66d5..7f2ed298 100644
|
||||
--- a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
@@ -9,7 +9,7 @@
|
||||
/ {
|
||||
chosen {
|
||||
stdout-path = &uart2;
|
||||
- u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0;
|
||||
+ u-boot,spl-boot-order = &spiflash, &sdmmc0, &sdhci;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&spiflash {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
&uart2 {
|
||||
clock-frequency = <24000000>;
|
||||
bootph-all;
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green.dts b/arch/arm/dts/rk3566-ha-green.dts
|
||||
index d0830df4..3952c8c5 100644
|
||||
--- a/arch/arm/dts/rk3566-ha-green.dts
|
||||
+++ b/arch/arm/dts/rk3566-ha-green.dts
|
||||
@@ -563,7 +563,7 @@
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
- flash@0 {
|
||||
+ spiflash: flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <100000000>;
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,155 @@
|
||||
From 0de4db17b62e1fa47b788d921a76bc7a0328b0a9 Mon Sep 17 00:00:00 2001
|
||||
From: Zhangqun Ming <north_sea@qq.com>
|
||||
Date: Sat, 15 Jul 2023 08:46:09 +0000
|
||||
Subject: [PATCH] arch: arm: dts: green: spi nor uboot
|
||||
|
||||
---
|
||||
arch/arm/dts/rk3566-ha-green-u-boot.dtsi | 88 +++++++++++++++++++++++-
|
||||
arch/arm/dts/rk3566-ha-green.dts | 4 +-
|
||||
configs/green_defconfig | 2 +
|
||||
3 files changed, 91 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
index 7f2ed298..fa98078f 100644
|
||||
--- a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
@@ -13,15 +13,96 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&emmc_bus8 {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&emmc_clk {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&emmc_cmd {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&emmc_datastrobe {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&fspi_pins {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&pcfg_pull_none {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&pcfg_pull_up_drv_level_2 {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&pcfg_pull_up {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&sdmmc0_bus4 {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&sdmmc0_clk {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&sdmmc0_cmd {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
+&sdmmc0_det {
|
||||
+ bootph-all;
|
||||
+};
|
||||
+
|
||||
&sdmmc0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
+ cap-mmc-highspeed;
|
||||
+ mmc-ddr-1_8v;
|
||||
+ mmc-hs200-1_8v;
|
||||
+ mmc-hs400-1_8v;
|
||||
+ mmc-hs400-enhanced-strobe;
|
||||
+};
|
||||
+
|
||||
+&sfc {
|
||||
+ bootph-all;
|
||||
+ u-boot,spl-sfc-no-dma;
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
status = "okay";
|
||||
+
|
||||
+ spiflash: flash@0 {
|
||||
+ bootph-all;
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <24000000>;
|
||||
+ spi-rx-bus-width = <1>;
|
||||
+ spi-tx-bus-width = <1>;
|
||||
+ };
|
||||
};
|
||||
|
||||
-&spiflash {
|
||||
+&sdmmc2 {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+&uart2m0_xfer {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
@@ -29,4 +110,9 @@
|
||||
clock-frequency = <24000000>;
|
||||
bootph-all;
|
||||
u-boot,dm-pre-reloc;
|
||||
+ status = "okay";
|
||||
};
|
||||
+
|
||||
+&vcc5v0_usb_host {
|
||||
+ regulator-boot-on;
|
||||
+};
|
||||
\ No newline at end of file
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green.dts b/arch/arm/dts/rk3566-ha-green.dts
|
||||
index 3952c8c5..52b4baa9 100644
|
||||
--- a/arch/arm/dts/rk3566-ha-green.dts
|
||||
+++ b/arch/arm/dts/rk3566-ha-green.dts
|
||||
@@ -566,8 +566,8 @@
|
||||
spiflash: flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
- spi-max-frequency = <100000000>;
|
||||
- spi-rx-bus-width = <4>;
|
||||
+ spi-max-frequency = <25000000>;
|
||||
+ spi-rx-bus-width = <1>;
|
||||
spi-tx-bus-width = <1>;
|
||||
|
||||
partitions {
|
||||
diff --git a/configs/green_defconfig b/configs/green_defconfig
|
||||
index 14960b67..5f94c062 100644
|
||||
--- a/configs/green_defconfig
|
||||
+++ b/configs/green_defconfig
|
||||
@@ -68,6 +68,8 @@ CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
CONFIG_SPI_FLASH_MACRONIX=y
|
||||
CONFIG_SPI_FLASH_XTX=y
|
||||
+CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
+CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_ETH_DESIGNWARE=y
|
||||
CONFIG_GMAC_ROCKCHIP=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,137 @@
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green.dts b/arch/arm/dts/rk3566-ha-green.dts
|
||||
index 52b4baa9..1a8c13e9 100644
|
||||
--- a/arch/arm/dts/rk3566-ha-green.dts
|
||||
+++ b/arch/arm/dts/rk3566-ha-green.dts
|
||||
@@ -449,6 +449,13 @@
|
||||
reg = <0x51>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
+
|
||||
+ eeprom: eeprom@50 {
|
||||
+ compatible = "atmel,24c32";
|
||||
+ reg = <0x50>;
|
||||
+ pagesize = <32>;
|
||||
+ };
|
||||
+
|
||||
};
|
||||
|
||||
&i2s0_8ch {
|
||||
diff --git a/board/rockchip/evb_rk3568/Kconfig b/board/rockchip/evb_rk3568/Kconfig
|
||||
index f3d3a7e1..8bf457da 100644
|
||||
--- a/board/rockchip/evb_rk3568/Kconfig
|
||||
+++ b/board/rockchip/evb_rk3568/Kconfig
|
||||
@@ -12,4 +12,7 @@ config SYS_CONFIG_NAME
|
||||
config BOARD_SPECIFIC_OPTIONS # dummy
|
||||
def_bool y
|
||||
|
||||
+config UBOOT_GREEN_BOARD
|
||||
+ tristate "uboot green boadrd"
|
||||
+
|
||||
endif
|
||||
diff --git a/board/rockchip/evb_rk3568/Makefile b/board/rockchip/evb_rk3568/Makefile
|
||||
index cbda95fe..e616da10 100644
|
||||
--- a/board/rockchip/evb_rk3568/Makefile
|
||||
+++ b/board/rockchip/evb_rk3568/Makefile
|
||||
@@ -5,3 +5,4 @@
|
||||
#
|
||||
|
||||
obj-y += evb_rk3568.o
|
||||
+obj-$(CONFIG_UBOOT_GREEN_BOARD) += nabucasa/green/board.o
|
||||
diff --git a/board/rockchip/evb_rk3568/nabucasa/green/board.c b/board/rockchip/evb_rk3568/nabucasa/green/board.c
|
||||
new file mode 100644
|
||||
index 00000000..8d24b02a
|
||||
--- /dev/null
|
||||
+++ b/board/rockchip/evb_rk3568/nabucasa/green/board.c
|
||||
@@ -0,0 +1,91 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright 2022 Google LLC
|
||||
+ */
|
||||
+#include <net.h>
|
||||
+#include <errno.h>
|
||||
+#include <dm/device.h>
|
||||
+#include <dm/uclass.h>
|
||||
+#include <common.h>
|
||||
+#include <dm.h>
|
||||
+#include <eeprom.h>
|
||||
+#include <env.h>
|
||||
+#include <i2c_eeprom.h>
|
||||
+#include <netdev.h>
|
||||
+
|
||||
+
|
||||
+int misc_init_r(void)
|
||||
+{
|
||||
+
|
||||
+ #define CONTENT_SIZE 44
|
||||
+ #define ETHADDR_OFFSET 0X22
|
||||
+ #define ETHADDR_LEN 6
|
||||
+ #define SERIALNUM_OFFSET 0X10
|
||||
+ #define SERIALNUM_LEN 18
|
||||
+ #define VERSION_OFFSET 0X0C
|
||||
+ #define VERSION_LEN 4
|
||||
+
|
||||
+ unsigned char data[CONTENT_SIZE];
|
||||
+ unsigned char ethaddr[ETHADDR_LEN];
|
||||
+ unsigned char serialnum[SERIALNUM_LEN + 1];
|
||||
+ unsigned char version[VERSION_LEN];
|
||||
+ unsigned char fdtfile_name[32] = "rk3566-ha-green.dtb";
|
||||
+
|
||||
+ const char *ETHADDR_NAME = "ethaddr";
|
||||
+ struct udevice *dev;
|
||||
+ int ret;
|
||||
+
|
||||
+
|
||||
+ if (env_get(ETHADDR_NAME)){
|
||||
+ printf("ethaddr not null\n");
|
||||
+ ret = 0;
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ ret = uclass_first_device_err(UCLASS_I2C_EEPROM, &dev);
|
||||
+ if (ret){
|
||||
+ printf("UCLASS_I2C_EEPROM get error\n");
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ ret = i2c_eeprom_read(dev, 0, data, sizeof(data));
|
||||
+ if (ret){
|
||||
+ printf("UCLASS_I2C_EEPROM read error %d\n", ret);
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ if((data[0] == 3) && (data[1] == 5) && (data[2] == 6) && (data[3] == 6))
|
||||
+ {
|
||||
+ printf("header ok\n");
|
||||
+
|
||||
+ memcpy(version , data + VERSION_OFFSET, VERSION_LEN);
|
||||
+ if(!strcmp(version, "00A0")){
|
||||
+ sprintf(fdtfile_name, "%s", "rk3566-ha-green.dtb");
|
||||
+ printf("overlay fdtfile_name = %s\n", fdtfile_name);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+ memcpy(serialnum, data + SERIALNUM_OFFSET, SERIALNUM_LEN);
|
||||
+ serialnum[SERIALNUM_LEN] = 0;
|
||||
+ env_set("serial#", serialnum);
|
||||
+
|
||||
+
|
||||
+ memcpy(ethaddr, data + ETHADDR_OFFSET, ETHADDR_LEN);
|
||||
+
|
||||
+ if (is_valid_ethaddr(ethaddr))
|
||||
+ eth_env_set_enetaddr(ETHADDR_NAME, ethaddr);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+exit:
|
||||
+ env_set("fdtfile", fdtfile_name);
|
||||
+
|
||||
+
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
\ No newline at end of file
|
@ -0,0 +1,25 @@
|
||||
From cbea8d765c41873dc4fde70aed0f919ab8953008 Mon Sep 17 00:00:00 2001
|
||||
From: syan <syan.cham@gmail.com>
|
||||
Date: Mon, 31 Jul 2023 09:39:55 +0000
|
||||
Subject: [PATCH] green: spl loader uboot order: sd-emmc-spi_nor
|
||||
|
||||
---
|
||||
arch/arm/dts/rk3566-ha-green-u-boot.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
index fa98078f..48d7b615 100644
|
||||
--- a/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/rk3566-ha-green-u-boot.dtsi
|
||||
@@ -9,7 +9,7 @@
|
||||
/ {
|
||||
chosen {
|
||||
stdout-path = &uart2;
|
||||
- u-boot,spl-boot-order = &spiflash, &sdmmc0, &sdhci;
|
||||
+ u-boot,spl-boot-order = &sdmmc0, &sdhci, &spiflash;
|
||||
};
|
||||
};
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
105
buildroot-external/board/nabucasa/green/uboot-boot.ush
Executable file
105
buildroot-external/board/nabucasa/green/uboot-boot.ush
Executable file
@ -0,0 +1,105 @@
|
||||
if test "${devtype}" = "usb_mass_storage"; then
|
||||
setenv devtype "usb"
|
||||
fi
|
||||
echo "boot devtype: ${devtype}:${devnum}"
|
||||
|
||||
part start ${devtype} ${devnum} 6 dev_env
|
||||
${devtype} dev ${devnum}
|
||||
|
||||
setenv loadbootstate " \
|
||||
echo 'loading env...'; \
|
||||
${devtype} read ${ramdisk_addr_r} ${dev_env} 0x40; \
|
||||
env import -c ${ramdisk_addr_r} 0x8000;"
|
||||
|
||||
setenv storebootstate " \
|
||||
echo 'storing env...'; \
|
||||
env export -c -s 0x8000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||
${devtype} write ${ramdisk_addr_r} ${dev_env} 0x40;"
|
||||
|
||||
run loadbootstate
|
||||
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
|
||||
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
|
||||
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
||||
|
||||
# Allows ConditionFirstBoot=
|
||||
test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true"
|
||||
|
||||
# HassOS bootargs
|
||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}"
|
||||
|
||||
# HassOS system A/B
|
||||
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
|
||||
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro"
|
||||
|
||||
part number ${devtype} ${devnum} hassos-boot boot_partnum
|
||||
|
||||
# Load environment from haos-config.txt
|
||||
if test -e ${devtype} ${devnum}:${boot_partnum} haos-config.txt; then
|
||||
fatload ${devtype} ${devnum}:${boot_partnum} ${ramdisk_addr_r} haos-config.txt
|
||||
env import -t ${ramdisk_addr_r} ${filesize}
|
||||
fi
|
||||
|
||||
# Load extraargs
|
||||
fileenv ${devtype} ${devnum}:${boot_partnum} ${ramdisk_addr_r} cmdline.txt cmdline
|
||||
|
||||
|
||||
# Load device tree
|
||||
ha_version="rk3566-ha-green.dtb"
|
||||
setenv fdtfile $ha_version
|
||||
echo "Loading standard device tree ${fdtfile}"
|
||||
fatload ${devtype} ${devnum}:${boot_partnum} ${fdt_addr_r} ${fdtfile}
|
||||
fdt addr ${fdt_addr_r}
|
||||
|
||||
# load dt overlays
|
||||
fdt resize 65536
|
||||
for overlay_file in ${overlays}; do
|
||||
if fatload ${devtype} ${devnum}:${boot_partnum} ${ramdisk_addr_r} overlays/${overlay_file}.dtbo; then
|
||||
echo "Applying kernel provided DT overlay ${overlay_file}.dtbo"
|
||||
fdt apply ${ramdisk_addr_r} || setenv overlay_error "true"
|
||||
fi
|
||||
done
|
||||
if test "${overlay_error}" = "true"; then
|
||||
echo "Error applying DT overlays, restoring original DT"
|
||||
fatload ${devtype} ${devnum}:${boot_partnum} ${fdt_addr_r} ${fdtfile}
|
||||
fi
|
||||
|
||||
setenv bootargs
|
||||
for BOOT_SLOT in "${BOOT_ORDER}"; do
|
||||
if test "x${bootargs}" != "x"; then
|
||||
# skip remaining slots
|
||||
elif test "x${BOOT_SLOT}" = "xA"; then
|
||||
if test ${BOOT_A_LEFT} -gt 0; then
|
||||
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
|
||||
echo "Trying to boot slot A, ${BOOT_A_LEFT} attempts remaining. Loading kernel ..."
|
||||
part number ${devtype} ${devnum} hassos-kernel0 kernel_partnum
|
||||
if load ${devtype} ${devnum}:${kernel_partnum} ${kernel_addr_r} Image; then
|
||||
setenv bootargs "${bootargs_hassos} ${bootargs_a} rauc.slot=A ${cmdline}"
|
||||
fi
|
||||
fi
|
||||
elif test "x${BOOT_SLOT}" = "xB"; then
|
||||
if test ${BOOT_B_LEFT} -gt 0; then
|
||||
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
|
||||
echo "Trying to boot slot B, ${BOOT_B_LEFT} attempts remaining. Loading kernel ..."
|
||||
part number ${devtype} ${devnum} hassos-kernel1 kernel_partnum
|
||||
if load ${devtype} ${devnum}:${kernel_partnum} ${kernel_addr_r} Image; then
|
||||
setenv bootargs "${bootargs_hassos} ${bootargs_b} rauc.slot=B ${cmdline}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if test -n "${bootargs}"; then
|
||||
run storebootstate
|
||||
else
|
||||
echo "No valid slot found, resetting tries to 3"
|
||||
setenv BOOT_A_LEFT 3
|
||||
setenv BOOT_B_LEFT 3
|
||||
run storebootstate
|
||||
reset
|
||||
fi
|
||||
|
||||
echo "Starting kernel"
|
||||
booti ${kernel_addr_r} - ${fdt_addr_r}
|
||||
|
||||
echo "Boot failed, resetting..."
|
||||
reset
|
3
buildroot-external/board/nabucasa/green/uboot.config
Normal file
3
buildroot-external/board/nabucasa/green/uboot.config
Normal file
@ -0,0 +1,3 @@
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_UBOOT_GREEN_BOARD=y
|
||||
CONFIG_I2C_EEPROM=y
|
4295
buildroot-external/board/nabucasa/kernel-rockchip.config
Normal file
4295
buildroot-external/board/nabucasa/kernel-rockchip.config
Normal file
File diff suppressed because it is too large
Load Diff
148
buildroot-external/configs/green_defconfig
Executable file
148
buildroot-external/configs/green_defconfig
Executable file
@ -0,0 +1,148 @@
|
||||
BR2_aarch64=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_OPTIMIZE_2=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/patches"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
|
||||
BR2_GCC_VERSION_11_X=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_GCC_ENABLE_LTO=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
BR2_INIT_SYSTEMD=y
|
||||
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
|
||||
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay"
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh"
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green $(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.45"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/kernel-rockchip.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/kernel.config"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3566-ha-green"
|
||||
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_HASSOS_PATH)/busybox.config"
|
||||
BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES=y
|
||||
BR2_PACKAGE_JQ=y
|
||||
BR2_PACKAGE_DOSFSTOOLS=y
|
||||
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
BR2_PACKAGE_E2FSPROGS_E2IMAGE=y
|
||||
BR2_PACKAGE_IPROUTE2=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX_BT=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX_BT=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK_MT7601U=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT73=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_RTL_81XX=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_RTL_815X=y
|
||||
BR2_PACKAGE_LINUX_FIRMWARE_USB_SERIAL_TI=y
|
||||
BR2_PACKAGE_GPTFDISK=y
|
||||
BR2_PACKAGE_GPTFDISK_SGDISK=y
|
||||
# BR2_PACKAGE_LVM2_STANDARD_INSTALL is not set
|
||||
BR2_PACKAGE_RTL8812AU_AIRCRACK_NG=y
|
||||
BR2_PACKAGE_USB_MODESWITCH_DATA=y
|
||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
||||
BR2_PACKAGE_CIFS_UTILS=y
|
||||
BR2_PACKAGE_LIBCURL_CURL=y
|
||||
BR2_PACKAGE_LIBDNET=y
|
||||
BR2_PACKAGE_LIBCGROUP=y
|
||||
BR2_PACKAGE_LIBCGROUP_TOOLS=y
|
||||
BR2_PACKAGE_LIBSECCOMP=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HOG=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_TOOLS=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
|
||||
BR2_PACKAGE_DBUS_BROKER=y
|
||||
BR2_PACKAGE_DHCP=y
|
||||
BR2_PACKAGE_DHCP_CLIENT=y
|
||||
BR2_PACKAGE_DROPBEAR=y
|
||||
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
|
||||
BR2_PACKAGE_NETWORK_MANAGER=y
|
||||
BR2_PACKAGE_NETWORK_MANAGER_CLI=y
|
||||
BR2_PACKAGE_NFS_UTILS=y
|
||||
# BR2_PACKAGE_NFS_UTILS_RPC_NFSD is not set
|
||||
BR2_PACKAGE_RPCBIND=y
|
||||
BR2_PACKAGE_IPTABLES_NFTABLES=y
|
||||
BR2_PACKAGE_IPTABLES_NFTABLES_DEFAULT=y
|
||||
BR2_PACKAGE_WIRELESS_REGDB=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DBUS=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WEXT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
|
||||
BR2_PACKAGE_APPARMOR=y
|
||||
BR2_PACKAGE_APPARMOR_PROFILES=y
|
||||
BR2_PACKAGE_TINI=y
|
||||
BR2_PACKAGE_DOCKER_CLI=y
|
||||
BR2_PACKAGE_DOCKER_ENGINE=y
|
||||
BR2_PACKAGE_PROCPS_NG=y
|
||||
BR2_PACKAGE_RAUC=y
|
||||
BR2_PACKAGE_RAUC_DBUS=y
|
||||
BR2_PACKAGE_RAUC_NETWORK=y
|
||||
BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE=y
|
||||
BR2_PACKAGE_SYSTEMD_COREDUMP=y
|
||||
# BR2_PACKAGE_SYSTEMD_HWDB is not set
|
||||
BR2_PACKAGE_SYSTEMD_LOGIND=y
|
||||
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
|
||||
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
|
||||
BR2_PACKAGE_UTIL_LINUX_LOGIN=y
|
||||
BR2_PACKAGE_UTIL_LINUX_NOLOGIN=y
|
||||
BR2_PACKAGE_UTIL_LINUX_PARTX=y
|
||||
BR2_PACKAGE_UTIL_LINUX_SULOGIN=y
|
||||
BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
BR2_TARGET_UBOOT=y
|
||||
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_GIT=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/u-boot/u-boot.git"
|
||||
BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2023.07.02"
|
||||
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="green"
|
||||
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/bootloader/uboot.config $(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/uboot.config"
|
||||
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
|
||||
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="idbloader.img u-boot.itb"
|
||||
BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
|
||||
BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
|
||||
BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
|
||||
BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
|
||||
BR2_TARGET_UBOOT_NEEDS_TPL=y
|
||||
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||
BR2_PACKAGE_HOST_E2FSPROGS=y
|
||||
BR2_PACKAGE_HOST_GPTFDISK=y
|
||||
BR2_PACKAGE_HOST_MTOOLS=y
|
||||
BR2_PACKAGE_HOST_RAUC=y
|
||||
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
|
||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
|
||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="$(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/uboot-boot.ush"
|
||||
BR2_PACKAGE_ROCKCHIP_BLOBS=y
|
||||
BR2_PACKAGE_ROCKCHIP_BLOBS_VERSION="b4558da0860ca48bf1a571dd33ccba580b9abe23"
|
||||
BR2_PACKAGE_ROCKCHIP_BLOBS_ATF="bin/rk35/rk3568_bl31_v1.43.elf"
|
||||
BR2_PACKAGE_ROCKCHIP_BLOBS_TPL="bin/rk35/rk3566_ddr_1056MHz_v1.18.bin"
|
||||
BR2_PACKAGE_GASKET=y
|
||||
BR2_PACKAGE_HASSIO=y
|
||||
BR2_PACKAGE_HASSIO_ARCH="aarch64"
|
||||
BR2_PACKAGE_HASSIO_MACHINE="green"
|
||||
BR2_PACKAGE_OS_AGENT=y
|
||||
BR2_PACKAGE_OS_AGENT_BOARD="Green"
|
||||
BR2_PACKAGE_RPI_RF_MOD=y
|
||||
BR2_PACKAGE_RTL88X2BU=y
|
||||
BR2_PACKAGE_RTL8821CU=y
|
||||
BR2_PACKAGE_HOST_TEMPIO=y
|
||||
BR2_PACKAGE_UDISKS2=y
|
||||
BR2_PACKAGE_V4L2LOOPBACK=y
|
@ -1,7 +1,7 @@
|
||||
From 08264b26ac568035ff04bcccc5c47d4a5d50f93b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <08264b26ac568035ff04bcccc5c47d4a5d50f93b.1688490481.git.stefan@agner.ch>
|
||||
In-Reply-To: <d388735d551e09b00317a509859fca51776b9826.1688490481.git.stefan@agner.ch>
|
||||
References: <d388735d551e09b00317a509859fca51776b9826.1688490481.git.stefan@agner.ch>
|
||||
From c23703defb6008dde794e198abeaf2de008fe7ae Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c23703defb6008dde794e198abeaf2de008fe7ae.1691152222.git.stefan@agner.ch>
|
||||
In-Reply-To: <ea06f0028a835c4cafda535f6a36b0d63035fd4c.1691152222.git.stefan@agner.ch>
|
||||
References: <ea06f0028a835c4cafda535f6a36b0d63035fd4c.1691152222.git.stefan@agner.ch>
|
||||
From: Aurelien Jarno <aurelien@aurel32.net>
|
||||
Date: Mon, 28 Nov 2022 19:47:17 +0100
|
||||
Subject: [PATCH] hwrng: add Rockchip SoC hwrng driver
|
@ -1,7 +1,7 @@
|
||||
From 8bb36ab21d6c44a8a0d690b3c9df3d5efe2f3685 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <8bb36ab21d6c44a8a0d690b3c9df3d5efe2f3685.1688490481.git.stefan@agner.ch>
|
||||
In-Reply-To: <d388735d551e09b00317a509859fca51776b9826.1688490481.git.stefan@agner.ch>
|
||||
References: <d388735d551e09b00317a509859fca51776b9826.1688490481.git.stefan@agner.ch>
|
||||
From f53dcb8fc3aeaa2b633d6a37086088add896149a Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <f53dcb8fc3aeaa2b633d6a37086088add896149a.1691152222.git.stefan@agner.ch>
|
||||
In-Reply-To: <ea06f0028a835c4cafda535f6a36b0d63035fd4c.1691152222.git.stefan@agner.ch>
|
||||
References: <ea06f0028a835c4cafda535f6a36b0d63035fd4c.1691152222.git.stefan@agner.ch>
|
||||
From: Aurelien Jarno <aurelien@aurel32.net>
|
||||
Date: Mon, 28 Nov 2022 19:47:18 +0100
|
||||
Subject: [PATCH] arm64: dts: rockchip: add DT entry for RNG to RK356x
|
||||
@ -14,10 +14,10 @@ Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
|
||||
index 164708f1eb67..4be94ff45180 100644
|
||||
index 1d423daae971..2b26031de7f5 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
|
||||
@@ -1770,6 +1770,15 @@ usb2phy1_otg: otg-port {
|
||||
@@ -1771,6 +1771,15 @@ usb2phy1_otg: otg-port {
|
||||
};
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 1ad5bd5a1d8e83728745e3e12e620061f8281f19 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <1ad5bd5a1d8e83728745e3e12e620061f8281f19.1688490481.git.stefan@agner.ch>
|
||||
In-Reply-To: <d388735d551e09b00317a509859fca51776b9826.1688490481.git.stefan@agner.ch>
|
||||
References: <d388735d551e09b00317a509859fca51776b9826.1688490481.git.stefan@agner.ch>
|
||||
From 9a6bfcbf61975293991f44b1b319eb9731b85768 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9a6bfcbf61975293991f44b1b319eb9731b85768.1691152222.git.stefan@agner.ch>
|
||||
In-Reply-To: <ea06f0028a835c4cafda535f6a36b0d63035fd4c.1691152222.git.stefan@agner.ch>
|
||||
References: <ea06f0028a835c4cafda535f6a36b0d63035fd4c.1691152222.git.stefan@agner.ch>
|
||||
From: Aurelien Jarno <aurelien@aurel32.net>
|
||||
Date: Mon, 28 Nov 2022 19:47:16 +0100
|
||||
Subject: [PATCH] dt-bindings: RNG: Add Rockchip RNG bindings
|
@ -6,9 +6,9 @@ if [ -z "$1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
defconfigs=(buildroot-external/configs/{generic_aarch64,generic_x86_64,ova,tinker,odroid_*,khadas_vim3}_defconfig)
|
||||
defconfigs=(buildroot-external/configs/{generic_aarch64,generic_x86_64,ova,tinker,odroid_*,khadas_vim3,green}_defconfig)
|
||||
sed -i "s/BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE=\".*\"/BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE=\"$1\"/g" "${defconfigs[@]}"
|
||||
sed -i "s/| \(Open Virtual Appliance\|Generic aarch64\|Generic x86-64\|Tinker Board\|ODROID-.*\|Khadas VIM3\|\) | .* |/| \1 | $1 |/g" Documentation/kernel.md
|
||||
sed -i "s/| \(Open Virtual Appliance\|Generic aarch64\|Generic x86-64\|Tinker Board\|ODROID-.*\|Khadas VIM3\|Home Assistant Green\) | .* |/| \1 | $1 |/g" Documentation/kernel.md
|
||||
git commit -m "Linux: Update kernel $1" "${defconfigs[@]}" Documentation/kernel.md
|
||||
|
||||
./scripts/check-kernel-patches.sh
|
||||
|
Loading…
x
Reference in New Issue
Block a user