Linux第39步_创建正点原子的uboot工作区和使用脚本编译

先看答案,再做题,为移植uboot做好充足的准备。这里需要修改两个“Makefile文件,路数变了

、uboot移植前需要了解的相关知识

1、正点原子的uboot设备树文件。

路径如下:

uboot/alientek_uboot/arch/arm/dts/

文件如下:

stm32mp157d-atk.dts

stm32mp157d-atk.dtsi

stm32mp157d-atk-u-boot.dtsi”。

其中:

以“stm32mp157d-ed1.dts”为母版,复制一份命名得到“stm32mp157d-atk.dts”;

以“stm32mp15xx-edx.dtsi”为母版,复制一份命名得到“stm32mp157d-atk.dtsi”;

以“stm32mp157a-ed1-u-boot.dtsi”为母版,复制一份命名得到“stm32mp157d-atk-u-boot.dtsi”;

这三个文件就是“uboot的默认设备树”,先了解uboot的设备树是什么样子,为后期移植uboot提供参考。

2、正点原子的uboot配置文件

路径:uboot/alientek_uboot/configs

文件:stm32mp15_atk_trusted_defconfig,它以“stm32mp15_trusted_defconfig”为母版,复制一份得到的,这就是“uboot的默认配置文件”。

3Makefile文件

1)、位于“uboot/alientek_uboot/目录中的Makefile文件

2)、位于uboot/alientek_uboot/arch/amn/dts/”目录中的“Makefile”文件

主要是了解怎么修改“Makefile”文件。

4stm32mp157d_alientek.sh”的shell脚本

主要是了解“shell脚本”长啥样子,以及怎么使用它来编译uboot。

二、创建uboot工作区为“alientek_uboot.code-workspace

1、在Ubuntu桌面,打开“Visual Studio Code”软件。

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第1张图片

2、点击“文件”,点击“打开文件夹(F)…[Ctrl+K Ctrl+O]”,见下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第2张图片

得到下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第3张图片

3、点击“alientek_uboot”,然后点击“确定”,得到下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第4张图片

4、点击“文件”,然后点击“将工作区另存为…”,见下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第5张图片

5、输入“alientek_uboot”,然后点击保存。

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第6张图片

得到下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第7张图片

至此,“alientek_uboot”工作区创建好了。

、查看正点原子的uboot设备树文件

1、点击“arch”,接着点击“arm”,最后点击“dts”,见下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第8张图片

2、拖动滑块,查找stm32mp157d-atk.dts”,“stm32mp157d-atk.dtsi”和

stm32mp157d-atk-u-boot.dtsi”;

见下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第9张图片

、查看uboot/alientek_uboot/arch/arm/dts/stm32mp157d-atk.dts

内容如下:

// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)

/*

 * Copyright (C) STMicroelectronics 2019 - All Rights Reserved

 * Author: Alexandre Torgue for STMicroelectronics.

 */

/dts-v1/;

#include "stm32mp157.dtsi"

#include "stm32mp15xd.dtsi"

#include "stm32mp15-pinctrl.dtsi"

#include "stm32mp15xxaa-pinctrl.dtsi"

#include "stm32mp157-m4-srm.dtsi"

#include "stm32mp157-m4-srm-pinctrl.dtsi"

#include "stm32mp157d-atk.dtsi"//包含uboot设备树头文件,只修改这一句

/ {

    model = "STMicroelectronics STM32MP157D eval daughter";

    compatible = "st,stm32mp157d-atk", "st,stm32mp157";

    chosen {

       stdout-path = "serial0:115200n8";

    };

    aliases {

       serial0 = &uart4;

    };

    reserved-memory {

       gpu_reserved: gpu@f6000000 {

           reg = <0xf6000000 0x8000000>;

           no-map;

       };

       optee_memory: optee@fe000000 {

           reg = <0xfe000000 0x02000000>;

           no-map;

       };

    };

    panel_backlight: panel-backlight {

       compatible = "gpio-backlight";

       gpios = <&gpiod 13 GPIO_ACTIVE_HIGH>;

       default-on;

       status = "okay";

    };

    atk_pinctrl_lcd {

        gpior = <&gpioj 6 GPIO_ACTIVE_LOW>;

        gpiog = <&gpiok 2 GPIO_ACTIVE_LOW>;

        gpiob = <&gpiok 6 GPIO_ACTIVE_LOW>;

    };

    panel_rgb: panel-rgb {

        compatible = "simple-panel";

        pinctrl-names = "default", "sleep";

        pinctrl-0 = <<dc_pins_b>;

        pinctrl-1 = <<dc_pins_sleep_b>;

        backlight = <&panel_backlight>;

        status = "okay";

        port {

            panel_in_rgb: endpoint {

                remote-endpoint = <<dc_ep0_out>;

            };

        };

    };

};

