Skip to content

Commit

Permalink
Merge branch '2019-11-07-ti-imports'
Browse files Browse the repository at this point in the history
- LogicPD platform fixes
- Adaptive Voltage Scaling (AVS) support
- Minor bugfixes
  • Loading branch information
trini committed Nov 8, 2019
2 parents 0be2ecd + 72077fe commit 3f2d4bf
Show file tree
Hide file tree
Showing 27 changed files with 1,255 additions and 2 deletions.
27 changes: 27 additions & 0 deletions arch/arm/dts/k3-am654-r5-base-board.dts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@
u-boot,dm-spl;
};

wkup_vtm0: wkup_vtm@42050000 {
compatible = "ti,am654-vtm", "ti,am654-avs";
reg = <0x42050000 0x25c>;
power-domains = <&k3_pds 80>;
#thermal-sensor-cells = <1>;
};

clk_200mhz: dummy_clock {
compatible = "fixed-clock";
#clock-cells = <0>;
Expand Down Expand Up @@ -131,6 +138,12 @@
power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
};

&wkup_vtm0 {
vdd-supply-3 = <&vdd_mpu>;
vdd-supply-4 = <&vdd_mpu>;
u-boot,dm-spl;
};

&wkup_pmx0 {
u-boot,dm-spl;
wkup_uart0_pins_default: wkup_uart0_pins_default {
Expand Down Expand Up @@ -211,4 +224,18 @@
pinctrl-names = "default";
pinctrl-0 = <&wkup_i2c0_pins_default>;
clock-frequency = <400000>;
u-boot,dm-spl;

vdd_mpu: tps62363@60 {
compatible = "ti,tps62363";
reg = <0x60>;
regulator-name = "VDD_MPU";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1770000>;
regulator-always-on;
regulator-boot-on;
ti,vsel0-state-high;
ti,vsel1-state-high;
u-boot,dm-spl;
};
};
11 changes: 11 additions & 0 deletions arch/arm/dts/k3-j721e-mcu-wakeup.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
clock-names = "fclk";
};

wkup_i2c0: i2c@42120000 {
compatible = "ti,j721e-i2c", "ti,omap4-i2c";
reg = <0x0 0x42120000 0x0 0x100>;
interrupts = <GIC_SPI 896 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
clock-names = "fck";
clocks = <&k3_clks 197 0>;
power-domains = <&k3_pds 197 TI_SCI_PD_EXCLUSIVE>;
};

mcu_uart0: serial@40a00000 {
compatible = "ti,j721e-uart", "ti,am654-uart";
reg = <0x00 0x40a00000 0x00 0x100>;
Expand Down
44 changes: 44 additions & 0 deletions arch/arm/dts/k3-j721e-r5-common-proc-board.dts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
mboxes= <&mcu_secproxy 4>, <&mcu_secproxy 5>;
mbox-names = "tx", "rx";
};

wkup_vtm0: wkup_vtm@42040000 {
compatible = "ti,am654-vtm", "ti,j721e-avs";
reg = <0x0 0x42040000 0x0 0x330>;
power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
#thermal-sensor-cells = <1>;
};
};

&dmsc {
Expand Down Expand Up @@ -86,6 +93,13 @@
J721E_WKUP_IOPAD(0xe0, PIN_OUTPUT, 0) /* (G29) WKUP_GPIO0_12.MCU_UART0_TXD */
>;
};

wkup_i2c0_pins_default: wkup-i2c0-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0xf8, PIN_INPUT_PULLUP, 0) /* (J25) WKUP_I2C0_SCL */
J721E_WKUP_IOPAD(0xfc, PIN_INPUT_PULLUP, 0) /* (H24) WKUP_I2C0_SDA */
>;
};
};

&main_pmx0 {
Expand Down Expand Up @@ -140,4 +154,34 @@
ti,driver-strength-ohm = <50>;
};

