Part Number: TDA4VM
Hi, TI expert:
I'm using ti-processor-sdk-linux-j7-evm-08_06_00_11 with ourselves designed board.



before login, have to wait for 2min57s.
what's wrong?
Thanks!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
Since I used our board, i changed the DTS according to our board, then this problem occurred.
What is the difference b/n the TI EVM and your board? Is there any difference in the parts used?
Also, can you share all the changes you made to your board so we can review them?
Thanks.
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com/
*/
/dts-v1/;
#include "k3-j721e-som-p0.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/net/ti-dp83867.h>
#include <dt-bindings/phy/phy-cadence.h>
/ {
chosen {
stdout-path = "serial2:115200n8";
bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
};
gpio_keys: gpio-keys {
compatible = "gpio-keys";
autorepeat;
pinctrl-names = "default";
pinctrl-0 = <&sw10_button_pins_default &sw11_button_pins_default>;
sw10: sw10 {
label = "GPIO Key USER1";
linux,code = <BTN_0>;
gpios = <&main_gpio0 0 GPIO_ACTIVE_LOW>;
};
sw11: sw11 {
label = "GPIO Key USER2";
linux,code = <BTN_1>;
gpios = <&wkup_gpio0 7 GPIO_ACTIVE_LOW>;
};
};
evm_12v0: fixedregulator-evm12v0 {
/* main supply */
compatible = "regulator-fixed";
regulator-name = "evm_12v0";
regulator-min-microvolt = <12000000>;
regulator-max-microvolt = <12000000>;
regulator-always-on;
regulator-boot-on;
};
vsys_3v3: fixedregulator-vsys3v3 {
/* Output of LMS140 */
compatible = "regulator-fixed";
regulator-name = "vsys_3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
vin-supply = <&evm_12v0>;
regulator-always-on;
regulator-boot-on;
};
vsys_5v0: fixedregulator-vsys5v0 {
/* Output of LM5140 */
compatible = "regulator-fixed";
regulator-name = "vsys_5v0";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&evm_12v0>;
regulator-always-on;
regulator-boot-on;
};
vdd_mmc1: fixedregulator-sd {
compatible = "regulator-fixed";
regulator-name = "vdd_mmc1";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
enable-active-high;
vin-supply = <&vsys_3v3>;
//gpio = <&exp2 2 GPIO_ACTIVE_HIGH>;
};
vdd_sd_dv_alt: gpio-regulator-TLV71033 {
compatible = "regulator-gpio";
pinctrl-names = "default";
pinctrl-0 = <&vdd_sd_dv_alt_pins_default>;
regulator-name = "tlv71033";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
vin-supply = <&vsys_5v0>;
gpios = <&main_gpio0 117 GPIO_ACTIVE_HIGH>;
states = <1800000 0x0>,
<3300000 0x1>;
};
sound0: sound@0 {
status = "disabled";
compatible = "ti,j721e-cpb-audio";
model = "j721e-cpb";
ti,cpb-mcasp = <&mcasp10>;
ti,cpb-codec = <&pcm3168a_1>;
clocks = <&k3_clks 184 1>,
<&k3_clks 184 2>, <&k3_clks 184 4>,
<&k3_clks 157 371>,
<&k3_clks 157 400>, <&k3_clks 157 401>;
clock-names = "cpb-mcasp-auxclk",
"cpb-mcasp-auxclk-48000", "cpb-mcasp-auxclk-44100",
"cpb-codec-scki",
"cpb-codec-scki-48000", "cpb-codec-scki-44100";
};
cpsw9g_virt_mac: main_r5fss_cpsw9g_virt_mac0 {
compatible = "ti,j721e-cpsw-virt-mac";
dma-coherent;
ti,psil-base = <0x4a00>;
ti,remote-name = "mpu_1_0_ethswitch-device-0";
dmas = <&main_udmap 0xca00>,
<&main_udmap 0xca01>,
<&main_udmap 0xca02>,
<&main_udmap 0xca03>,
<&main_udmap 0xca04>,
<&main_udmap 0xca05>,
<&main_udmap 0xca06>,
<&main_udmap 0xca07>,
<&main_udmap 0x4a00>;
dma-names = "tx0", "tx1", "tx2", "tx3",
"tx4", "tx5", "tx6", "tx7",
"rx";
virt_emac_port {
ti,label = "virt-port";
/* local-mac-address = [0 0 0 0 0 0]; */
};
};
cpsw9g_virt_maconly: main-r5fss-cpsw9g-virt-mac1 {
compatible = "ti,j721e-cpsw-virt-mac";
dma-coherent;
ti,psil-base = <0x4a00>;
ti,remote-name = "mpu_1_0_ethmac-device-1";
dmas = <&main_udmap 0xca00>,
<&main_udmap 0xca01>,
<&main_udmap 0xca02>,
<&main_udmap 0xca03>,
<&main_udmap 0xca04>,
<&main_udmap 0xca05>,
<&main_udmap 0xca06>,
<&main_udmap 0xca07>,
<&main_udmap 0x4a00>;
dma-names = "tx0", "tx1", "tx2", "tx3",
"tx4", "tx5", "tx6", "tx7",
"rx";
virt_emac_port {
ti,label = "virt-port";
/* local-mac-address = [0 0 0 0 0 0]; */
};
};
transceiver1: can-phy0 {
compatible = "ti,tcan1043";
#phy-cells = <0>;
max-bitrate = <5000000>;
pinctrl-names = "default";
pinctrl-0 = <&mcu_mcan0_gpio_pins_default>;
standby-gpios = <&wkup_gpio0 54 GPIO_ACTIVE_LOW>;
enable-gpios = <&wkup_gpio0 0 GPIO_ACTIVE_HIGH>;
};
transceiver2: can-phy1 {
compatible = "ti,tcan1042";
#phy-cells = <0>;
max-bitrate = <5000000>;
pinctrl-names = "default";
pinctrl-0 = <&mcu_mcan1_gpio_pins_default>;
standby-gpios = <&wkup_gpio0 2 GPIO_ACTIVE_HIGH>;
};
transceiver3: can-phy2 {
compatible = "ti,tcan1043";
#phy-cells = <0>;
max-bitrate = <5000000>;
standby-gpios = <&exp2 7 GPIO_ACTIVE_LOW>;
enable-gpios = <&exp2 6 GPIO_ACTIVE_HIGH>;
};
transceiver4: can-phy3 {
compatible = "ti,tcan1042";
#phy-cells = <0>;
max-bitrate = <5000000>;
pinctrl-names = "default";
pinctrl-0 = <&main_mcan2_gpio_pins_default>;
standby-gpios = <&main_gpio0 127 GPIO_ACTIVE_HIGH>;
};
dp_pwr_3v3: fixedregulator-dp-prw {
compatible = "regulator-fixed";
regulator-name = "dp-pwr";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&exp4 0 0>; /* P0 - DP0_PWR_SW_EN */
enable-active-high;
/* Always on for now, until dp-connector driver can handle this */
regulator-always-on;
};
dp0: connector {
compatible = "dp-connector";
label = "DP0";
type = "full-size";
dp-pwr-supply = <&dp_pwr_3v3>;
port {
dp_connector_in: endpoint {
remote-endpoint = <&dp0_out>;
};
};
};
};
&main_pmx0 {
sw10_button_pins_default: sw10-button-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x0, PIN_INPUT, 7) /* (AC18) EXTINTn.GPIO0_0 */
>;
};
main_mmc1_pins_default: main-mmc1-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x254, PIN_INPUT, 0) /* (R29) MMC1_CMD */
J721E_IOPAD(0x250, PIN_INPUT, 0) /* (P25) MMC1_CLK */
J721E_IOPAD(0x2ac, PIN_INPUT, 0) /* (P25) MMC1_CLKLB */
J721E_IOPAD(0x24c, PIN_INPUT, 0) /* (R24) MMC1_DAT0 */
J721E_IOPAD(0x248, PIN_INPUT, 0) /* (P24) MMC1_DAT1 */
J721E_IOPAD(0x244, PIN_INPUT, 0) /* (R25) MMC1_DAT2 */
J721E_IOPAD(0x240, PIN_INPUT, 0) /* (R26) MMC1_DAT3 */
J721E_IOPAD(0x258, PIN_INPUT, 0) /* (P23) MMC1_SDCD */
J721E_IOPAD(0x25c, PIN_INPUT, 0) /* (R28) MMC1_SDWP */
>;
};
vdd_sd_dv_alt_pins_default: vdd-sd-dv-alt-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x1d8, PIN_INPUT, 7) /* (W4) SPI1_CS1.GPIO0_117 */
>;
};
main_usbss0_pins_default: main-usbss0-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x290, PIN_OUTPUT, 0) /* (U6) USB0_DRVVBUS */
J721E_IOPAD(0x210, PIN_INPUT, 7) /* (W3) MCAN1_RX.GPIO1_3 */
>;
};
main_usbss1_pins_default: main-usbss1-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x214, PIN_OUTPUT, 4) /* (V4) MCAN1_TX.USB1_DRVVBUS */
>;
};
dp0_pins_default: dp0-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x1c4, PIN_INPUT, 5) /* SPI0_CS1.DP0_HPD */
>;
};
main_i2c1_exp4_pins_default: main-i2c1-exp4-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x230, PIN_INPUT, 7) /* (U2) ECAP0_IN_APWM_OUT.GPIO1_11 */
>;
};
main_i2c0_pins_default: main-i2c0-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x220, PIN_INPUT_PULLUP, 0) /* (AC5) I2C0_SCL */
J721E_IOPAD(0x224, PIN_INPUT_PULLUP, 0) /* (AA5) I2C0_SDA */
>;
};
main_i2c1_pins_default: main-i2c1-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x228, PIN_INPUT_PULLUP, 0) /* (Y6) I2C1_SCL */
J721E_IOPAD(0x22c, PIN_INPUT_PULLUP, 0) /* (AA6) I2C1_SDA */
>;
};
main_i2c2_pins_default: main-i2c2-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x1c8, PIN_INPUT_PULLUP, 2) /* (AB5) SPI0_CLK.I2C2_SCL */
J721E_IOPAD(0x1cc, PIN_INPUT_PULLUP, 2) /* (AA1) SPI0_D0.I2C2_SDA */
>;
};
main_i2c3_pins_default: main-i2c3-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x270, PIN_INPUT_PULLUP, 4) /* (T26) MMC2_CLK.I2C3_SCL */
J721E_IOPAD(0x274, PIN_INPUT_PULLUP, 4) /* (T25) MMC2_CMD.I2C3_SDA */
>;
};
main_i2c6_pins_default: main-i2c6-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x1d0, PIN_INPUT_PULLUP, 2) /* (AA3) SPI0_D1.I2C6_SCL */
J721E_IOPAD(0x1e4, PIN_INPUT_PULLUP, 2) /* (Y2) SPI1_D1.I2C6_SDA */
>;
};
mcasp10_pins_default: mcasp10-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x158, PIN_OUTPUT_PULLDOWN, 12) /* (U23) RGMII5_TX_CTL.MCASP10_ACLKX */
J721E_IOPAD(0x15c, PIN_OUTPUT_PULLDOWN, 12) /* (U26) RGMII5_RX_CTL.MCASP10_AFSX */
J721E_IOPAD(0x160, PIN_OUTPUT_PULLDOWN, 12) /* (V28) RGMII5_TD3.MCASP10_AXR0 */
J721E_IOPAD(0x164, PIN_OUTPUT_PULLDOWN, 12) /* (V29) RGMII5_TD2.MCASP10_AXR1 */
J721E_IOPAD(0x170, PIN_OUTPUT_PULLDOWN, 12) /* (U29) RGMII5_TXC.MCASP10_AXR2 */
J721E_IOPAD(0x174, PIN_OUTPUT_PULLDOWN, 12) /* (U25) RGMII5_RXC.MCASP10_AXR3 */
J721E_IOPAD(0x198, PIN_INPUT_PULLDOWN, 12) /* (V25) RGMII6_TD1.MCASP10_AXR4 */
J721E_IOPAD(0x19c, PIN_INPUT_PULLDOWN, 12) /* (W27) RGMII6_TD0.MCASP10_AXR5 */
J721E_IOPAD(0x1a0, PIN_INPUT_PULLDOWN, 12) /* (W29) RGMII6_TXC.MCASP10_AXR6 */
>;
};
audi_ext_refclk2_pins_default: audi-ext-refclk2-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x1a4, PIN_OUTPUT, 3) /* (W26) RGMII6_RXC.AUDIO_EXT_REFCLK2 */
>;
};
main_mcan0_pins_default: main-mcan0-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x208, PIN_INPUT, 0) /* (W5) MCAN0_RX */
J721E_IOPAD(0x20c, PIN_OUTPUT, 0) /* (W6) MCAN0_TX */
>;
};
main_mcan2_pins_default: main-mcan2-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x01f0, PIN_INPUT, 3) /* (AC2) MCAN2_RX.GPIO0_123 */
J721E_IOPAD(0x01f4, PIN_OUTPUT, 3) /* (AB1) MCAN2_TX.GPIO0_124 */
>;
};
main_mcan2_gpio_pins_default: main-mcan2-gpio-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x200, PIN_INPUT, 7) /* (AC4) UART1_CTSn.GPIO0_127 */
>;
};
};
&wkup_pmx0 {
sw11_button_pins_default: sw11-button-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0xcc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
>;
};
mcu_fss0_ospi1_pins_default: mcu-fss0-ospi1-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0x34, PIN_OUTPUT, 0) /* (F22) MCU_OSPI1_CLK */
J721E_WKUP_IOPAD(0x50, PIN_OUTPUT, 0) /* (C22) MCU_OSPI1_CSn0 */
J721E_WKUP_IOPAD(0x40, PIN_INPUT, 0) /* (D22) MCU_OSPI1_D0 */
J721E_WKUP_IOPAD(0x44, PIN_INPUT, 0) /* (G22) MCU_OSPI1_D1 */
J721E_WKUP_IOPAD(0x48, PIN_INPUT, 0) /* (D23) MCU_OSPI1_D2 */
J721E_WKUP_IOPAD(0x4c, PIN_INPUT, 0) /* (C23) MCU_OSPI1_D3 */
J721E_WKUP_IOPAD(0x3c, PIN_INPUT, 0) /* (B23) MCU_OSPI1_DQS */
J721E_WKUP_IOPAD(0x38, PIN_INPUT, 0) /* (A23) MCU_OSPI1_LBCLKO */
>;
};
mcu_cpsw_pins_default: mcu-cpsw-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0x0058, PIN_OUTPUT, 0) /* MCU_RGMII1_TX_CTL */
J721E_WKUP_IOPAD(0x005c, PIN_INPUT, 0) /* MCU_RGMII1_RX_CTL */
J721E_WKUP_IOPAD(0x0060, PIN_OUTPUT, 0) /* MCU_RGMII1_TD3 */
J721E_WKUP_IOPAD(0x0064, PIN_OUTPUT, 0) /* MCU_RGMII1_TD2 */
J721E_WKUP_IOPAD(0x0068, PIN_OUTPUT, 0) /* MCU_RGMII1_TD1 */
J721E_WKUP_IOPAD(0x006c, PIN_OUTPUT, 0) /* MCU_RGMII1_TD0 */
J721E_WKUP_IOPAD(0x0078, PIN_INPUT, 0) /* MCU_RGMII1_RD3 */
J721E_WKUP_IOPAD(0x007c, PIN_INPUT, 0) /* MCU_RGMII1_RD2 */
J721E_WKUP_IOPAD(0x0080, PIN_INPUT, 0) /* MCU_RGMII1_RD1 */
J721E_WKUP_IOPAD(0x0084, PIN_INPUT, 0) /* MCU_RGMII1_RD0 */
J721E_WKUP_IOPAD(0x0070, PIN_OUTPUT, 0) /* MCU_RGMII1_TXC */
J721E_WKUP_IOPAD(0x0074, PIN_INPUT, 0) /* MCU_RGMII1_RXC */
>;
};
mcu_mdio_pins_default: mcu-mdio1-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0x008c, PIN_OUTPUT, 0) /* MCU_MDIO0_MDC */
J721E_WKUP_IOPAD(0x0088, PIN_INPUT, 0) /* MCU_MDIO0_MDIO */
>;
};
mcu_mcan0_pins_default: mcu-mcan0-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0xac, PIN_INPUT, 0) /* (C29) MCU_MCAN0_RX */
J721E_WKUP_IOPAD(0xa8, PIN_OUTPUT, 0) /* (D29) MCU_MCAN0_TX */
>;
};
mcu_mcan0_gpio_pins_default: mcu-mcan0-gpio-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0xb0, PIN_INPUT, 7) /* (F26) WKUP_GPIO0_0 */
J721E_WKUP_IOPAD(0x98, PIN_INPUT, 7) /* (E28) MCU_SPI0_D1.WKUP_GPIO0_54 */
>;
};
mcu_mcan1_pins_default: mcu-mcan1-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0xc4, PIN_INPUT, 0) /* (G24) WKUP_GPIO0_5.MCU_MCAN1_RX */
J721E_WKUP_IOPAD(0xc0, PIN_OUTPUT, 0) /* (G25) WKUP_GPIO0_4.MCU_MCAN1_TX */
>;
};
mcu_mcan1_gpio_pins_default: mcu-mcan1-gpio-pins-default {
pinctrl-single,pins = <
J721E_WKUP_IOPAD(0xb8, PIN_INPUT, 7) /* (F28) WKUP_GPIO0_2 */
>;
};
};
&wkup_uart0 {
/* Wakeup UART is used by System firmware */
status = "reserved";
};
&main_uart0 {
power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
};
&main_uart3 {
/* UART not brought out */
status = "disabled";
};
&main_uart5 {
/* UART not brought out */
status = "disabled";
};
&main_uart6 {
/* UART not brought out */
status = "disabled";
};
&main_uart7 {
/* UART not brought out */
status = "disabled";
};
&main_uart8 {
/* UART not brought out */
status = "disabled";
};
&main_uart9 {
/* UART not brought out */
status = "disabled";
};
&main_gpio2 {
status = "disabled";
};
&main_gpio3 {
status = "disabled";
};
&main_gpio4 {
status = "disabled";
};
&main_gpio5 {
status = "disabled";
};
&main_gpio6 {
status = "disabled";
};
&main_gpio7 {
status = "disabled";
};
&wkup_gpio1 {
status = "disabled";
};
&main_sdhci0 {
/* eMMC */
non-removable;
ti,driver-strength-ohm = <50>;
disable-wp;
};
&main_sdhci1 {
/* SD/MMC */
vmmc-supply = <&vdd_mmc1>;
vqmmc-supply = <&vdd_sd_dv_alt>;
pinctrl-names = "default";
pinctrl-0 = <&main_mmc1_pins_default>;
ti,driver-strength-ohm = <50>;
disable-wp;
};
&main_sdhci2 {
/* Unused */
status = "disabled";
};
&usb_serdes_mux {
idle-states = <1>, <0>; /* USB0 to SERDES3, USB1 to SERDES1 */
};
&serdes_ln_ctrl {
idle-states = <J721E_SERDES0_LANE0_PCIE0_LANE0>, <J721E_SERDES0_LANE1_QSGMII_LANE2>,
<J721E_SERDES1_LANE0_PCIE1_LANE0>, <J721E_SERDES1_LANE1_PCIE1_LANE1>,
<J721E_SERDES2_LANE0_PCIE2_LANE0>, <J721E_SERDES2_LANE1_PCIE2_LANE1>,
<J721E_SERDES3_LANE0_USB3_0_SWAP>, <J721E_SERDES3_LANE1_USB3_0>,
<J721E_SERDES4_LANE0_EDP_LANE0>, <J721E_SERDES4_LANE1_EDP_LANE1>,
<J721E_SERDES4_LANE2_EDP_LANE2>, <J721E_SERDES4_LANE3_EDP_LANE3>;
};
&serdes_wiz3 {
typec-dir-gpios = <&main_gpio1 3 GPIO_ACTIVE_HIGH>;
typec-dir-debounce-ms = <700>; /* TUSB321, tCCB_DEFAULT 133 ms */
};
&serdes3 {
serdes3_usb_link: phy@0 {
reg = <0>;
cdns,num-lanes = <2>;
#phy-cells = <0>;
cdns,phy-type = <PHY_TYPE_USB3>;
resets = <&serdes_wiz3 1>, <&serdes_wiz3 2>;
};
};
&usbss0 {
pinctrl-names = "default";
pinctrl-0 = <&main_usbss0_pins_default>;
ti,vbus-divider;
};
&usb0 {
dr_mode = "otg";
maximum-speed = "super-speed";
phys = <&serdes3_usb_link>;
phy-names = "cdns3,usb3-phy";
};
&usbss1 {
pinctrl-names = "default";
pinctrl-0 = <&main_usbss1_pins_default>;
ti,usb2-only;
};
&usb1 {
dr_mode = "host";
maximum-speed = "high-speed";
};
&ospi1 {
pinctrl-names = "default";
pinctrl-0 = <&mcu_fss0_ospi1_pins_default>;
flash@0{
compatible = "jedec,spi-nor";
reg = <0x0>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <4>;
spi-max-frequency = <40000000>;
cdns,tshsl-ns = <60>;
cdns,tsd2d-ns = <60>;
cdns,tchsh-ns = <60>;
cdns,tslch-ns = <60>;
cdns,read-delay = <2>;
#address-cells = <1>;
#size-cells = <1>;
};
};
&tscadc0 {
adc {
ti,adc-channels = <0 1 2 3 4 5 6 7>;
};
};
&tscadc1 {
adc {
ti,adc-channels = <0 1 2 3 4 5 6 7>;
};
};
&main_i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c0_pins_default>;
clock-frequency = <400000>;
rtc@6f {
compatible = "microchip,mcp7941x";
reg = <0x6f>;
};
exp2: gpio@22 {
compatible = "ti,tca6424";
reg = <0x22>;
gpio-controller;
#gpio-cells = <2>;
//p08-hog {
/* P10 - PM_I2C_CTRL_OE */
// gpio-hog;
// gpios = <8 GPIO_ACTIVE_HIGH>;
// output-high;
// line-name = "CTRL_PM_I2C_OE";
//};
//p09-hog {
/* P11 - MCASP/TRACE_MUX_S0 */
// gpio-hog;
// gpios = <9 GPIO_ACTIVE_HIGH>;
// output-low;
// line-name = "MCASP/TRACE_MUX_S0";
//};
//p10-hog {
// /* P12 - MCASP/TRACE_MUX_S1 */
// gpio-hog;
// gpios = <10 GPIO_ACTIVE_HIGH>;
// output-high;
// line-name = "MCASP/TRACE_MUX_S1";
//};
};
};
&main_i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c1_pins_default>;
clock-frequency = <400000>;
exp4: gpio@20 {
compatible = "ti,tca6408";
reg = <0x20>;
gpio-controller;
#gpio-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&main_i2c1_exp4_pins_default>;
interrupt-parent = <&main_gpio1>;
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
};
};
&main_i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c2_pins_default>;
clock-frequency = <400000>;
exp2: gpio@22 {
compatible = "ti,tca6424";
reg = <0x22>;
gpio-controller;
#gpio-cells = <2>;
};
};
&k3_clks {
/* Confiure AUDIO_EXT_REFCLK2 pin as output */
pinctrl-names = "default";
pinctrl-0 = <&audi_ext_refclk2_pins_default>;
};
&main_i2c3 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c3_pins_default>;
clock-frequency = <400000>;
exp3: gpio@20 {
compatible = "ti,tca6408";
reg = <0x20>;
gpio-controller;
#gpio-cells = <2>;
};
pcm3168a_1: audio-codec@44 {
compatible = "ti,pcm3168a";
reg = <0x44>;
#sound-dai-cells = <1>;
reset-gpios = <&exp3 0 GPIO_ACTIVE_LOW>;
/* C_AUDIO_REFCLK2 -> RGMII6_RXC (W26) */
clocks = <&k3_clks 157 371>;
clock-names = "scki";
/* HSDIV3_16FFT_MAIN_4_HSDIVOUT2_CLK -> REFCLK2 */
assigned-clocks = <&k3_clks 157 371>;
assigned-clock-parents = <&k3_clks 157 400>;
assigned-clock-rates = <24576000>; /* for 48KHz */
VDD1-supply = <&vsys_3v3>;
VDD2-supply = <&vsys_3v3>;
VCCAD1-supply = <&vsys_5v0>;
VCCAD2-supply = <&vsys_5v0>;
VCCDA1-supply = <&vsys_5v0>;
VCCDA2-supply = <&vsys_5v0>;
};
};
&main_i2c6 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c6_pins_default>;
clock-frequency = <400000>;
exp5: gpio@20 {
compatible = "ti,tca6408";
reg = <0x20>;
gpio-controller;
#gpio-cells = <2>;
};
};
&mcu_cpsw {
pinctrl-names = "default";
pinctrl-0 = <&mcu_cpsw_pins_default &mcu_mdio_pins_default>;
};
&davinci_mdio {
phy0: ethernet-phy@0 {
reg = <0>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
};
};
&cpsw_port1 {
phy-mode = "rgmii-rxid";
phy-handle = <&phy0>;
};
&dss {
/*
* These clock assignments are chosen to enable the following outputs:
*
* VP0 - DisplayPort SST
* VP1 - DPI0
* VP2 - DSI
* VP3 - DPI1
*/
assigned-clocks = <&k3_clks 152 1>,
<&k3_clks 152 4>,
<&k3_clks 152 9>,
<&k3_clks 152 13>;
assigned-clock-parents = <&k3_clks 152 2>, /* PLL16_HSDIV0 */
<&k3_clks 152 6>, /* PLL19_HSDIV0 */
<&k3_clks 152 11>, /* PLL18_HSDIV0 */
<&k3_clks 152 18>; /* PLL23_HSDIV0 */
};
&dss_ports {
port@0 {
reg = <0>;
dpi0_out: endpoint {
remote-endpoint = <&dp0_in>;
};
};
};
&mhdp {
pinctrl-names = "default";
pinctrl-0 = <&dp0_pins_default>;
};
&dp0_ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dp0_in: endpoint {
remote-endpoint = <&dpi0_out>;
};
};
port@4 {
reg = <4>;
dp0_out: endpoint {
remote-endpoint = <&dp_connector_in>;
};
};
};
&mcasp0 {
status = "disabled";
};
&mcasp1 {
status = "disabled";
};
&mcasp2 {
status = "disabled";
};
&mcasp3 {
status = "disabled";
};
&mcasp4 {
status = "disabled";
};
&mcasp5 {
status = "disabled";
};
&mcasp6 {
status = "disabled";
};
&mcasp7 {
status = "disabled";
};
&mcasp8 {
status = "disabled";
};
&mcasp9 {
status = "disabled";
};
&mcasp10 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&mcasp10_pins_default>;
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
auxclk-fs-ratio = <256>;
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
1 1 1 1
2 2 2 0
>;
tx-num-evt = <0>;
rx-num-evt = <0>;
};
&mcasp11 {
status = "disabled";
};
&cmn_refclk1 {
clock-frequency = <100000000>;
};
&wiz0_pll1_refclk {
assigned-clocks = <&wiz0_pll1_refclk>;
assigned-clock-parents = <&cmn_refclk1>;
};
&wiz0_refclk_dig {
assigned-clocks = <&wiz0_refclk_dig>;
assigned-clock-parents = <&cmn_refclk1>;
};
&wiz1_pll1_refclk {
assigned-clocks = <&wiz1_pll1_refclk>;
assigned-clock-parents = <&cmn_refclk1>;
};
&wiz1_refclk_dig {
assigned-clocks = <&wiz1_refclk_dig>;
assigned-clock-parents = <&cmn_refclk1>;
};
&wiz2_pll1_refclk {
assigned-clocks = <&wiz2_pll1_refclk>;
assigned-clock-parents = <&cmn_refclk1>;
};
&wiz2_refclk_dig {
assigned-clocks = <&wiz2_refclk_dig>;
assigned-clock-parents = <&cmn_refclk1>;
};
&cmn_refclk1 {
clock-frequency = <100000000>;
};
&serdes0 {
assigned-clocks = <&serdes0 CDNS_SIERRA_PLL_CMNLC>, <&serdes0 CDNS_SIERRA_PLL_CMNLC1>;
assigned-clock-parents = <&wiz0_pll1_refclk>, <&wiz0_pll1_refclk>;
serdes0_pcie_link: phy@0 {
reg = <0>;
cdns,num-lanes = <1>;
#phy-cells = <0>;
cdns,phy-type = <PHY_TYPE_PCIE>;
resets = <&serdes_wiz0 1>;
};
serdes0_qsgmii_link: phy@1 {
reg = <1>;
cdns,num-lanes = <1>;
#phy-cells = <0>;
cdns,phy-type = <PHY_TYPE_QSGMII>;
resets = <&serdes_wiz0 2>;
};
};
&serdes1 {
assigned-clocks = <&serdes1 CDNS_SIERRA_PLL_CMNLC>;
assigned-clock-parents = <&wiz1_pll1_refclk>;
serdes1_pcie_link: phy@0 {
reg = <0>;
cdns,num-lanes = <2>;
#phy-cells = <0>;
cdns,phy-type = <PHY_TYPE_PCIE>;
resets = <&serdes_wiz1 1>, <&serdes_wiz1 2>;
};
};
&serdes2 {
assigned-clocks = <&serdes2 CDNS_SIERRA_PLL_CMNLC>;
assigned-clock-parents = <&wiz2_pll1_refclk>;
serdes2_pcie_link: phy@0 {
reg = <0>;
cdns,num-lanes = <2>;
#phy-cells = <0>;
cdns,phy-type = <PHY_TYPE_PCIE>;
resets = <&serdes_wiz2 1>, <&serdes_wiz2 2>;
};
};
&cpsw0 {
/*
* Disable cpsw0 since cpsw9g_virt_mac is the default Ethernet
* controller. cpsw0 is enabled with overlay for native
* Ethernet driver support.
*/
status = "disabled";
};
&pcie0_rc {
//reset-gpios = <&exp1 6 GPIO_ACTIVE_HIGH>;
phys = <&serdes0_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <1>;
status = "disabled";
};
&pcie1_rc {
//reset-gpios = <&exp1 2 GPIO_ACTIVE_HIGH>;
phys = <&serdes1_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <2>;
status = "disabled";
};
&pcie2_rc {
reset-gpios = <&exp2 20 GPIO_ACTIVE_HIGH>;
phys = <&serdes2_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <2>;
status = "disabled";
};
&pcie0_ep {
phys = <&serdes0_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <1>;
status = "disabled";
};
&pcie1_ep {
phys = <&serdes1_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <2>;
status = "disabled";
};
&pcie2_ep {
phys = <&serdes2_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <2>;
status = "disabled";
};
&pcie3_rc {
status = "disabled";
};
&pcie3_ep {
status = "disabled";
};
/* uart2 assigned to cpsw9g eth-switch fw running on remote CPU core */
&main_uart2 {
status = "disabled";
};
&mcu_mcan0 {
pinctrl-names = "default";
pinctrl-0 = <&mcu_mcan0_pins_default>;
phys = <&transceiver1>;
};
&mcu_mcan1 {
pinctrl-names = "default";
pinctrl-0 = <&mcu_mcan1_pins_default>;
phys = <&transceiver2>;
};
&main_mcan0 {
pinctrl-names = "default";
pinctrl-0 = <&main_mcan0_pins_default>;
phys = <&transceiver3>;
};
&main_mcan1 {
status = "disabled";
};
&main_mcan2 {
pinctrl-names = "default";
pinctrl-0 = <&main_mcan2_pins_default>;
phys = <&transceiver4>;
};
&main_mcan3 {
status = "disabled";
};
&main_mcan4 {
status = "disabled";
};
&main_mcan5 {
status = "disabled";
};
&main_mcan6 {
status = "disabled";
};
&main_mcan7 {
status = "disabled";
};
&main_mcan8 {
status = "disabled";
};
&main_mcan9 {
status = "disabled";
};
&main_mcan10 {
status = "disabled";
};
&main_mcan11 {
status = "disabled";
};
&main_mcan12 {
status = "disabled";
};
&main_mcan13 {
status = "disabled";
};
&csi0_port0 {
status = "disabled";
};
&csi0_port1 {
status = "disabled";
};
&csi0_port2 {
status = "disabled";
};
&csi0_port3 {
status = "disabled";
};
&csi0_port4 {
status = "disabled";
};
&main_spi4 {
status = "disabled";
};
&mcu_spi0 {
status = "disabled";
};
&mcu_spi1 {
status = "disabled";
};
&mcu_spi2 {
status = "disabled";
};
&main_ehrpwm0 {
status = "disabled";
};
&main_ehrpwm1 {
status = "disabled";
};
&main_ehrpwm2 {
status = "disabled";
};
&main_ehrpwm3 {
status = "disabled";
};
&main_ehrpwm4 {
status = "disabled";
};
&main_ehrpwm5 {
status = "disabled";
};
&wkup_i2c0 {
status = "okay";
tps6594x: tps6594x@48 {
compatible = "ti,tps6594x";
reg = <0x48>;
ti,system-power-controller;
rtc {
compatible = "ti,tps6594x-rtc";
};
gpio {
compatible = "ti,tps6594x-gpio";
};
};
};
A small modification was made to the k3-j721e-common-proc-board.dts file , mostly about i2c and pcie(status = "disabled").
Thanks!
--- k3-j721e-common-proc-board-o.dts 2023-03-04 01:56:08.000000000 -0500
+++ k3-j721e-common-proc-board.dts 2024-04-22 22:55:16.000000000 -0400
@@ -76,7 +76,7 @@
regulator-boot-on;
enable-active-high;
vin-supply = <&vsys_3v3>;
- gpio = <&exp2 2 GPIO_ACTIVE_HIGH>;
+ //gpio = <&exp2 2 GPIO_ACTIVE_HIGH>;
};
vdd_sd_dv_alt: gpio-regulator-TLV71033 {
@@ -94,6 +94,7 @@
};
sound0: sound@0 {
+ status = "disabled";
compatible = "ti,j721e-cpb-audio";
model = "j721e-cpb";
@@ -600,11 +601,9 @@
pinctrl-0 = <&main_i2c0_pins_default>;
clock-frequency = <400000>;
- exp1: gpio@20 {
- compatible = "ti,tca6416";
- reg = <0x20>;
- gpio-controller;
- #gpio-cells = <2>;
+ rtc@6f {
+ compatible = "microchip,mcp7941x";
+ reg = <0x6f>;
};
exp2: gpio@22 {
@@ -613,29 +612,29 @@
gpio-controller;
#gpio-cells = <2>;
- p08-hog {
+ //p08-hog {
/* P10 - PM_I2C_CTRL_OE */
- gpio-hog;
- gpios = <8 GPIO_ACTIVE_HIGH>;
- output-high;
- line-name = "CTRL_PM_I2C_OE";
- };
+ // gpio-hog;
+ // gpios = <8 GPIO_ACTIVE_HIGH>;
+ // output-high;
+ // line-name = "CTRL_PM_I2C_OE";
+ //};
- p09-hog {
+ //p09-hog {
/* P11 - MCASP/TRACE_MUX_S0 */
- gpio-hog;
- gpios = <9 GPIO_ACTIVE_HIGH>;
- output-low;
- line-name = "MCASP/TRACE_MUX_S0";
- };
-
- p10-hog {
- /* P12 - MCASP/TRACE_MUX_S1 */
- gpio-hog;
- gpios = <10 GPIO_ACTIVE_HIGH>;
- output-high;
- line-name = "MCASP/TRACE_MUX_S1";
- };
+ // gpio-hog;
+ // gpios = <9 GPIO_ACTIVE_HIGH>;
+ // output-low;
+ // line-name = "MCASP/TRACE_MUX_S0";
+ //};
+
+ //p10-hog {
+ // /* P12 - MCASP/TRACE_MUX_S1 */
+ // gpio-hog;
+ // gpios = <10 GPIO_ACTIVE_HIGH>;
+ // output-high;
+ // line-name = "MCASP/TRACE_MUX_S1";
+ //};
};
};
@@ -663,100 +662,11 @@
pinctrl-0 = <&main_i2c2_pins_default>;
clock-frequency = <400000>;
- ina226@40 {
- compatible = "ti,ina226";
- reg = <0x40>;
- shunt-resistor = <10000>;
- };
-
- ina226@41 {
- compatible = "ti,ina226";
- reg = <0x41>;
- shunt-resistor = <10000>;
- };
-
- ina226@42 {
- compatible = "ti,ina226";
- reg = <0x42>;
- shunt-resistor = <10000>;
- };
-
- ina226@43 {
- compatible = "ti,ina226";
- reg = <0x43>;
- shunt-resistor = <10000>;
- };
-
- ina226@44 {
- compatible = "ti,ina226";
- reg = <0x44>;
- shunt-resistor = <10000>;
- };
-
- ina226@45 {
- compatible = "ti,ina226";
- reg = <0x45>;
- shunt-resistor = <5000>;
- };
-
- ina226@46 {
- compatible = "ti,ina226";
- reg = <0x46>;
- shunt-resistor = <10000>;
- };
-
- ina226@47 {
- compatible = "ti,ina226";
- reg = <0x47>;
- shunt-resistor = <10000>;
- };
-
- ina226@48 {
- compatible = "ti,ina226";
- reg = <0x48>;
- shunt-resistor = <10000>;
- };
-
- ina226@49 {
- compatible = "ti,ina226";
- reg = <0x49>;
- shunt-resistor = <10000>;
- };
-
- ina226@4a {
- compatible = "ti,ina226";
- reg = <0x4a>;
- shunt-resistor = <10000>;
- };
-
- ina226@4b {
- compatible = "ti,ina226";
- reg = <0x4b>;
- shunt-resistor = <10000>;
- };
-
- ina226@4c {
- compatible = "ti,ina226";
- reg = <0x4c>;
- shunt-resistor = <10000>;
- };
-
- ina226@4d {
- compatible = "ti,ina226";
- reg = <0x4d>;
- shunt-resistor = <10000>;
- };
-
- ina226@4e {
- compatible = "ti,ina226";
- reg = <0x4e>;
- shunt-resistor = <10000>;
- };
-
- ina226@4f {
- compatible = "ti,ina226";
- reg = <0x4f>;
- shunt-resistor = <10000>;
+ exp2: gpio@22 {
+ compatible = "ti,tca6424";
+ reg = <0x22>;
+ gpio-controller;
+ #gpio-cells = <2>;
};
};
@@ -1047,17 +957,19 @@
};
&pcie0_rc {
- reset-gpios = <&exp1 6 GPIO_ACTIVE_HIGH>;
+ //reset-gpios = <&exp1 6 GPIO_ACTIVE_HIGH>;
phys = <&serdes0_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <1>;
+ status = "disabled";
};
&pcie1_rc {
- reset-gpios = <&exp1 2 GPIO_ACTIVE_HIGH>;
+ //reset-gpios = <&exp1 2 GPIO_ACTIVE_HIGH>;
phys = <&serdes1_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <2>;
+ status = "disabled";
};
&pcie2_rc {
@@ -1065,6 +977,7 @@
phys = <&serdes2_pcie_link>;
phy-names = "pcie-phy";
num-lanes = <2>;
+ status = "disabled";
};
&pcie0_ep {
Thanks!
Hi,
which part of hardware design do you have to know to figure out why comes up "have to wait for 2min57s"?
I'm now working with tidss, do you know any documents tell how to config tidss according to hardware board, like pins config\dts node\kernel config, etc.
Thanks a lot!
which part of hardware design do you have to know to figure out why comes up "have to wait for 2min57s"?
We are not sure. Since it is your hardware design, we expect you must be aware of the design deviations taken compared to the TI EVM and handle appropriate software updates.
I'm now working with tidss, do you know any documents tell how to config tidss according to hardware board, like pins config\dts node\kernel config, etc.
We suggest looking into the TDA4VM data sheet and user guide(TRM). You must look into the device tree documentation for it.
Thanks.
Hi Xiao,
Are you using SBL to boot or SPL?
Also are you using vision_apps?
Best Regards,
Keerthy
Hi Keerthy,
Do you mean 'U-Boot SPL 2021.01-dirty', the magic number problem?
Can you explain more details about 'by adding vision_appa dtbo along with the dtb file', I have no idea about 'vision_appa dtbo'.
I'll fix the ''U-Boot SPL 2021.01-dirty' problem, then try again.
Thanks!
Hi,
There is no uEnv.txt file under the /root/boot directory on the SD card.
The uEnv.txt file under the \ti-processor-sdk-linux-j7-evm-08_06_00_11\board-support\prebuilt-images directory is empty.
# This uEnv.txt file can contain additional environment settings that you # want to set in U-Boot at boot time. This can be simple variables such # as the serverip or custom variables. The format of this file is: # variable=value # NOTE: This file will be evaluated after the bootcmd is run and the # bootcmd must be set to load this file if it exists (this is the # default on all newer U-Boot images. This also means that some # variables such as bootdelay cannot be changed by this file since # it is not evaluated until the bootcmd is run.
Best Regards!
Hi,
I put create-sdcard.sh file under /ti-processor-sdk-linux-j7-evm-08_06_00_11/bin , then sudo ./create-sdcard.sh.
create-sdcard.sh file as follow:
#!/bin/bash
# Authors:
# LT Thomas <ltjr@ti.com>
# Chase Maupin
# Franklin Cooper Jr.
#
# create-sdcard.sh v0.3
# This distribution contains contributions or derivatives under copyright
# as follows:
#
# Copyright (c) 2023, Texas Instruments Incorporated
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - Neither the name of Texas Instruments nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Force locale language to be set to English. This avoids issues when doing
# text and string processing.
export LANG=C
# Determine the absolute path to the executable
# EXE will have the PWD removed so we can concatenate with the PWD safely
PWD=`pwd`
EXE=`echo $0 | sed s=$PWD==`
EXEPATH="$PWD"/"$EXE"
clear
cat << EOM
################################################################################
This script will create a bootable SD card from custom or pre-built binaries.
The script must be run with root permissions and from the bin directory of
the SDK
Example:
$ sudo ./create-sdcard.sh
Formatting can be skipped if the SD card is already formatted and
partitioned properly.
################################################################################
EOM
AMIROOT=`whoami | awk {'print $1'}`
if [ "$AMIROOT" != "root" ] ; then
echo " **** Error *** must run script with sudo"
echo ""
exit
fi
THEPWD=$EXEPATH
PARSEPATH=`echo $THEPWD | grep -o '.*ti-processor-sdk-linux.*.[0-9]/'`
if [ "$PARSEPATH" != "" ] ; then
PATHVALID=1
else
PATHVALID=0
fi
. $PARSEPATH/bin/common.sh
if [ ! -z "$1" ]; then
platform=$1
fi
#Precentage function
untar_progress ()
{
TARBALL=$1;
DIRECTPATH=$2;
if grep -q .tar.xz <<< "$TARBALL"; then
BLOCKING_FACTOR=$(($(xz --robot --list ${TARBALL} | grep 'totals' | awk '{print $5}') / 51200 + 1));
tar --blocking-factor=${BLOCKING_FACTOR} --checkpoint=1 --checkpoint-action='ttyout=Written %u% \r' -Jxf ${TARBALL} -C ${DIRECTPATH}
elif grep -q .tar.gz <<< "$TARBALL"; then
tar --checkpoint=1 --checkpoint-action='ttyout=Written %u% \r' -zxf ${TARBALL} -C ${DIRECTPATH}
else
echo "untar: Unrecognised tarball format $TARBALL"
fi
}
#copy/paste programs
cp_progress ()
{
CURRENTSIZE=0
while [ $CURRENTSIZE -lt $TOTALSIZE ]
do
TOTALSIZE=$1;
TOHERE=$2;
CURRENTSIZE=`sudo du -c $TOHERE | grep total | awk {'print $1'}`
echo -e -n "$CURRENTSIZE / $TOTALSIZE copied \r"
sleep 1
done
}
check_for_sdcards()
{
# find the avaible SD cards
ROOTDRIVE=`mount | grep 'on / ' | awk {'print $1'} | cut -c6-8`
PARTITION_TEST=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n ''`
if [ "$PARTITION_TEST" = "" ]; then
echo -e "Please insert a SD card to continue\n"
while [ "$PARTITION_TEST" = "" ]; do
read -p "Type 'y' to re-detect the SD card or 'n' to exit the script: " REPLY
if [ "$REPLY" = 'n' ]; then
exit 1
fi
ROOTDRIVE=`mount | grep 'on / ' | awk {'print $1'} | cut -c6-8`
PARTITION_TEST=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n ''`
done
fi
}
find_boot_files()
{
[ ! -z "$SOC" ] && [ ! -z "$SOC_TYPE" ] && PLATFORM_SUFFIX="-${SOC}-${SOC_TYPE}-evm"
MLO=`ls $1 | grep MLO | awk {'print $1'}`
SPL_A72=`ls $1 | grep tispl.bin | awk {'print $1'}`
SPL_R5=`ls $1 | grep tiboot3${PLATFORM_SUFFIX}.bin | awk {'print $1'}`
SYSFW=`ls $1 | grep sysfw${PLATFORM_SUFFIX}.itb | awk {'print $1'}`
BOOTIMG=`ls $1 | grep u-boot.img | awk {'print $1'}`
BOOTBIN=`ls $1 | grep u-boot.bin | awk {'print $1'}`
BOOTUENV=`ls $1 | grep uEnv.txt | awk {'print $1'}`
WIFICFG=`ls $1 | grep wificfg | awk {'print $1'}`
}
populate_3_partitions() {
ENTERCORRECTLY="0"
while [ $ENTERCORRECTLY -ne 1 ]
do
read -e -p 'Enter path where SD card tarballs were downloaded : ' TARBALLPATH
echo ""
ENTERCORRECTLY=1
if [ -d $TARBALLPATH ]
then
echo "Directory exists"
echo ""
echo "This directory contains:"
ls $TARBALLPATH
echo ""
read -p 'Is this correct? [y/n] : ' ISRIGHTPATH
case $ISRIGHTPATH in
"y" | "Y") ;;
"n" | "N" ) ENTERCORRECTLY=0;continue;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;continue;;
esac
else
echo "Invalid path make sure to include complete path"
ENTERCORRECTLY=0
continue
fi
# Check that tarballs were found
if [ ! -e "$TARBALLPATH""/boot_partition.tar.xz" ]
then
echo "Could not find boot_partition.tar.xz as expected. Please"
echo "point to the directory containing the boot_partition.tar.xz"
ENTERCORRECTLY=0
continue
fi
if [ ! -e "$TARBALLPATH""/rootfs_partition.tar.xz" ]
then
echo "Could not find rootfs_partition.tar.xz as expected. Please"
echo "point to the directory containing the rootfs_partition.tar.xz"
ENTERCORRECTLY=0
continue
fi
if [ ! -e "$TARBALLPATH""/start_here_partition.tar.xz" ]
then
echo "Could not find start_here_partition.tar.xz as expected. Please"
echo "point to the directory containing the start_here_partition.tar.xz"
ENTERCORRECTLY=0
continue
fi
done
# Make temporary directories and untar mount the partitions
mkdir $PWD/boot
mkdir $PWD/rootfs
mkdir $PWD/start_here
mkdir $PWD/tmp
mount -t vfat ${DRIVE}${P}1 boot
mount -t ext4 ${DRIVE}${P}2 rootfs
mount -t ext4 ${DRIVE}${P}3 start_here
# Remove any existing content in case the partitions were not
# recreated
sudo rm -rf boot/*
sudo rm -rf rootfs/*
sudo rm -rf start_here/*
# Extract the tarball contents.
cat << EOM
################################################################################
Extracting boot partition tarball
################################################################################
EOM
untar_progress $TARBALLPATH/boot_partition.tar.xz tmp/
if [ -e "./tmp/MLO" ]
then
cp ./tmp/MLO boot/
fi
cp -rf ./tmp/* boot/
cat << EOM
################################################################################
Extracting rootfs partition tarball
################################################################################
EOM
untar_progress $TARBALLPATH/rootfs_partition.tar.xz rootfs/
cat << EOM
################################################################################
Extracting start_here partition to temp directory
################################################################################
EOM
rm -rf tmp/*
untar_progress $TARBALLPATH/start_here_partition.tar.xz tmp/
cat << EOM
################################################################################
Copying Contents to START_HERE
################################################################################
EOM
TOTALSIZE=`sudo du -c tmp/* | grep total | awk {'print $1'}`
cp -rf tmp/* start_here/ &
cp_progress $TOTALSIZE start_here/
sync;sync
# Fix up the START_HERE partitoin permissions
chown nobody -R start_here
chgrp nogroup -R start_here
umount boot rootfs start_here
sync;sync
# Clean up the temp directories
rm -rf boot rootfs start_here tmp
}
# find the avaible SD cards
ROOTDRIVE=`mount | grep 'on / ' | awk {'print $1'} | cut -c6-9`
if [ "$ROOTDRIVE" = "root" ]; then
ROOTDRIVE=`readlink /dev/root | cut -c1-3`
else
ROOTDRIVE=`echo $ROOTDRIVE | cut -c1-3`
fi
PARTITION_TEST=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n ''`
# Check for available mounts
check_for_sdcards
echo -e "\nAvailable Drives to write images to: \n"
echo "# major minor size name "
cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n ''
echo " "
DEVICEDRIVENUMBER=
while true;
do
read -p 'Enter Device Number or 'n' to exit: ' DEVICEDRIVENUMBER
echo " "
if [ "$DEVICEDRIVENUMBER" = 'n' ]; then
exit 1
fi
if [ "$DEVICEDRIVENUMBER" = "" ]; then
# Check to see if there are any changes
check_for_sdcards
echo -e "These are the Drives available to write images to:"
echo "# major minor size name "
cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n ''
echo " "
continue
fi
DEVICEDRIVENAME=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n '' | grep "${DEVICEDRIVENUMBER}:" | awk '{print $5}'`
if [ -n "$DEVICEDRIVENAME" ]
then
DRIVE=/dev/$DEVICEDRIVENAME
DEVICESIZE=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n '' | grep "${DEVICEDRIVENUMBER}:" | awk '{print $4}'`
break
else
echo -e "Invalid selection!"
# Check to see if there are any changes
check_for_sdcards
echo -e "These are the only Drives available to write images to: \n"
echo "# major minor size name "
cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<sd.\>\|\<mmcblk.\>' | grep -n ''
echo " "
fi
done
echo "$DEVICEDRIVENAME was selected"
#Check the size of disk to make sure its under 16GB
if [ $DEVICESIZE -gt 17000000 ] ; then
cat << EOM
################################################################################
**********WARNING**********
Selected Device is greater then 16GB
Continuing past this point will erase data from device
Double check that this is the correct SD Card
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -p 'Would you like to continue [y/n] : ' SIZECHECK
echo ""
echo " "
ENTERCORRECTLY=1
case $SIZECHECK in
"y") ;;
"n") exit;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
echo ""
done
fi
echo ""
DRIVE=/dev/$DEVICEDRIVENAME
NUM_OF_DRIVES=`df | grep -c $DEVICEDRIVENAME`
# This if statement will determine if we have a mounted sdX or mmcblkX device.
# If it is mmcblkX, then we need to set an extra char in the partition names, 'p',
# to account for /dev/mmcblkXpY labled partitions.
if [[ ${DEVICEDRIVENAME} =~ ^sd. ]]; then
echo "$DRIVE is an sdx device"
P=''
else
echo "$DRIVE is an mmcblkx device"
P='p'
fi
if [ "$NUM_OF_DRIVES" != "0" ]; then
echo "Unmounting the $DEVICEDRIVENAME drives"
for ((c=1; c<="$NUM_OF_DRIVES"; c++ ))
do
unmounted=`df | grep '\<'$DEVICEDRIVENAME$P$c'\>' | awk '{print $1}'`
if [ -n "$unmounted" ]
then
echo " unmounted ${DRIVE}$P$c"
sudo umount -f ${DRIVE}$P$c
fi
done
fi
# Refresh this variable as the device may not be mounted at script instantiation time
# This will always return one more then needed
NUM_OF_PARTS=`cat /proc/partitions | grep -v $ROOTDRIVE | grep -c $DEVICEDRIVENAME`
for ((c=1; c<"$NUM_OF_PARTS"; c++ ))
do
SIZE=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<'$DEVICEDRIVENAME$P$c'\>' | awk '{print $3}'`
echo "Current size of $DEVICEDRIVENAME$P$c $SIZE bytes"
done
# check to see if the device is already partitioned
for (( c=1; c<5; c++ ))
do
eval "SIZE$c=`cat /proc/partitions | grep -v $ROOTDRIVE | grep '\<'$DEVICEDRIVENAME$P$c'\>' | awk '{print $3}'`"
done
PARTITION="0"
if [ -n "$SIZE1" -a -n "$SIZE2" ] ; then
if [ "$SIZE1" -gt "128000" -a "$SIZE2" -gt "700000" ]
then
PARTITION=1
if [ -z "$SIZE3" -a -z "$SIZE4" ]
then
#Detected 2 partitions
PARTS=2
elif [ "$SIZE3" -gt "1000" -a -z "$SIZE4" ]
then
#Detected 3 partitions
PARTS=3
else
echo "SD Card is not correctly partitioned"
PARTITION=0
fi
fi
else
echo "SD Card is not correctly partitioned"
PARTITION=0
PARTS=0
fi
#Partition is found
if [ "$PARTITION" -eq "1" ]
then
cat << EOM
################################################################################
Detected device has $PARTS partitions already
Re-partitioning will allow the choice of 2 or 3 partitions
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -p 'Would you like to re-partition the drive anyways [y/n] : ' CASEPARTITION
echo ""
echo " "
ENTERCORRECTLY=1
case $CASEPARTITION in
"y") echo "Now partitioning $DEVICEDRIVENAME ...";PARTITION=0;;
"n") echo "Skipping partitioning";;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
echo ""
done
fi
#Partition is not found, choose to partition 2 or 3 segments
if [ "$PARTITION" -eq "0" ]
then
cat << EOM
################################################################################
Select 2 partitions if only need boot and rootfs (most users).
Select 3 partitions if need SDK & other content on SD card. This is
usually used by device manufacturers with access to partition tarballs.
****WARNING**** continuing will erase all data on $DEVICEDRIVENAME
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -p 'Number of partitions needed [2/3] : ' CASEPARTITIONNUMBER
echo ""
echo " "
ENTERCORRECTLY=1
case $CASEPARTITIONNUMBER in
"2") echo "Now partitioning $DEVICEDRIVENAME with 2 partitions...";PARTITION=2;;
"3") echo "Now partitioning $DEVICEDRIVENAME with 3 partitions...";PARTITION=3;;
"n") exit;;
*) echo "Please enter 2 or 3";ENTERCORRECTLY=0;;
esac
echo " "
done
fi
#Section for partitioning the drive
#create 3 partitions
if [ "$PARTITION" -eq "3" ]
then
# set the PARTS value as well
PARTS=3
cat << EOM
################################################################################
Now making 3 partitions
################################################################################
EOM
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
cat << END | fdisk $DRIVE
n
p
1
+128M
n
p
2
+2.4G
n
p
3
t
1
c
a
1
w
END
cat << EOM
################################################################################
Partitioning Boot
################################################################################
EOM
mkfs.vfat -F 32 -n "boot" ${DRIVE}${P}1
cat << EOM
################################################################################
Partitioning Rootfs
################################################################################
EOM
mkfs.ext4 -L "rootfs" ${DRIVE}${P}2
cat << EOM
################################################################################
Partitioning START_HERE
################################################################################
EOM
mkfs.ext4 -L "START_HERE" ${DRIVE}${P}3
sync
sync
#create only 2 partitions
elif [ "$PARTITION" -eq "2" ]
then
# Set the PARTS value as well
PARTS=2
cat << EOM
################################################################################
Now making 2 partitions
################################################################################
EOM
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
cat << END | fdisk $DRIVE
n
p
1
+128M
n
p
2
t
1
c
a
1
w
END
cat << EOM
################################################################################
Partitioning Boot
################################################################################
EOM
mkfs.vfat -F 32 -n "boot" ${DRIVE}${P}1
cat << EOM
################################################################################
Partitioning rootfs
################################################################################
EOM
mkfs.ext4 -L "root" ${DRIVE}${P}2
sync
sync
INSTALLSTARTHERE=n
fi
#Break between partitioning and installing file system
cat << EOM
################################################################################
Partitioning is now done
Continue to install filesystem or select 'n' to safe exit
**Warning** Continuing will erase files any files in the partitions
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -p 'Would you like to continue? [y/n] : ' EXITQ
echo ""
echo " "
ENTERCORRECTLY=1
case $EXITQ in
"y") ;;
"n") exit;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
done
# If this is a three partition card then we will jump to a function to
# populate the three partitions and then exit the script. If not we
# go on to prompt the user for input on the two partitions
if [ "$PARTS" -eq "3" ]
then
populate_3_partitions
exit 0
fi
#Add directories for images
export START_DIR=$PWD
mkdir -p $START_DIR/tmp
export PATH_TO_SDBOOT=boot
export PATH_TO_SDROOTFS=root
export PATH_TO_TMP_DIR=$START_DIR/tmp
echo " "
echo "Mount the partitions "
mkdir -p $PATH_TO_SDBOOT
mkdir -p $PATH_TO_SDROOTFS
sudo mount -t vfat ${DRIVE}${P}1 $PATH_TO_SDBOOT/
sudo mount -t ext4 ${DRIVE}${P}2 $PATH_TO_SDROOTFS/
echo " "
echo "Emptying partitions "
echo " "
sudo rm -rf $PATH_TO_SDBOOT/*
sudo rm -rf $PATH_TO_SDROOTFS/*
echo ""
echo "Syncing...."
echo ""
sync
sync
sync
cat << EOM
################################################################################
Choose file path to install from
1 ) Install pre-built images from SDK
2 ) Enter in custom boot and rootfs file paths
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -p 'Choose now [1/2] : ' FILEPATHOPTION
echo ""
echo " "
ENTERCORRECTLY=1
case $FILEPATHOPTION in
"1") echo "Will now install from SDK pre-built images";;
"2") echo "";;
*) echo "Please enter 1 or 2";ENTERCORRECTLY=0;;
esac
done
# SDK DEFAULTS
if [ $FILEPATHOPTION -eq 1 ] ; then
#check that in the right directory
THEEVMSDK=`echo $PARSEPATH | grep -o 'ti-processor-sdk-linux-.*[0-9]'`
if [ $PATHVALID -eq 1 ]; then
echo "now installing: $THEEVMSDK"
else
echo "no SDK PATH found"
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -e -p 'Enter path to SDK : ' SDKFILEPATH
echo ""
ENTERCORRECTLY=1
if [ -d $SDKFILEPATH ]
then
echo "Directory exists"
echo ""
PARSEPATH=`echo $SDKFILEPATH | grep -o '.*ti-processor-sdk-linux.*.[0-9]/'`
#echo $PARSEPATH
if [ "$PARSEPATH" != "" ] ; then
PATHVALID=1
else
PATHVALID=0
fi
#echo $PATHVALID
if [ $PATHVALID -eq 1 ] ; then
THEEVMSDK=`echo $SDKFILEPATH | grep -o 'ti-processor-sdk-linux-.*[0-9]'`
echo "Is this the correct SDK: $THEEVMSDK"
echo ""
read -p 'Is this correct? [y/n] : ' ISRIGHTPATH
case $ISRIGHTPATH in
"y") ;;
"n") ENTERCORRECTLY=0;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
else
echo "Invalid SDK path make sure to include ti-processor-sdk-linux-xxxx"
ENTERCORRECTLY=0
fi
else
echo "Invalid path make sure to include complete path"
ENTERCORRECTLY=0
fi
done
fi
#check that files are in SDK
BOOTFILEPATH="$PARSEPATH/board-support/prebuilt-images"
find_boot_files $BOOTFILEPATH
KERNELIMAGE=`ls $BOOTFILEPATH | grep [uz]Image | awk {'print $1'}`
#rootfs
ROOTFILEPARTH="$PARSEPATH/filesystem"
#Make sure there is only 1 tar
CHECKNUMOFTAR=`ls $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | grep '2:' | awk {'print $1'}`
if [ -n "$CHECKNUMOFTAR" ]
then
cat << EOM
################################################################################
Multiple rootfs Tarballs found
################################################################################
EOM
COUNT=`ls $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | awk {'print $1'} | wc -l`
while :
do
ls --sort=size $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | awk {'print " " , $1'}
read -p "Enter Number of rootfs Tarball: " TARNUMBER
echo
if [ -z "${TARNUMBER//[1-$COUNT]}" ] && [ -n "$TARNUMBER" ] ; then
break
else
echo "Invalid selection: '$TARNUMBER'. Please use values from 1 to $COUNT"
fi
echo
done
FOUNDTARFILENAME=`ls --sort=size $ROOTFILEPARTH | grep "image" | grep 'tar.xz' | grep -n '' | grep "${TARNUMBER}:" | cut -c3- | awk {'print$1'}`
ROOTFSTAR=$FOUNDTARFILENAME
TARDEVICENAME=`ls $ROOTFILEPARTH | grep "tisdk-default-image" | grep 'tar.xz' | awk -F - {'print $4'}`
TARIMAGETYPE=`ls $ROOTFILEPARTH | grep "tisdk-default-image" | grep 'tar.xz' | awk -F - {'print $2'}`
else
ROOTFSTAR=`ls $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | awk {'print $1'}`
fi
ROOTFSUSERFILEPATH=$ROOTFILEPARTH/$ROOTFSTAR
BOOTPATHOPTION=1
ROOTFSPATHOPTION=2
elif [ $FILEPATHOPTION -eq 2 ] ; then
cat << EOM
################################################################################
For U-boot and MLO
If files are located in Tarball write complete path including the file name.
e.x. $: /home/user/MyCustomTars/boot.tar.xz
If files are located in a directory write the directory path
e.x. $: /ti-processor-sdk-linux/board-support/prebuilt-images/
NOTE: Not all platforms will have an MLO file and this file can
be ignored for platforms that do not support an MLO.
Update: The proper location for the kernel image and device tree
files have moved from the boot partition to the root filesystem.
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -e -p 'Enter path for Boot Partition : ' BOOTUSERFILEPATH
echo ""
ENTERCORRECTLY=1
if [ -f $BOOTUSERFILEPATH ]
then
echo "File exists"
echo ""
elif [ -d $BOOTUSERFILEPATH ]
then
echo "Directory exists"
echo ""
echo "This directory contains:"
ls $BOOTUSERFILEPATH
echo ""
read -p 'Is this correct? [y/n] : ' ISRIGHTPATH
case $ISRIGHTPATH in
"y") ;;
"n") ENTERCORRECTLY=0;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
else
echo "Invalid path make sure to include complete path"
ENTERCORRECTLY=0
fi
done
cat << EOM
################################################################################
For Kernel Image and Device Trees files
What would you like to do?
1) Reuse kernel image and device tree files found in the selected rootfs.
2) Provide a directory that contains the kernel image and device tree files
to be used.
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -p 'Choose option 1 or 2 : ' CASEOPTION
echo ""
echo " "
ENTERCORRECTLY=1
case $CASEOPTION in
"1") echo "Reusing kernel and dt files from the rootfs's boot directory";KERNELFILESOPTION=1;;
"2") echo "Choosing a directory that contains the kernel files to be used";KERNELFILESOPTION=2;;
"n") exit;;
*) echo "Please enter 1 or 2";ENTERCORRECTLY=0;;
esac
echo " "
done
if [ $KERNELFILESOPTION == 2 ]
then
cat << EOM
################################################################################
For Kernel Image and Device Trees files
The kernel image name should contain the image type uImage or zImage depending
on which format is used.
The device tree files must end with .dtb
e.g am335x-evm.dtb am43x-gp-evm.dtb
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -e -p 'Enter path for kernel image and device tree files : ' KERNELUSERFILEPATH
echo ""
ENTERCORRECTLY=1
if [ -d $KERNELUSERFILEPATH ]
then
echo "Directory exists"
echo ""
echo "This directory contains:"
ls $KERNELUSERFILEPATH
echo ""
read -p 'Is this correct? [y/n] : ' ISRIGHTPATH
case $ISRIGHTPATH in
"y") ;;
"n") ENTERCORRECTLY=0;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
else
echo "Invalid path make sure to include complete path"
ENTERCORRECTLY=0
fi
done
fi
cat << EOM
################################################################################
For Rootfs partition
If files are located in Tarball write complete path including the file name.
e.x. $: /home/user/MyCustomTars/rootfs.tar.xz
If files are located in a directory write the directory path
e.x. $: /ti-processor-sdk-linux/targetNFS/
################################################################################
EOM
ENTERCORRECTLY=0
while [ $ENTERCORRECTLY -ne 1 ]
do
read -e -p 'Enter path for Rootfs Partition : ' ROOTFSUSERFILEPATH
echo ""
ENTERCORRECTLY=1
if [ -f $ROOTFSUSERFILEPATH ]
then
echo "File exists"
echo ""
elif [ -d $ROOTFSUSERFILEPATH ]
then
echo "This directory contains:"
ls $ROOTFSUSERFILEPATH
echo ""
read -p 'Is this correct? [y/n] : ' ISRIGHTPATH
case $ISRIGHTPATH in
"y") ;;
"n") ENTERCORRECTLY=0;;
*) echo "Please enter y or n";ENTERCORRECTLY=0;;
esac
else
echo "Invalid path make sure to include complete path"
ENTERCORRECTLY=0
fi
done
echo ""
# Check if user entered a tar or not for Boot
ISBOOTTAR=`ls $BOOTUSERFILEPATH | grep -E "\.tar\.[xg]z" | awk {'print $1'}`
if [ -n "$ISBOOTTAR" ]
then
BOOTPATHOPTION=2
else
BOOTPATHOPTION=1
BOOTFILEPATH=$BOOTUSERFILEPATH
find_boot_files $BOOTFILEPATH
fi
if [ "$KERNELFILESOPTION" == "2" ]
then
KERNELIMAGE=`ls $KERNELUSERFILEPATH | grep [uz]Image | awk {'print $1'}`
DTFILES=`ls $KERNELUSERFILEPATH | grep .dtb$ | awk {'print $1'}`
fi
#Check if user entered a tar or not for Rootfs
ISROOTFSTAR=`ls $ROOTFSUSERFILEPATH | grep .tar.xz | awk {'print $1'}`
if [ -n "$ISROOTFSTAR" ]
then
ROOTFSPATHOPTION=2
else
ROOTFSPATHOPTION=1
ROOTFSFILEPATH=$ROOTFSUSERFILEPATH
fi
fi
cat << EOM
################################################################################
Copying files now... will take minutes
################################################################################
Copying boot partition
EOM
if [ $BOOTPATHOPTION -eq 1 ] ; then
echo ""
#copy boot files out of board support
if [ "$TARDEVICENAME" == "am65xx" ] || [ "$TARDEVICENAME" == "j7" ]; then
if [ "$MLO" == "" ] && ( [ "$SPL_R5" == "" ] || [ "$SPL_A72" == "" ] || [ "$SYSFW" == "" ] ); then
echo "Boot image not found"
fi
else
if [ "$MLO" == "" ] && ( [ "$SPL_R5" == "" ] || [ "$SPL_A72" == "" ] ) ; then
echo "Boot image not found"
fi
fi
echo ""
echo ""
if [ "$MLO" != "" ] ; then
cp $BOOTFILEPATH/$MLO $PATH_TO_SDBOOT/MLO
echo "MLO copied"
echo ""
echo ""
fi
#copy boot files out of board support
if [ "$SPL_A72" != "" ] ; then
cp $BOOTFILEPATH/$SPL_A72 $PATH_TO_SDBOOT/tispl.bin
echo "tispl.bin copied"
echo ""
echo ""
fi
#copy boot files out of board support
if [ "$SPL_R5" != "" ] ; then
cp $BOOTFILEPATH/$SPL_R5 $PATH_TO_SDBOOT/tiboot3.bin
echo "tiboot3.bin copied"
echo ""
echo ""
fi
#copy boot files out of board support
if [ "$SYSFW" != "" ] ; then
cp $BOOTFILEPATH/$SYSFW $PATH_TO_SDBOOT/sysfw.itb
echo "sysfw.itb copied"
echo ""
echo ""
fi
if [ "$BOOTIMG" != "" ] ; then
cp $BOOTFILEPATH/$BOOTIMG $PATH_TO_SDBOOT/u-boot.img
echo "u-boot.img copied"
elif [ "$BOOTBIN" != "" ] ; then
cp $BOOTFILEPATH/$BOOTBIN $PATH_TO_SDBOOT/u-boot.bin
echo "u-boot.bin copied"
else
echo "No U-Boot file found"
fi
echo ""
if [ "$BOOTUENV" != "" ] ; then
cp $BOOTFILEPATH/$BOOTUENV $PATH_TO_SDBOOT/uEnv.txt
echo "uEnv.txt copied"
fi
echo ""
if [ "$TARIMAGETYPE" == "default" ] && ( [ "$TARDEVICENAME" == "am64xx" ] || [ "$TARDEVICENAME" == "am62xx" ] ); then
if [ "$WIFICFG" != "" ] ; then
cp $BOOTFILEPATH/$WIFICFG $PATH_TO_SDBOOT/wificfg
echo "wificfg copied"
else
echo "wificfg file not found"
fi
fi
elif [ $BOOTPATHOPTION -eq 2 ] ; then
untar_progress $BOOTUSERFILEPATH $PATH_TO_TMP_DIR
cp -rf $PATH_TO_TMP_DIR/* $PATH_TO_SDBOOT
echo ""
fi
echo ""
sync
echo "Copying rootfs System partition"
if [ $ROOTFSPATHOPTION -eq 1 ] ; then
TOTALSIZE=`sudo du -c $ROOTFSUSERFILEPATH/* | grep total | awk {'print $1'}`
sudo cp -r $ROOTFSUSERFILEPATH/* $PATH_TO_SDROOTFS & cp_progress $TOTALSIZE $PATH_TO_SDROOTFS
elif [ $ROOTFSPATHOPTION -eq 2 ] ; then
untar_progress $ROOTFSUSERFILEPATH $PATH_TO_SDROOTFS
fi
echo ""
echo ""
if [ "$KERNELFILESOPTION" == "2" ]
then
mkdir -p $PATH_TO_SDROOTFS/boot
if [ "$KERNELIMAGE" != "" ] ; then
CLEANKERNELNAME=`ls "$BOOTFILEPATH/$KERNELIMAGE" | grep -o [uz]Image`
cp -f $KERNELUSERFILEPATH/$KERNELIMAGE $PATH_TO_SDROOTFS/boot/$CLEANKERNELNAME
echo "Kernel image copied"
else
echo "$KERNELIMAGE file not found"
fi
COPYINGDTB="false"
for dtb in $DTFILES
do
if [ -f "$KERNELUSERFILEPATH/$dtb" ] ; then
cp -f $KERNELUSERFILEPATH/$dtb $PATH_TO_SDROOTFS/boot
echo "$dtb copied"
COPYINGDTB="true"
fi
done
if [ "$COPYINGDTB" == "false" ]
then
echo "No device tree files found"
fi
fi
# The following firmware are required for early boot, and therefore must be
# copied to the boot partition.
RPROC_EARLYBOOT_FIRMWARE=" \
dra7-ipu1-fw.xem4 \
"
for fw in $RPROC_EARLYBOOT_FIRMWARE
do
fw_path="$PATH_TO_SDROOTFS/lib/firmware/$fw"
# Handle links specifally as they may be absolute paths with respect to the rootfs
if [ -L "$fw_path" ]
then
fw_link=$(readlink "$fw_path")
if [[ "$fw_link" == /* ]]
then
# Absolute path
fw_path="$(readlink "$fw_path" | sed -e "s|^/|$PATH_TO_SDROOTFS/|")"
else
# Relative path
fw_path="$(dirname "$fw_path")/$fw_link"
fi
fi
# this is a global list of firmwares, so do not fail
cp -L "$fw_path" "$PATH_TO_SDBOOT/$fw" 2> /dev/null || true
done
echo " "
echo "Syncing..."
sync
sync
sync
sync
sync
sync
sync
sync
echo " "
echo "Un-mount the partitions "
sudo umount -f $PATH_TO_SDBOOT
sudo umount -f $PATH_TO_SDROOTFS
echo " "
echo "Remove created temp directories "
sudo rm -rf $PATH_TO_TMP_DIR
sudo rm -rf $PATH_TO_SDROOTFS
sudo rm -rf $PATH_TO_SDBOOT
echo " "
echo "Operation Finished"
echo " "
Thanks, Best Regard!
Hi,
If you are using SDK 8.6 can you do the below to create the SD Card and check if the issue persists?
cd ${PSDKLA}/bin
./mksdboot.sh --device /dev/sdb --sdk /home/nikhil/SDK_8.6/ti-processor-sdk-linux-j7-evm-08_06_00_11
Regards,
Nikhil