&pinctrl {

   gpio_r:gpio_r {

        pins {

            pinmux = ; /* PJ6.GPIO */

            bias-pull-up;

            drive-push-pull;

        };

    };

   gpio_g:gpio_g {

        pins {

            pinmux = ; /* PK2.GPIO */

            bias-pull-up;

            drive-push-pull;

        };

    };

   gpio_b:gpio_b {

        pins {

            pinmux = ; /* PK6.GPIO */

            bias-pull-up;

            drive-push-pull;

        };

    };

   gpio_beep:gpio_beep {

        pins {

            pinmux = ; /* PK6.GPIO */

            bias-pull-down;

            drive-push-pull;

        };

    };

};

&cpu1{

    cpu-supply = <&vddcore>;

};

&gpu {

    contiguous-area = <&gpu_reserved>;

    status = "okay";

};

&iwdg2 {

    pinctrl-names = "default";

    pinctrl-0 = <&gpio_r>,<&gpio_g>, <&gpio_b>;

};

<dc {

    status = "okay";

    port {

       #address-cells = <1>;

       #size-cells = <0>;

       ltdc_ep0_out: endpoint@0 {

           reg = <0>;

           remote-endpoint = <&panel_in_rgb>;

       };

    };

};

&optee {

    status = "okay";

};

、查看uboot/alientek_uboot/arch/arm/dts/stm32mp157d-atk.dtsi

内容如下:

// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)

/*

 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved

 * Author: Ludovic Barre for STMicroelectronics.

 */

#include <dt-bindings/gpio/gpio.h>

#include <dt-bindings/mfd/st,stpmic1.h>

/ {

    memory@c0000000 {

       device_type = "memory";

       reg = <0xC0000000 0x40000000>;

    };

    reserved-memory {

       #address-cells = <1>;

       #size-cells = <1>;

       ranges;

       mcuram2: mcuram2@10000000 {

           compatible = "shared-dma-pool";

           reg = <0x10000000 0x40000>;

           no-map;

       };

       vdev0vring0: vdev0vring0@10040000 {

           compatible = "shared-dma-pool";

           reg = <0x10040000 0x1000>;

           no-map;

       };

       vdev0vring1: vdev0vring1@10041000 {

           compatible = "shared-dma-pool";

           reg = <0x10041000 0x1000>;

           no-map;

       };

       vdev0buffer: vdev0buffer@10042000 {

           compatible = "shared-dma-pool";

           reg = <0x10042000 0x4000>;

           no-map;

       };

       mcuram: mcuram@30000000 {

           compatible = "shared-dma-pool";

           reg = <0x30000000 0x40000>;

           no-map;

       };

       retram: retram@38000000 {

           compatible = "shared-dma-pool";

           reg = <0x38000000 0x10000>;

           no-map;

       };

    };

    usb_phy_tuning: usb-phy-tuning {

       st,hs-dc-level = <2>;

       st,fs-rftime-tuning;

       st,hs-rftime-reduction;

       st,hs-current-trim = <15>;

       st,hs-impedance-trim = <1>;

       st,squelch-level = <3>;

       st,hs-rx-offset = <2>;

       st,no-lsfs-sc;

    };

//“添加电源管理”开始//

    vddcore: regulator-vddcore {

        compatible = "regulator-fixed";

       regulator-name = "vddcore";

       regulator-min-microvolt = <1200000>;

       regulator-max-microvolt = <1350000>;

       regulator-always-on;

        regulator-boot-on;

    };

    v3v3: regulator-3p3v {

        compatible = "regulator-fixed";

        regulator-name = "v3v3";

        regulator-min-microvolt = <3300000>;

        regulator-max-microvolt = <3300000>;

        regulator-always-on;

        regulator-boot-on;

    };

    v1v8_audio: regulator-v1v8-audio {

        compatible = "regulator-fixed";

        regulator-name = "v1v8_audio";

        regulator-min-microvolt = <1800000>;

        regulator-max-microvolt = <1800000>;

        regulator-always-on;

        regulator-boot-on;

    };

    vdd: regulator-vdd {

        compatible = "regulator-fixed";

        regulator-name = "vdd";

        regulator-min-microvolt = <3300000>;

        regulator-max-microvolt = <3300000>;

        regulator-always-on;

        regulator-boot-on;

    };

    vdd_usb: regulator-vdd-usb {

        compatible = "regulator-fixed";

        regulator-name = "vdd_usb";

        regulator-min-microvolt = <3300000>;

        regulator-max-microvolt = <3300000>;

        regulator-always-on;

        regulator-boot-on;

    };

//“添加电源管理”结束//

    vin: vin {

       compatible = "regulator-fixed";

       regulator-name = "vin";

       regulator-min-microvolt = <5000000>;

       regulator-max-microvolt = <5000000>;

       regulator-always-on;

    };

    led {

       compatible = "gpio-leds";

       red {

           label = "ide-disk";

           gpios = <&gpioi 0 GPIO_ACTIVE_LOW>;

           linux,default-trigger = "ide-disk";

           default-state = "on";

       };

       blue {

           label = "heartbeat";

           gpios = <&gpiof 3 GPIO_ACTIVE_LOW>;

           linux,default-trigger = "heartbeat";

           default-state = "on";

       };

    };

};