&wkup_i2c0 {
u-boot,dm-spl;
tps659413a: tps659413a@48 {
reg = <0x48>;
compatible = "ti,tps659413";
u-boot,dm-spl;
pinctrl-names = "default";
pinctrl-0 = <&wkup_i2c0_pins_default>;
clock-frequency = <400000>;

regulators: regulators {
u-boot,dm-spl;
buck12_reg: buck12 {
/*VDD_MPU*/
regulator-name = "buck12";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1250000>;
regulator-always-on;
regulator-boot-on;
u-boot,dm-spl;
};
};
};
};

&wkup_vtm0 {
vdd-supply-2 = <&buck12_reg>;
u-boot,dm-spl;
};

#include "k3-j721e-common-proc-board-u-boot.dtsi"
20 changes: 20 additions & 0 deletions arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@
};
};

&gpio1 {
/delete-property/ u-boot,dm-spl;
};

&gpio2 {
/delete-property/ u-boot,dm-spl;
};

&gpio3 {
/delete-property/ u-boot,dm-spl;
};

&gpio5 {
/delete-property/ u-boot,dm-spl;
};

&gpio6 {
/delete-property/ u-boot,dm-spl;
};

&i2c1 {
clock-frequency = <400000>;
};
Expand Down
20 changes: 20 additions & 0 deletions arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@
clock-frequency = <400000>;
};

&gpio1 {
/delete-property/ u-boot,dm-spl;
};

&gpio2 {
/delete-property/ u-boot,dm-spl;
};

&gpio3 {
/delete-property/ u-boot,dm-spl;
};

&gpio5 {
/delete-property/ u-boot,dm-spl;
};

&gpio6 {
/delete-property/ u-boot,dm-spl;
};

/delete-node/ &uart2;
/delete-node/ &uart3;
/delete-node/ &mmc2;
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-k3/am6_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ void board_init_f(ulong dummy)
/* Perform EEPROM-based board detection */
do_board_detect();

#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
&dev);
if (ret)
printf("AVS init failed: %d\n", ret);
#endif

#ifdef CONFIG_K3_AM654_DDRSS
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret)
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-k3/j721e_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ void board_init_f(ulong dummy)
preloader_console_init();
#endif

#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
&dev);
if (ret)
printf("AVS init failed: %d\n", ret);
#endif