&cpu0{

    cpu-supply = <&vddcore>;

};

&crc1 {

    status = "okay";

};

&dma1 {

    sram = <&dma_pool>;

};

&dma2 {

    sram = <&dma_pool>;

};

&dts {

    status = "okay";

};

ðernet0 {

    status = "okay";

    pinctrl-0 = <ðernet0_rgmii_pins_a>;

    pinctrl-1 = <ðernet0_rgmii_pins_sleep_a>;

    pinctrl-names = "default", "sleep";

    phy-mode = "rgmii-id";

    max-speed = <1000>;

    phy-handle = <&phy0>;

    mdio0 {

       #address-cells = <1>;

       #size-cells = <0>;

       compatible = "snps,dwmac-mdio";

       phy0: ethernet-phy@0 {

           reg = <0>;

       };

    };

};

&hash1 {

    status = "okay";

};

&i2c1 {

    pinctrl-names = "default", "sleep";

    pinctrl-0 = <&i2c1_pins_b>;

    pinctrl-1 = <&i2c1_pins_sleep_b>;

    i2c-scl-rising-time-ns = <100>;

    i2c-scl-falling-time-ns = <7>;

    status = "okay";

    /delete-property/dmas;

    /delete-property/dma-names;

    stusb1600@28 {

       compatible = "st,stusb1600";

       reg = <0x28>;

       interrupts = <2 IRQ_TYPE_EDGE_FALLING>;

       interrupt-parent = <&gpiog>;

       pinctrl-names = "default";

       pinctrl-0 = <&stusb1600_pins_a>;

       status = "okay";

       vdd-supply = <&vin>;

       connector {

           compatible = "usb-c-connector";

           label = "USB-C";

           power-role = "dual";

           power-opmode = "default";

           port {

              con_usbotg_hs_ep: endpoint {

                  remote-endpoint = <&usbotg_hs_ep>;

              };

           };

       };

    };

};

&ipcc {

    status = "okay";

};

&iwdg2 {

    timeout-sec = <32>;

    status = "okay";

};

&m4_rproc {

    memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,

           <&vdev0vring1>, <&vdev0buffer>;

    mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;

    mbox-names = "vq0", "vq1", "shutdown";

    interrupt-parent = <&exti>;

    interrupts = <68 1>;

    wakeup-source;

    status = "okay";

};

&pwr_regulators {

    vdd-supply = <&vdd>;

    vdd_3v3_usbfs-supply = <&vdd_usb>;

};

&rng1 {

    status = "okay";

};

&rtc {

    status = "okay";

};

//“修改sdmmc1”开始//