#if defined(CONFIG_K3_J721E_DDRSS)
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret)
Expand Down
1 change: 1 addition & 0 deletions board/logicpd/omap3som/omap3logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void spl_board_prepare_for_linux(void)
int misc_init_r(void)
{
twl4030_power_init();
twl4030_power_mmc_init(0);
omap_die_id_display();
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions board/ti/common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ config EEPROM_BUS_ADDRESS
int "Board EEPROM's I2C bus address"
range 0 8
default 0
depends on TI_I2C_BOARD_DETECT

config EEPROM_CHIP_ADDRESS
hex "Board EEPROM's I2C chip address"
range 0 0xff
default 0x50
depends on TI_I2C_BOARD_DETECT

config TI_COMMON_CMD_OPTIONS
bool "Enable cmd options on TI platforms"
Expand Down
2 changes: 2 additions & 0 deletions configs/am65x_evm_r5_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ CONFIG_DM_REGULATOR=y
CONFIG_SPL_DM_REGULATOR=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_SPL_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_TPS62360=y
CONFIG_RAM=y
CONFIG_SPL_RAM=y
CONFIG_K3_SYSTEM_CONTROLLER=y
Expand All @@ -98,3 +99,4 @@ CONFIG_TIMER=y
CONFIG_SPL_TIMER=y
CONFIG_OMAP_TIMER=y
CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
CONFIG_K3_AVS0=y
11 changes: 9 additions & 2 deletions configs/j721e_evm_r5_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ CONFIG_CMD_FAT=y
CONFIG_OF_CONTROL=y
CONFIG_SPL_OF_CONTROL=y
CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board"
CONFIG_SPL_MULTI_DTB_FIT=y
CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
CONFIG_DM=y
CONFIG_SPL_DM=y
CONFIG_SPL_DM_SEQ_ALIAS=y
Expand All @@ -59,10 +57,14 @@ CONFIG_CLK_TI_SCI=y
CONFIG_TI_SCI_PROTOCOL=y
CONFIG_DM_GPIO=y
CONFIG_DA8XX_GPIO=y
CONFIG_DM_I2C=y
CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
CONFIG_SYS_I2C_OMAP24XX=y
CONFIG_DM_MAILBOX=y
CONFIG_K3_SEC_PROXY=y
CONFIG_MISC=y
CONFIG_FS_LOADER=y
CONFIG_K3_AVS0=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_AM654=y
Expand All @@ -75,6 +77,11 @@ CONFIG_SPL_PINCTRL=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_POWER_DOMAIN=y
CONFIG_TI_SCI_POWER_DOMAIN=y
CONFIG_DM_PMIC=y
CONFIG_PMIC_TPS65941=y
CONFIG_DM_REGULATOR=y
CONFIG_SPL_DM_REGULATOR=y
CONFIG_DM_REGULATOR_TPS65941=y
CONFIG_K3_SYSTEM_CONTROLLER=y
CONFIG_REMOTEPROC_TI_K3_ARM64=y
CONFIG_DM_RESET=y
Expand Down
1 change: 1 addition & 0 deletions configs/omap35_logic_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CONFIG_ARM=y
CONFIG_ARCH_OMAP2PLUS=y
CONFIG_SYS_TEXT_BASE=0x80100000
CONFIG_TI_COMMON_CMD_OPTIONS=y
# CONFIG_SPL_GPIO_SUPPORT is not set
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_TARGET_OMAP3_LOGIC=y
# CONFIG_SPL_OMAP3_ID_NAND is not set
Expand Down
1 change: 1 addition & 0 deletions configs/omap3_logic_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CONFIG_ARM=y
CONFIG_ARCH_OMAP2PLUS=y
CONFIG_SYS_TEXT_BASE=0x80100000
CONFIG_TI_COMMON_CMD_OPTIONS=y
# CONFIG_SPL_GPIO_SUPPORT is not set
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_TARGET_OMAP3_LOGIC=y
# CONFIG_SPL_OMAP3_ID_NAND is not set
Expand Down
1 change: 1 addition & 0 deletions configs/omap3_logic_somlv_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CONFIG_ARM=y
CONFIG_ARCH_OMAP2PLUS=y
CONFIG_SYS_TEXT_BASE=0x80100000
CONFIG_TI_COMMON_CMD_OPTIONS=y
# CONFIG_SPL_GPIO_SUPPORT is not set
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_TARGET_OMAP3_LOGIC=y
# CONFIG_SPL_OMAP3_ID_NAND is not set
Expand Down
5 changes: 5 additions & 0 deletions drivers/clk/clk-ti-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <errno.h>
#include <clk-uclass.h>
#include <linux/soc/ti/ti_sci_protocol.h>
#include <k3-avs.h>

/**
* struct ti_sci_clk_data - clock controller information structure
Expand Down Expand Up @@ -101,6 +102,10 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate)

debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);

#ifdef CONFIG_K3_AVS0
k3_avs_notify_freq(clk->id, clk->data, rate);
#endif

/* Ask for exact frequency by using same value for min/target/max */
ret = cops->set_freq(sci, clk->id, clk->data, rate, rate, rate);
if (ret)
Expand Down
9 changes: 9 additions & 0 deletions drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,13 @@ config MICROCHIP_FLEXCOM
Only one function can be used at a time and is chosen at boot time
according to the device tree.

config K3_AVS0
depends on ARCH_K3 && SPL_DM_REGULATOR
bool "AVS class 0 support for K3 devices"
help
K3 devices have the optimized voltage values for the main voltage
domains stored in efuse within the VTM IP. This driver reads the
optimized voltage from the efuse, so that it can be programmed
to the PMIC on board.

endmenu
1 change: 1 addition & 0 deletions drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress_config.o
obj-$(CONFIG_WINBOND_W83627) += winbond_w83627.o
obj-$(CONFIG_JZ4780_EFUSE) += jz4780_efuse.o
obj-$(CONFIG_MICROCHIP_FLEXCOM) += microchip_flexcom.o
obj-$(CONFIG_K3_AVS0) += k3_avs.o
Loading

0 comments on commit 3f2d4bf

Please sign in to comment.