&sdmmc1 {

    pinctrl-names = "default", "opendrain", "sleep";

    pinctrl-0 = <&sdmmc1_b4_pins_a>;

    pinctrl-1 = <&sdmmc1_b4_od_pins_a>;

    pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;

    st,neg-edge;

    broken-cd;

    bus-width = <4>;

    vmmc-supply = <&v3v3>;

    status = "okay";

};

//“修改sdmmc1”结束//

//“修改sdmmc2”开始//

&sdmmc2 {

    pinctrl-names = "default", "opendrain", "sleep";

    pinctrl-0 = <&sdmmc2_b4_pins_a  &sdmmc2_d47_pins_a>;

    pinctrl-1 = <&sdmmc2_b4_od_pins_a  &sdmmc2_d47_pins_a>;

    pinctrl-2 = <&sdmmc2_b4_sleep_pins_a  &sdmmc2_d47_sleep_pins_a>;

    non-removable;

    st,neg-edge;

    bus-width = <8>;

    vmmc-supply = <&v3v3>;

    keep-power-in-suspend;

    status = "okay";

};

//“修改sdmmc2”结束//

&sram {

    dma_pool: dma_pool@0 {

       reg = <0x50000 0x10000>;

       pool;

    };

};

&timers6 {

    status = "okay";

    /* spare dmas for other usage */

    /delete-property/dmas;

    /delete-property/dma-names;

    timer@5 {

       status = "okay";

    };

};

&uart4 {

    pinctrl-names = "default", "sleep", "idle";

    pinctrl-0 = <&uart4_pins_a>;

    pinctrl-1 = <&uart4_sleep_pins_a>;

    pinctrl-2 = <&uart4_idle_pins_a>;

    pinctrl-3 = <&uart4_pins_a>;

    /delete-property/dmas;

    /delete-property/dma-names;

    status = "okay";

};

&usbh_ehci {

    phys = <&usbphyc_port0>;

    status = "okay";

};

//“修改usbotg_hs”开始//

&usbotg_hs {

    phys = <&usbphyc_port1 0>;

    phy-names = "usb2-phy";

    usb-role-switch;

    status = "okay";

    port {

       usbotg_hs_ep: endpoint {

           remote-endpoint = <&con_usbotg_hs_ep>;

       };

    };

};

//“修改usbotg_hs”结束//

&usbphyc {

    status = "okay";

};

&usbphyc_port0 {

    phy-supply = <&vdd_usb>;

    st,phy-tuning = <&usb_phy_tuning>;

};

&usbphyc_port1 {

    phy-supply = <&vdd_usb>;

    st,phy-tuning = <&usb_phy_tuning>;

};

&vrefbuf {

    regulator-min-microvolt = <2500000>;

    regulator-max-microvolt = <2500000>;

    vdda-supply = <&vdd>;

    status = "okay";

}

、查看uboot/alientek_uboot/arch/arm/dts/stm32mp157d-atk-u-boot.dtsi

内容如下:

// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause

/*

 * Copyright : STMicroelectronics 2018

 */

#include <dt-bindings/clock/stm32mp1-clksrc.h>

#include "stm32mp15-u-boot.dtsi"

#include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi"

/ {

    aliases {

       i2c3 = &i2c4;

       mmc0 = &sdmmc1;

       mmc1 = &sdmmc2;

    };

    config {

       u-boot,boot-led = "heartbeat";

       u-boot,error-led = "error";

       u-boot,mmc-env-partition = "ssbl";

    };

    led {

    };

};

#ifndef CONFIG_STM32MP1_TRUSTED

&clk_hse {

    st,digbypass;

};

&i2c4 {

    u-boot,dm-pre-reloc;

};

&i2c4_pins_a {

    u-boot,dm-pre-reloc;

    pins {

       u-boot,dm-pre-reloc;

    };

};

&rcc {

    st,clksrc = <

       CLK_MPU_PLL1P

       CLK_AXI_PLL2P

       CLK_MCU_PLL3P

       CLK_PLL12_HSE

       CLK_PLL3_HSE

       CLK_PLL4_HSE

       CLK_RTC_LSE

       CLK_MCO1_DISABLED

       CLK_MCO2_DISABLED

    >;

    st,clkdiv = <

       1 /*MPU*/

       0 /*AXI*/

       0 /*MCU*/

       1 /*APB1*/

       1 /*APB2*/

       1 /*APB3*/

       1 /*APB4*/

       2 /*APB5*/

       23 /*RTC*/

       0 /*MCO1*/

       0 /*MCO2*/

    >;

    st,pkcs = <

       CLK_CKPER_HSE

       CLK_FMC_ACLK

       CLK_QSPI_ACLK

       CLK_ETH_DISABLED

       CLK_SDMMC12_PLL4P

       CLK_DSI_DSIPLL

       CLK_STGEN_HSE

       CLK_USBPHY_HSE

       CLK_SPI2S1_PLL3Q

       CLK_SPI2S23_PLL3Q

       CLK_SPI45_HSI

       CLK_SPI6_HSI

       CLK_I2C46_HSI

       CLK_SDMMC3_PLL4P

       CLK_USBO_USBPHY

       CLK_ADC_CKPER

       CLK_CEC_LSE

       CLK_I2C12_HSI

       CLK_I2C35_HSI

       CLK_UART1_HSI

       CLK_UART24_HSI

       CLK_UART35_HSI

       CLK_UART6_HSI

       CLK_UART78_HSI

       CLK_SPDIF_PLL4P

       CLK_FDCAN_PLL4R

       CLK_SAI1_PLL3Q

       CLK_SAI2_PLL3Q

       CLK_SAI3_PLL3Q

       CLK_SAI4_PLL3Q

       CLK_RNG1_LSI

       CLK_RNG2_LSI

       CLK_LPTIM1_PCLK1

       CLK_LPTIM23_PCLK3

       CLK_LPTIM45_LSE

    >;

/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */

    pll2: st,pll@1 {

       compatible = "st,stm32mp1-pll";

       reg = <1>;

       cfg = < 2 65 1 0 0 PQR(1,1,1) >;

       frac = < 0x1400 >;

       u-boot,dm-pre-reloc;

    };

    /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */

    pll3: st,pll@2 {

       compatible = "st,stm32mp1-pll";

       reg = <2>;

       cfg = < 1 33 1 16 36 PQR(1,1,1) >;

       frac = < 0x1a04 >;

       u-boot,dm-pre-reloc;

    };

    /* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */

    pll4: st,pll@3 {

       compatible = "st,stm32mp1-pll";

       reg = <3>;

       cfg = < 3 98 5 7 7 PQR(1,1,1) >;

       u-boot,dm-pre-reloc;

    };

};

&sdmmc1 {

    u-boot,dm-spl;

};

&sdmmc1_b4_pins_a {

    u-boot,dm-spl;

    pins1 {

       u-boot,dm-spl;

    };

    pins2 {

       u-boot,dm-spl;

    };

};

&sdmmc1_dir_pins_a {

    u-boot,dm-spl;

    pins1 {

       u-boot,dm-spl;

    };

    pins2 {

       u-boot,dm-spl;

    };

};

&sdmmc2 {

    u-boot,dm-spl;

};

&sdmmc2_b4_pins_a {

    u-boot,dm-spl;

    pins1 {

       u-boot,dm-spl;

    };

    pins2 {

       u-boot,dm-spl;

    };

};

&sdmmc2_d47_pins_a {

    u-boot,dm-spl;

    pins {

       u-boot,dm-spl;

    };

};

#endif

&uart4 {

    u-boot,dm-pre-reloc;

};

&usbotg_hs {

    u-boot,force-b-session-valid;

    hnp-srp-disable;

    /* TEMP: force peripheral for USB OTG */

    dr_mode = "peripheral";

};

&uart4_pins_a {

    u-boot,dm-pre-reloc;

    pins1 {

       u-boot,dm-pre-reloc;

    };

    pins2 {

       u-boot,dm-pre-reloc;

       /* pull-up on rx to avoid floating level */

       bias-pull-up;

    };

};

七、查看uboot/alientek_uboot/configs/stm32mp15_atk_trusted_defconfig

内容如下:

CONFIG_ARM=y

CONFIG_ARCH_STM32MP=y

CONFIG_SYS_MALLOC_F_LEN=0x3000

CONFIG_ENV_OFFSET=0x280000

CONFIG_TARGET_ST_STM32MP15x=y

CONFIG_CMD_STM32PROG=y

CONFIG_ENV_SECT_SIZE=0x40000

CONFIG_ENV_OFFSET_REDUND=0x2C0000

CONFIG_DISTRO_DEFAULTS=y

CONFIG_FIT=y

CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"

CONFIG_SYS_PROMPT="STM32MP> "

# CONFIG_CMD_BOOTD is not set

CONFIG_CMD_DTIMG=y

# CONFIG_CMD_ELF is not set

# CONFIG_CMD_IMI is not set

# CONFIG_CMD_XIMG is not set

# CONFIG_CMD_EXPORTENV is not set

# CONFIG_CMD_IMPORTENV is not set

CONFIG_CMD_ERASEENV=y

CONFIG_CMD_MEMINFO=y

CONFIG_CMD_MEMTEST=y

CONFIG_CMD_ADC=y

CONFIG_CMD_CLK=y

CONFIG_CMD_DFU=y

CONFIG_CMD_FUSE=y

CONFIG_CMD_GPIO=y

CONFIG_CMD_I2C=y

CONFIG_CMD_MMC=y

CONFIG_CMD_REMOTEPROC=y

CONFIG_CMD_SPI=y

CONFIG_CMD_USB=y

CONFIG_CMD_USB_MASS_STORAGE=y

CONFIG_CMD_BMP=y

CONFIG_CMD_CACHE=y

CONFIG_CMD_TIME=y

CONFIG_CMD_TIMER=y

CONFIG_CMD_PMIC=y

CONFIG_CMD_REGULATOR=y

CONFIG_CMD_EXT4_WRITE=y

CONFIG_CMD_MTDPARTS=y

CONFIG_CMD_UBI=y

CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"

CONFIG_ENV_IS_NOWHERE=y

CONFIG_ENV_IS_IN_MMC=y

CONFIG_ENV_IS_IN_SPI_FLASH=y

CONFIG_ENV_IS_IN_UBI=y

CONFIG_SYS_REDUNDAND_ENVIRONMENT=y

CONFIG_ENV_UBI_PART="UBI"

CONFIG_ENV_UBI_VOLUME="uboot_config"

CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"

CONFIG_SYS_RELOC_GD_ENV_ADDR=y

CONFIG_STM32_ADC=y

CONFIG_CLK_SCMI=y

CONFIG_SET_DFU_ALT_INFO=y

CONFIG_USB_FUNCTION_FASTBOOT=y

CONFIG_FASTBOOT_BUF_ADDR=0xC0000000

CONFIG_FASTBOOT_BUF_SIZE=0x02000000

CONFIG_FASTBOOT_USB_DEV=1

CONFIG_FASTBOOT_FLASH=y

CONFIG_FASTBOOT_FLASH_MMC_DEV=1

CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y

CONFIG_FASTBOOT_MMC_BOOT1_NAME="mmc1boot0"

CONFIG_FASTBOOT_MMC_BOOT2_NAME="mmc1boot1"

CONFIG_FASTBOOT_MMC_USER_SUPPORT=y

CONFIG_FASTBOOT_MMC_USER_NAME="mmc1"

CONFIG_FASTBOOT_CMD_OEM_FORMAT=y

CONFIG_FASTBOOT_CMD_OEM_PARTCONF=y

CONFIG_FASTBOOT_CMD_OEM_BOOTBUS=y

CONFIG_GPIO_HOG=y

CONFIG_DM_HWSPINLOCK=y

CONFIG_HWSPINLOCK_STM32=y

CONFIG_DM_I2C=y

CONFIG_SYS_I2C_STM32F7=y

CONFIG_LED=y

CONFIG_LED_GPIO=y

CONFIG_DM_MAILBOX=y

CONFIG_STM32_IPCC=y

CONFIG_ARM_SMC_MAILBOX=y

CONFIG_DM_MMC=y

CONFIG_SUPPORT_EMMC_BOOT=y

CONFIG_STM32_SDMMC2=y

CONFIG_MTD=y

CONFIG_DM_MTD=y

CONFIG_SYS_MTDPARTS_RUNTIME=y

CONFIG_MTD_RAW_NAND=y

CONFIG_NAND_STM32_FMC2=y

CONFIG_MTD_SPI_NAND=y

CONFIG_DM_SPI_FLASH=y

CONFIG_SPI_FLASH_MACRONIX=y

CONFIG_SPI_FLASH_SPANSION=y

CONFIG_SPI_FLASH_STMICRO=y

CONFIG_SPI_FLASH_WINBOND=y

# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set

CONFIG_SPI_FLASH_MTD=y

CONFIG_PHY_REALTEK=y

CONFIG_DM_ETH=y

CONFIG_DWC_ETH_QOS=y

CONFIG_PHY=y

CONFIG_PHY_STM32_USBPHYC=y

CONFIG_PINCONF=y

CONFIG_PINCTRL_STMFX=y

CONFIG_DM_PMIC=y

CONFIG_PMIC_STPMIC1=y

CONFIG_DM_REGULATOR_FIXED=y

CONFIG_DM_REGULATOR_GPIO=y

CONFIG_DM_REGULATOR_STM32_VREFBUF=y

CONFIG_DM_REGULATOR_STPMIC1=y

CONFIG_REMOTEPROC_STM32_COPRO=y

CONFIG_RESET_SCMI=y

CONFIG_DM_RTC=y

CONFIG_RTC_STM32=y

CONFIG_SERIAL_RX_BUFFER=y

CONFIG_SPI=y

CONFIG_DM_SPI=y

CONFIG_STM32_QSPI=y

CONFIG_STM32_SPI=y

CONFIG_TEE=y

CONFIG_OPTEE=y

# CONFIG_OPTEE_TA_AVB is not set

CONFIG_USB=y

CONFIG_DM_USB=y

CONFIG_DM_USB_GADGET=y

CONFIG_USB_EHCI_HCD=y

CONFIG_USB_EHCI_GENERIC=y

CONFIG_USB_GADGET=y

CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"

CONFIG_USB_GADGET_VENDOR_NUM=0x0483

CONFIG_USB_GADGET_PRODUCT_NUM=0x5720

CONFIG_USB_GADGET_DWC2_OTG=y

CONFIG_DM_VIDEO=y

CONFIG_BACKLIGHT_GPIO=y

CONFIG_VIDEO_BPP8=y

CONFIG_VIDEO_BPP16=y

CONFIG_VIDEO_BPP32=y

CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y

CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y

CONFIG_VIDEO_STM32=y

CONFIG_VIDEO_STM32_DSI=y

CONFIG_VIDEO_STM32_MAX_XRES=1280

CONFIG_VIDEO_STM32_MAX_YRES=800

CONFIG_WDT=y

CONFIG_WDT_STM32MP=y

CONFIG_ERRNO_STR=y

CONFIG_FDT_FIXUP_PARTITIONS=y

、查看uboot/alientek_uboot/arch/amn/dts/ Makefile

修改如下:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第10张图片

、查看位于“uboot/alientek_uboot/Makefile

修改如下:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第11张图片

在my_uboot根目录下创建“stm32mp157d_alientek.sh”的shell脚本

1、打开VSCode,点击“文件”,点击“另存为(A)”,选择“uboot/my_uboot”目录,点击“保存”。

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第12张图片

2、编写脚本

#!/bin/bash

make distclean  //清零uboot

make stm32mp15_atk_trusted_defconfig  //stm32mp15_atk_trusted_defconfig配置uboot

make DEVICE_TREE=stm32mp157d-atk all -j12 //给予stm32mp157d_alientek.sh可执行权限

见下图:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第13张图片

十一、使用脚本文件“stm32mp157d_alientek.sh”编译

1、在USCode中,打开终端

输入“chmod 777 stm32mp157d_alientek.sh回车//给予可执行权限,一次即可

输入“./stm32mp157d_alientek.sh回车”,//运行脚本编译uboot

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第14张图片

2、查看编译结果:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第15张图片

3、输入“ls -l”查看编译结果:

Linux第39步_创建正点原子的uboot工作区和使用脚本编译_第16张图片

 至此,移植ST公司的uboot,我们应该知道怎么搞了。

你可能感兴趣的:(产品研发,linux,经验分享,STM32MP157,uboot,移植,设备树,编译)