Linux第48步_编译正点原子的出厂Linux内核源码

news2025/1/24 11:43:55

编译正点原子的出厂 Linux 内核源码,为后面移植linux做准备。研究对象如下:

1)、linux内核镜像文件“uImage

路径为“arch/arm/boot”;

2)、设备树文件“stm32mp157d-atk.dtb

路径为“arch/arm/boot/dts

3)、默认配置文件“stm32mp1_atk_defconfig

路径为“arch/arm/configs

1、创建“alientek_linux”目录,用来存放正点原子的linux源码

打开终端

输入“ls回车

输入“cd linux/回车”,切换到“linux”目录

输入“ls回车”,列出“linux”目录下的文件和文件夹

输入“cd atk-mp1/回车” ,切换到“atk-mp1”目录

输入“ls回车”,列出“atk-mp1”目录下的文件和文件夹

输入“mkdir linux/回车”,在“/linux/atk-mp1/”目录下创建“linux”目录;

输入“cd linux/回车” ,切换到“linux”目录

输入“mkdir alientek_linux/回车”,在“/linux/atk-mp1/linux”目录下创建“alientek_linux”目录;

输入“ls回车”,列出“/linux/atk-mp1/linux”目录下的文件和文件夹

2将“linux-5.4.31-gca8f6cddb-v1.7.tar.bz2”压缩包,使用FileZilla把它拷贝到“/linux/atk-mp1/linux/alientek_linux”目录下。该文件位于“01、程序源码\01、正点原子Linux出厂系统源码”目录中。

3、输入“cd alientek_linux/回车,切换到“alientek_linux”目录

输入“ls回车”,列出“alientek_linux”目录下的文件和文件夹

输入“tar -vxjf linux-5.4.31-gca8f6cddb-v1.7.tar.bz2回车”,解压

4输入“ls回车”,列出“alientek_linux”目录下的文件和文件夹

输入“rm linux-5.4.31-gca8f6cddb-v1.7.tar.bz2回车”,删除压缩包

5、创建脚本文件“stm32mp157d_atk.sh”

输入“vi stm32mp157d_atk.sh回车”,新建一个脚本文件“stm32mp157d_atk.sh”

如果在第1次编译时,脚本文件如下:

#!/bin/sh

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- distclean

#清除工程,删除“.config”文件,执行1次即可,以后就不要再执行了。

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- stm32mp1_atk_defconfig

#设置为默认配置,执行1次即可,以后就不需要执行该语句了。

#“stm32mp1_atk_defconfig”位于“arch/arm/configs”目录下;

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- menuconfig

#打开图形化配置界面

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- uImage dtbs LOADADDR=0XC2000040 -j8

#编译镜像文件和设备树,linux内核在DDR中的加载地址为0XC2000040,-j8表示采用8线程编译

6、按“ESC键”,输入“:wq回车”,保存文件

输入“chmod 777 stm32mp157d_atk.sh回车”,给脚本文件赋予可执行权限

7、输入“./stm32mp157d_atk.sh回车”,执行编译;

编译完成后,文件如下:

注意:

为什么uboot里面的uImage的地址是0xC2000000,编译linux的时候,指定的的LOADADDR是0xC2000040?

因为linux的uImage最前面的Ox40个字节是头部信息。

编译得到“arch/arm/boot/uImage”

设备树:“arch/arm/boot/dts/stm32mp157d-atk.dtb”

stm32mp1_atk_defconfig”位于“arch/arm/configs”目录下;

8、查询是否生成了uImage文件

输入“ls回车

输入“cd arch/回车

输入“ls回车

输入“cd arm/回车

输入“ls回车

输入“cd boot/回车

输入“ls回车

9、查询是否生成了“stm32mp157d-atk.dtb”文件

输入“cd dts/回车

输入“ls stm32mp157*回车

10、将“stm32mp157d-atk.dtb”拷贝到“/home/zgq/linux/tftpboot/”目录下

打开第2个终端,查看tftpboot是不是存在

输入“ls回车

输入“cd linux/回车”,切换到“linux”目录

输入“ls回车”,列出“linux”目录下的文件和文件夹

输入“cd tftpboot/回车”,切换到“tftpboot”目录

输入“ls回车”,列出“tftpboot”目录下的文件和文件夹

11、回到第1个打开的终端,输入“cp stm32mp157d-atk.dtb /home/zgq/linux/tftpboot/ -f回车”,执行文件拷贝;

12、输入“cd ..回车”,回到“boot”目录下

输入“ls回车”,列出“boot”目录下的文件和文件夹

输入“cp uImage /home/zgq/linux/tftpboot/ -f回车”,执行文件拷贝;

13、回到第2个打开的终端,输入“ls -l回车

原有的“文件”被替换了。

按复位键,启动。

注意:将开发板通过网线连接到路由器,同时开启虚拟机。

14、使用VSCode创建工程

1)、点击虚拟机上的VSCode,然后点击“文件”,点击“打开文件夹”,选择“alientek_linux”

2)、点击“确定”

3)、点击“文件”,点击“将工作区另存为...”,在名称右边的文本框里输入“alientek_linux”,见下图:

4)、点击“保存”,得到下图:

5)、linux设备树头文件stm32mp157d-atk.dtsi源码,将来移植linux可以参考使用,见下图:

linux设备树头文件stm32mp157d-atk.dtsi源码如下:

// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
/*
 * Copyright (C) STMicroelectronics 2019 - All Rights Reserved
 * Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
 */

#include "stm32mp157-m4-srm.dtsi"
#include "stm32mp157-m4-srm-pinctrl.dtsi"
#include <dt-bindings/mfd/st,stpmic1.h>
#include <dt-bindings/usb/pd.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;
		};
	};

    clocks {
            clk_ext_camera: clk-ext-camera {
            #clock-cells = <0>;
            compatible = "fixed-clock";
            clock-frequency = <24000000>;
        };
    };

    dht11 {
        compatible = "alientek,dht11";
        dht11-gpio = <&gpiof 2 GPIO_ACTIVE_LOW>;
        status = "okay";
    };

    ds18b20 {
        compatible = "alientek,ds18b20";
        ds18b20-gpio = <&gpiof 2 GPIO_ACTIVE_LOW>;
        status = "okay";
    };

    gpio-keys {
            compatible = "gpio-keys";
            autorepeat;
            key0 {
                label = "USER-KEY0";
                linux,code = <114>;
                gpios = <&gpiog 3 GPIO_ACTIVE_LOW>;
                gpio-key,wakeup;
            };

            key1 {
                label = "USER-KEY1";
                linux,code = <115>;
                gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;
                gpio-key,wakeup;
            };
    };

    lcd_id {
        select_id = <0>;
    };

    leds {
         compatible = "gpio-leds";

         led1 {
             label = "sys-led";
             gpios = <&gpioi 0 GPIO_ACTIVE_LOW>;
             linux,default-trigger = "heartbeat";
             default-state = "on";
             status = "okay";
         };

         led2 {
             label = "user-led";
             gpios = <&gpiof 3 GPIO_ACTIVE_LOW>;
             linux,default-trigger = "none";
             default-state = "on";
             status = "okay";
         };

         beep {
             label = "beep";
             gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
             default-state = "off";
         };
     };

    panel_backlight: panel-backlight {
        compatible = "pwm-backlight";
        pwms = <&pwm4 1 5000000>;
        brightness-levels = <0 4 8 16 32 64 128 255>;
        power-supply = <&v3v3>;
        default-brightness-level = <7>;
        status = "okay";
    };

	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;
    };

    v3v3: regulator-3p3v {
		compatible = "regulator-fixed";
        regulator-name = "v3v3";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-always-on;
        regulator-boot-on;
	};
     
	vddcore: buck1 {
		compatible = "regulator-fixed";
        regulator-name = "vddcore";
        regulator-min-microvolt = <1200000>;
        regulator-max-microvolt = <1350000>;
        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;
    };

    vdd: regulator-vdd {
        compatible = "regulator-fixed";
        regulator-name = "vdd";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-always-on;
        regulator-boot-on;
    };

    vdda: ldo1 {
        compatible = "regulator-fixed";
        regulator-name = "vdda";
        regulator-min-microvolt = <2900000>;
        regulator-max-microvolt = <2900000>;
        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;
    };

    v2v8: regulator-v2v8 {
        compatible = "regulator-fixed";
        regulator-name = "v2v8";
        regulator-min-microvolt = <2800000>;
        regulator-max-microvolt = <2800000>;
        regulator-always-on;
        regulator-over-current-protection;
    };

   vin: regulator-vin {
        compatible = "regulator-fixed";
        regulator-name = "vin";
        regulator-min-microvolt = <5000000>;
        regulator-max-microvolt = <5000000>;
        regulator-always-on;
        regulator-boot-on;
    };

    v3v3_hdmi: regulator-v3v3-hdmi {
        compatible = "regulator-fixed";
        regulator-name = "v3v3_hdmi";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-always-on;
        regulator-boot-on;
    };

    v1v2_hdmi: regulator-v1v2-hdmi {
        compatible = "regulator-fixed";
        regulator-name = "v1v2_hdmi";
        regulator-min-microvolt = <1200000>;
        regulator-max-microvolt = <1200000>;
        regulator-always-on;
        regulator-boot-on;
    };

    spdif_out: spdif-out { 
        #sound-dai-cells = <0>;
        compatible = "linux,spdif-dit";
        status = "okay";

        spdif_out_port: port {
            spdif_out_endpoint: endpoint {
                remote-endpoint = <&sai4a_endpoint>;
            };
        };
    };

    spdif_in: spdif-in { 
        #sound-dai-cells = <0>;
        compatible = "linux,spdif-dir";
        status = "okay";

        spdif_in_port: port {
            spdif_in_endpoint: endpoint {
                remote-endpoint = <&spdifrx_endpoint>;
            };
        };
    };

#if 1
    sound: sound {
        compatible = "audio-graph-card";
        label = "STM32MP1-DK";
        routing =
            "Playback" , "MCLK",
            "Capture" , "MCLK",
            "MICL" , "Mic Bias";
        dais = <&sai2a_port &sai2b_port &i2s2_port &spdifrx_port>;
        status = "okay";
    };
#else
    sound: sound {
        compatible = "audio-graph-card";
        label = "STM32MP1-DK";

        widgets =
            "Microphone", "Mic Jack",
            "Line", "Line In",
            "Line", "Line Out",
            "Speaker", "Speaker",
            "Headphone", "Headphone Jack";

        routing =
            "Headphone Jack", "HP_L",
            "Headphone Jack", "HP_R",
            "Speaker", "SPK_LP",
            "Speaker", "SPK_LN",
            "Speaker", "SPK_RP",
            "Speaker", "SPK_RN",
            "LINPUT1", "Mic Jack",
            "LINPUT3", "Mic Jack",
            "RINPUT1", "Mic Jack",
            "RINPUT2", "Mic Jack";

        dais = <&sai2a_port &sai2b_port  &sai4a_port &spdifrx_port &i2s2_port>;
        status = "okay";
    };
#endif
};

&pinctrl {
    dac_ch1_pins_a: dac-ch1 {
         pins {
             pinmux = <STM32_PINMUX('A', 4, ANALOG)>; /* configure 'PA4' as ANALOG */
         };
     };

    adc1_in6_pins_b: adc1-in6 {
         pins {
             pinmux = <STM32_PINMUX('A', 5, ANALOG)>;
         };
     };

    dcmi_pins_b: dcmi-1 {
        pins {
            pinmux = <STM32_PINMUX('H', 8,  AF13)>,/* DCMI_HSYNC */
                <STM32_PINMUX('B', 7,  AF13)>,/* DCMI_VSYNC */
                <STM32_PINMUX('A', 6,  AF13)>,/* DCMI_PIXCLK */
                <STM32_PINMUX('H', 9,  AF13)>,/* DCMI_D0 */
                <STM32_PINMUX('H', 10, AF13)>,/* DCMI_D1 */
                <STM32_PINMUX('H', 11, AF13)>,/* DCMI_D2 */
                <STM32_PINMUX('H', 12, AF13)>,/* DCMI_D3 */
                <STM32_PINMUX('H', 14, AF13)>,/* DCMI_D4 */
                <STM32_PINMUX('I', 4,  AF13)>,/* DCMI_D5 */
                <STM32_PINMUX('B', 8,  AF13)>,/* DCMI_D6 */
                <STM32_PINMUX('E', 6,  AF13)>;/* DCMI_D7 */
            bias-disable;
        };
    };

    dcmi_sleep_pins_b: dcmi-sleep-1 {
        pins {
            pinmux = <STM32_PINMUX('H', 8,  ANALOG)>,/* DCMI_HSYNC */
                <STM32_PINMUX('B', 7,  ANALOG)>,/* DCMI_VSYNC */
                <STM32_PINMUX('A', 6,  ANALOG)>,/* DCMI_PIXCLK */
                <STM32_PINMUX('H', 9,  ANALOG)>,/* DCMI_D0 */
                <STM32_PINMUX('H', 10, ANALOG)>,/* DCMI_D1 */
                <STM32_PINMUX('H', 11, ANALOG)>,/* DCMI_D2 */
                <STM32_PINMUX('H', 12, ANALOG)>,/* DCMI_D3 */
                <STM32_PINMUX('H', 14, ANALOG)>,/* DCMI_D4 */
                <STM32_PINMUX('I', 4,  ANALOG)>,/* DCMI_D5 */
                <STM32_PINMUX('B', 8,  ANALOG)>,/* DCMI_D6 */
                <STM32_PINMUX('E', 6,  ANALOG)>;/* DCMI_D7 */
        };
    };

    stusb1600_pins_b: stusb1600-0 {
        pins {
            pinmux = <STM32_PINMUX('G', 2, ANALOG)>;
            bias-pull-up;
        };
    };

    uart7_pins_b: uart7-1 {
        pins1 {
            pinmux = <STM32_PINMUX('F', 7, AF7)>, /* UART7_TX */
                 <STM32_PINMUX('F', 8, AF7)>; /* UART7_RTS */
            bias-disable;
            drive-push-pull;
            slew-rate = <0>;
        };
        pins2 {
            pinmux = <STM32_PINMUX('F', 6, AF7)>, /* UART7_RX */
                 <STM32_PINMUX('F', 9, AF7)>; /* UART7_CTS_NSS */
            bias-disable;
        };
    };

    uart7_idle_pins_b: uart7-idle-1 {
        pins1 {
            pinmux = <STM32_PINMUX('F', 7, ANALOG)>, /* UART7_TX */
                 <STM32_PINMUX('F', 8, ANALOG)>, /* UART7_RTS */
                 <STM32_PINMUX('F', 9, ANALOG)>; /* UART7_CTS_NSS */
        };
        pins2 {
            pinmux = <STM32_PINMUX('F', 6, AF7)>; /* UART7_RX */
            bias-disable;
        };
    };

    uart7_sleep_pins_b: uart7-sleep-1 {
        pins {
            pinmux = <STM32_PINMUX('F', 7, ANALOG)>, /* UART7_TX */
                 <STM32_PINMUX('F', 8, ANALOG)>, /* UART7_RTS */
                 <STM32_PINMUX('F', 6, ANALOG)>, /* UART7_RX */
                 <STM32_PINMUX('F', 9, ANALOG)>; /* UART7_CTS_NSS */
        };
    };

    usart3_pins_c: uart3-0 {
        pins1 {
            pinmux = <STM32_PINMUX('D', 8, AF7)>; /* UART5_TX */
            bias-disable;
            drive-push-pull;
            slew-rate = <0>;
        };
        pins2 {
            pinmux = <STM32_PINMUX('D', 9, AF7)>; /* UART5_RX */
            bias-disable;
        };
    };

    usart3_idle_pins_c: uart3-idle-0 {
        pins1 {
            pinmux = <STM32_PINMUX('D', 8, ANALOG)>; /* UART5_TX */
        };
        pins2 {
            pinmux = <STM32_PINMUX('D', 9, AF7)>; /* UART5_RX */
            bias-disable;
        };
    };

    usart3_sleep_pins_c: uart3-sleep-0 {
        pins {
            pinmux = <STM32_PINMUX('D', 8, ANALOG)>, /* UART5_TX */
                 <STM32_PINMUX('D', 9, ANALOG)>; /* UART5_RX */
        };
    };

   uart5_pins_a: uart5-0 {
       pins1 {
           pinmux = <STM32_PINMUX('B', 13, AF14)>; /* UART5_TX */
           bias-disable;
           drive-push-pull;
           slew-rate = <0>;
       };
       pins2 {
           pinmux = <STM32_PINMUX('B', 12, AF14)>; /* UART5_RX */
           bias-disable;
       };
   };

   uart5_idle_pins_a: uart5-idle-0 {
       pins1 {
           pinmux = <STM32_PINMUX('B', 13, ANALOG)>; /* UART5_TX */
       };
       pins2 {
           pinmux = <STM32_PINMUX('B', 12, AF14)>; /* UART5_RX */
           bias-disable;
       };
   };

   uart5_sleep_pins_a: uart5-sleep-0 {
       pins {
           pinmux = <STM32_PINMUX('B', 13, ANALOG)>, /* UART5_TX */
                <STM32_PINMUX('B', 12, ANALOG)>; /* UART5_RX */
       };
   };

   i2s2_pins_b: i2s2-2 {
       pins {
           pinmux = <STM32_PINMUX('C', 3, AF5)>, /* I2S2_SDO */
                <STM32_PINMUX('B', 9, AF5)>, /* I2S2_WS */
                <STM32_PINMUX('B', 10, AF5)>; /* I2S2_CK */
           slew-rate = <1>;
           drive-push-pull;
           bias-disable;
       };
   };

   i2s2_pins_sleep_b: i2s2-3 {
       pins {
           pinmux = <STM32_PINMUX('C', 3, ANALOG)>, /* I2S2_SDO */
                <STM32_PINMUX('B', 9, ANALOG)>, /* I2S2_WS */
                <STM32_PINMUX('B', 10, ANALOG)>; /* I2S2_CK */
       };
   };
};

&adc {
    /* ADC1 & ADC2 common resources */
    pinctrl-names = "default";
    pinctrl-0 = <&adc1_in6_pins_b>;
	vdd-supply = <&vdd>;
	vdda-supply = <&vdd>;
	vref-supply = <&vdd>;

    status = "okay";

    adc1: adc@0 {
        /* private resources for ADC1 */
        st,adc-channels = <19>;
        st,min-sample-time-nsecs = <10000>;
        status = "okay";
    };
};

&m_can1 {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&m_can1_pins_a>;
        pinctrl-1 = <&m_can1_sleep_pins_a>;
        status = "okay";
};

&cec {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&cec_pins_b>;
	pinctrl-1 = <&cec_pins_sleep_b>;
	status = "okay";
};

&crc1 {
	status = "okay";
};

&dac {
    pinctrl-names = "default";
    pinctrl-0 = <&dac_ch1_pins_a>;                   /* Use PA4 and PA5 pin as ANALOG */
    vref-supply = <&v3v3>;                           /* Example to use VREFBUF (It needs to be enabled as well) */
    status = "okay";                                 /* Enable the DAC block */
    dac1: dac@1 {
        status = "okay";                             /* Enable DAC1 */
    };
};

&dcmi {
    status = "okay";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&dcmi_pins_b>;
    pinctrl-1 = <&dcmi_sleep_pins_b>;

    port {
        dcmi_0: endpoint {
            remote-endpoint = <&ov5640_0>;
            bus-width = <8>;
            hsync-active = <0>;
            vsync-active = <0>;
            pclk-sample = <1>;
            pclk-max-frequency = <77000000>;
        };
    };
};

&dma1 {
	sram = <&dma_pool>;
};

&dma2 {
	sram = <&dma_pool>;
};

&dts {
	status = "okay";
};

&ethernet0 {
	status = "okay";
	pinctrl-0 = <&ethernet0_rgmii_pins_a>;
	pinctrl-1 = <&ethernet0_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>;
		};
	};
};

&gpu {
	contiguous-area = <&gpu_reserved>;
	status = "okay";
};

&hash1 {
	status = "okay";
};

&ipcc {
	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_b>;
        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>;
                };
            };
        };
    };

    typec: fusb302@22 {
        compatible = "fcs,fusb302","fairchild,fusb302";
        reg = <0x22>;
        pinctrl-names = "default";
        pinctrl-0 = <&stusb1600_pins_b>;
        int-n-gpios = <&gpiog 2 GPIO_ACTIVE_HIGH>;
        vbus-5v-gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
        status = "okay";

        connector {
            compatible = "usb-c-connector";
            label = "USB-C";
            power-role = "dual";
            power-opmode = "default";

                try-power-role = "sink";
                source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
                sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
                             PDO_VAR(3000, 12000, 3000)
                             PDO_PPS_APDO(3000, 11000, 3000)>;
                op-sink-microwatt = <10000000>;
        };
    };
};

&i2c2 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&i2c2_pins_a>;
    pinctrl-1 = <&i2c2_pins_sleep_a>;
    i2c-scl-rising-time-ns = <185>;
    i2c-scl-falling-time-ns = <20>;
    status = "okay";
    /delete-property/dmas;
    /delete-property/dma-names;

    hdmi: hdmi-transmitter@39 {
		compatible = "sil,sii9022";
		reg = <0x39>;
		iovcc-supply = <&v3v3_hdmi>;
		cvcc12-supply = <&v1v2_hdmi>;
		reset-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>;
		interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
		interrupt-parent = <&gpioh>;
		#sound-dai-cells = <1>;
		status = "okay";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				sii9022_in: endpoint {
					remote-endpoint = <&ltdc_ep0_out>;
				};
			};

			port@3 {
				reg = <3>;
				sii9022_tx_endpoint: endpoint {
					remote-endpoint = <&i2s2_endpoint>;
				};
			};
		};
	};
};

&i2c4 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&i2c4_pins_a>;
    pinctrl-1 = <&i2c4_pins_sleep_a>;
    i2c-scl-rising-time-ns = <185>;
    i2c-scl-falling-time-ns = <20>;
    status = "okay";
    /delete-property/dmas;
    /delete-property/dma-names;

	pcf8563@51{
		compatible = "nxp,pcf8563";
		irq_gpio = <&gpioi 3 IRQ_TYPE_EDGE_FALLING>;
		reg = <0x51>;
	};
#if 0
    wm8960: wm8960@1a {
        compatible = "wlf,wm8960";
        reg = <0x1a>;
        #sound-dai-cells = <0>;
        status = "okay";
        //wlf,shared-lrclk;
        wlf,capless;
        clocks = <&sai2a>;
        clock-names = "MCLK1";

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            wm8960_tx_port: port@0 {
                reg = <0>;
                wm8960_tx_endpoint: endpoint {
                    remote-endpoint = <&sai2a_endpoint>;
                };
            };

            wm8960_rx_port: port@1 {
                reg = <1>;
                wm8960_rx_endpoint: endpoint {
                    remote-endpoint = <&sai2b_endpoint>;
                };
            };
        };
    };
#else
    cs42l51: cs42l51@4a {
        compatible = "cirrus,cs42l51";
        reg = <0x4a>;
        #sound-dai-cells = <0>;
        VL-supply = <&v3v3>;
        VD-supply = <&v1v8_audio>;
        VA-supply = <&v1v8_audio>;
        VAHP-supply = <&v1v8_audio>;
        reset-gpios = <&gpioz 7 GPIO_ACTIVE_LOW>;
        clocks = <&sai2a>;
        clock-names = "MCLK";
        status = "okay";

        cs42l51_port: port {
            #address-cells = <1>;
            #size-cells = <0>;

            cs42l51_tx_endpoint: endpoint@0 {
                reg = <0>;
                remote-endpoint = <&sai2a_endpoint>;
                frame-master;
                bitclock-master;
            };

            cs42l51_rx_endpoint: endpoint@1 {
                reg = <1>;
                remote-endpoint = <&sai2b_endpoint>;
                frame-master;
                bitclock-master;
            };
        };
    };
#endif
};

&i2c5 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&i2c5_pins_a>;
    pinctrl-1 = <&i2c5_pins_sleep_a>;
    i2c-scl-rising-time-ns = <100>;
    i2c-scl-falling-time-ns = <7>;
    status = "okay";
    /delete-property/dmas;
    /delete-property/dma-names;

    ap3216c@1e {
		compatible = "LiteOn,ap3216c";
        reg = <0x1e>;
	};

    ov5640: camera@3c {
        compatible = "ovti,ov5640";
        reg = <0x3c>;
        clocks = <&clk_ext_camera>;
        clock-names = "xclk";
        DOVDD-supply = <&v2v8>;
        powerdown-gpios = <&gpioe 11 (GPIO_ACTIVE_HIGH | GPIO_PUSH_PULL)>;
        reset-gpios = <&gpioe 1 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
        rotation = <180>;
        status = "okay";

        port {
            ov5640_0: endpoint {
                remote-endpoint = <&dcmi_0>;
                bus-width = <8>;
                data-shift = <2>;
                hsync-active = <0>;
                vsync-active = <0>;
                pclk-sample = <1>;
                pclk-max-frequency = <77000000>;
            };
        };
    };
};

&i2s2 {
	clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
	clock-names = "pclk", "i2sclk", "x8k", "x11k";
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2s2_pins_a>;
	pinctrl-1 = <&i2s2_pins_sleep_a>;
	status = "okay";

	i2s2_port: port {
		i2s2_endpoint: endpoint {
			remote-endpoint = <&sii9022_tx_endpoint>;
			format = "i2s";
			mclk-fs = <256>;
		};
	};
};


&iwdg2 {
	timeout-sec = <32>;
	status = "okay";
};

&ltdc {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&ltdc_pins_b>;
	pinctrl-1 = <&ltdc_pins_sleep_b>;
	status = "okay";

	port {
		#address-cells = <1>;
		#size-cells = <0>;

		ltdc_ep0_out: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&sii9022_in>;
		};
	};
};

&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";
};

&rng1 {
	status = "okay";
};

&sai2 {
    clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
    clock-names = "pclk", "x8k", "x11k";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
    pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
    status = "okay";

    sai2a: audio-controller@4400b004 {
        #clock-cells = <0>;
        dma-names = "tx";
        clocks = <&rcc SAI2_K>;
        clock-names = "sai_ck";
        status = "okay";

        sai2a_port: port {
            sai2a_endpoint: endpoint {
                remote-endpoint = <&cs42l51_tx_endpoint>;
                format = "i2s";
                mclk-fs = <256>; 
                dai-tdm-slot-num = <2>;
                dai-tdm-slot-width = <32>;
            };
        };
    };

    sai2b: audio-controller@4400b024 {
        dma-names = "rx";
        st,sync = <&sai2a 2>;
        clocks = <&rcc SAI2_K>, <&sai2a>;
        clock-names = "sai_ck", "MCLK";
        status = "okay";

        sai2b_port: port {
            sai2b_endpoint: endpoint {
                remote-endpoint = <&cs42l51_rx_endpoint>;
                format = "i2s";
                mclk-fs = <256>;
                dai-tdm-slot-num = <2>;
                dai-tdm-slot-width = <32>;
            };
        };
    };
};

&sai4 {
    clocks = <&rcc SAI4>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
    clock-names = "pclk", "x8k", "x11k";
    status = "okay";

    sai4a: audio-controller@50027004 {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&sai4a_pins_a>;
        pinctrl-1 = <&sai4a_sleep_pins_a>;
        dma-names = "tx";
        clocks = <&rcc SAI4_K>;
        clock-names = "sai_ck";
        st,iec60958;
        status = "okay";

        sai4a_port: port {
            sai4a_endpoint: endpoint {
                remote-endpoint = <&spdif_out_endpoint>;
            };
        };
    };
};

&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>;
	broken-cd;
	st,neg-edge;
	bus-width = <4>;
	vmmc-supply = <&v3v3>;
	status = "okay";
};

&sdmmc2 {
	pinctrl-names = "default", "opendrain", "sleep";
	pinctrl-0 = <&sdmmc2_b4_pins_a>;
	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
	non-removable;
	st,neg-edge;
	bus-width = <8>;
	vmmc-supply = <&v3v3>;
	keep-power-in-suspend;
	status = "okay";
};

&sdmmc3 {
    arm,primecell-periphid = <0x10153180>;
    pinctrl-names = "default", "opendrain", "sleep";
    pinctrl-0 = <&sdmmc3_b4_pins_a>;
    pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
    pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
    non-removable;
    st,neg-edge;
    bus-width = <4>;
    vmmc-supply = <&v3v3>;
    status = "okay";
    keep-power-in-suspend;
};

&spdifrx {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&spdifrx_pins_a>;
    pinctrl-1 = <&spdifrx_pins_a>;
    status = "okay";

    spdifrx_port: port {
        spdifrx_endpoint: endpoint {
            remote-endpoint = <&spdif_in_endpoint>;
        };
    };
};

&sram {
	dma_pool: dma_pool@0 {
		reg = <0x50000 0x10000>;
		pool;
	};
};

&spi1 {
   pinctrl-names = "default", "sleep";
   pinctrl-0 = <&spi1_pins_a>;
   pinctrl-1 = <&spi1_sleep_pins_a>;
   cs-gpios = <&gpioz 3 GPIO_ACTIVE_LOW>;
   status = "okay";

    spidev: icm20608@0 {
        compatible = "alientek,icm20608";
        reg = <0>; /* CS #0 */
        spi-max-frequency = <8000000>;
    };
};

&timers4 {
    status = "okay";
    /* spare dmas for other usage */
    /delete-property/dmas;
    /delete-property/dma-names;
    pwm4: pwm {
        pinctrl-0 = <&pwm4_pins_b>;
        pinctrl-1 = <&pwm4_sleep_pins_b>;
        pinctrl-names = "default", "sleep";
        #pwm-cells = <2>;
        status = "okay";
    };
};

&usart3 {
    pinctrl-names = "default", "sleep", "idle";
    pinctrl-0 = <&usart3_pins_c>;
    pinctrl-1 = <&usart3_sleep_pins_c>;
    pinctrl-2 = <&usart3_idle_pins_c>;
    /delete-property/dmas;
    /delete-property/dma-names;
    status = "okay";
};

&uart4 {
    pinctrl-names = "default", "sleep", "idle", "no_console_suspend";
    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";
};

&uart5 {
    pinctrl-names = "default", "sleep", "idle";
    pinctrl-0 = <&uart5_pins_a>;
    pinctrl-1 = <&uart5_sleep_pins_a>;
    pinctrl-2 = <&uart5_idle_pins_a>;
    /delete-property/dmas;
    /delete-property/dma-names;
    status = "okay";
};

&uart7 {
    pinctrl-names = "default", "sleep", "idle";
    pinctrl-0 = <&uart7_pins_b>;
    pinctrl-1 = <&uart7_sleep_pins_b>;
    pinctrl-2 = <&uart7_idle_pins_b>;
    /delete-property/dmas;
    /delete-property/dma-names;
    st,hw-flow-ctrl;
    status = "okay";
};

&usbh_ehci {
    phys = <&usbphyc_port0>;
    status = "okay";
};

&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>;
        };
    };
};

&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>;
};

至此,编译正点原子的出厂Linux内核源码完成。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1446217.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

nba2k24 韩旭面补

nba2k23-24 韩旭面补 nba2k23-nba2k24通用 韩旭面补 下载地址&#xff1a; https://www.changyouzuhao.cn/9605.html

监测Nginx访问日志502情况后并做相应动作

今天带大家写一个比较实用的脚本哈 原理&#xff1a; 假设服务器环境为lnmp&#xff0c;近期访问经常出现502现象&#xff0c;且502错误在重启php-fpm服务后消失&#xff0c;因此需要编写监控脚本&#xff0c;一旦出现502&#xff0c;则自动重启php-fpm服务 场景&#xff1a; 1…

代码随想录day20--二叉树的应用8

LeetCode669.修剪二叉搜索树 题目描述&#xff1a; 给你二叉搜索树的根节点 root &#xff0c;同时给定最小边界low 和最大边界 high。通过修剪二叉搜索树&#xff0c;使得所有节点的值在[low, high]中。修剪树 不应该 改变保留在树中的元素的相对结构 (即&#xff0c;如果没…

Tied Block Convolution: 具有共享较薄滤波器的更简洁、更出色的CNN

摘要 https://arxiv.org/pdf/2009.12021.pdf 卷积是卷积神经网络&#xff08;CNN&#xff09;的主要构建块。我们观察到&#xff0c;随着通道数的增加&#xff0c;优化后的CNN通常具有高度相关的滤波器&#xff0c;这降低了特征表示的表达力。我们提出了Tied Block Convolutio…

人工智能能产生情绪吗?

此图片来源于网络 一、人情绪的本质是什么&#xff1f; 人的情绪本质是一个复杂的现象&#xff0c;涉及到生理、心理和社会的多个层面。以下是关于情绪本质的几种观点&#xff1a; 情绪的本质是生命能量的表达。情绪被认为是生命能量的一种体现&#xff0c;通过情绪的体验和…

第四节 zookeeper集群与分布式锁

目录 1. Zookeeper集群操作 1.1 客户端操作zk集群 1.2 模拟集群异常操作 1.3 curate客户端连接zookeeper集群 2. Zookeeper实战案例 2.1 创建项目引入依赖 2.2 获取zk客户端对象 2.3 常用API 2.4 客户端向服务端写入数据流程 2.5 服务器动态上下线、客户端动态监听 2…

基于大语言模型的AI Agents

代理&#xff08;Agent&#xff09;指能自主感知环境并采取行动实现目标的智能体。基于大语言模型&#xff08;LLM&#xff09;的 AI Agent 利用 LLM 进行记忆检索、决策推理和行动顺序选择等&#xff0c;把Agent的智能程度提升到了新的高度。LLM驱动的Agent具体是怎么做的呢&a…

探索Redis特殊数据结构:Geospatial(地理位置)在实际中的应用

一、概述 Redis官方提供了多种数据类型&#xff0c;除了常见的String、Hash、List、Set、zSet之外&#xff0c;还包括Stream、Geospatial、Bitmaps、Bitfields、Probabilistic&#xff08;HyperLogLog、Bloom filter、Cuckoo filter、t-digest、Top-K、Count-min sketch、Confi…

「Linux」用户操作

root用户 su&#xff1a;切换账户 语法&#xff1a;su [–] [用户名] -&#xff1a;可选&#xff0c;表示是否在切换用户后加载环境变量&#xff0c;建议带上用户名&#xff1a;表示要切换的用户&#xff0c;省略时表示切换到root切换用户后&#xff0c;通过exit命令退回上一个…

HTTP基本概念-HTTP 是什么?

资料来源 : 小林coding 小林官方网站 : 小林coding (xiaolincoding.com) HTTP 是什么? HTTP 是超文本传输协议&#xff0c;也就是HyperText Transfer Protocol。 能否详细解释「超文本传输协议」? HTTP 的名字「超文本协议传输」&#xff0c;它可以拆成三个部分: 超文本传输…

vue安装使用less,解决与webpack的冲突

第077个 查看专栏目录: VUE ------ element UI 专栏目标 在vue和element UI联合技术栈的操控下&#xff0c;本专栏提供行之有效的源代码示例和信息点介绍&#xff0c;做到灵活运用。 提供vue2的一些基本操作&#xff1a;安装、引用&#xff0c;模板使用&#xff0c;computed&a…

HeidiSQL安装配置(基于小皮面板(phpstudy))连接MySQL

下载资源 对于这款图形化工具&#xff0c;博主建议通过小皮面板&#xff08;phpstudy&#xff09;来下载即可&#xff0c;也是防止你下载到钓鱼软件&#xff0c;小皮面板&#xff08;phpstudy&#xff09;如果你不懂是什么&#xff0c;请看下面链接这篇博客 第二篇&#xff1a;…

EMC学习笔记(二十六)降低EMI的PCB设计指南(六)

降低EMI的PCB设计指南&#xff08;六&#xff09; 1.PCB布局1.1 带键盘和显示器的前置面板PCB在汽车和消费类应用中的应用1.2 敏感元器件的布局1.3 自动布线器 2.屏蔽2.1 工作原理2.2 屏蔽接地2.3 电缆屏蔽至旁路2.4 缝隙天线&#xff1a;冷却槽和缝隙 tips&#xff1a;资料主要…

蓝牙BLE学习-概述

1. 简介 1.1 蓝牙发展历程 蓝牙&#xff0c;直接来自于一位国王的名字--King Harald ‘Bluetooth Gromsson。这位国王因两件事留名于史&#xff0c;其一是在公园958年统一了丹麦和挪威&#xff0c;其二是在其死后&#xff0c;其牙齿呈现出暗蓝色的颜色&#xff0c;因而得名蓝牙…

OpenCV-36 多边形逼近与凸包

目录 一、多边形的逼近 二、凸包 一、多边形的逼近 findContours后的轮廓信息countours可能过于复杂不平滑&#xff0c;可以用approxPolyDP函数对该多边形曲线做适当近似&#xff0c;这就是轮廓的多边形逼近。 apporxPolyDP就是以多边形去逼近轮廓&#xff0c;采用的是Doug…

《Linux 简易速速上手小册》第3章: 文件系统与权限(2024 最新版)

文章目录 3.1 Linux 文件系统结构3.1.1 重点基础知识3.1.2 重点案例&#xff1a;设置一个 Web 服务器3.1.3 拓展案例 1&#xff1a;日志文件分析3.1.3 拓展案例 2&#xff1a;备份用户数据 3.2 理解文件权限3.2.1 重点基础知识3.2.2 重点案例&#xff1a;共享项目文件夹3.2.3 拓…

网络编程项目:电子辞典

项目要求&#xff1a; 登录注册功能&#xff0c;不能重复登录&#xff0c;重复注册。用户信息也存储在数据库中。单词查询功能历史记录功能&#xff0c;存储单词&#xff0c;意思&#xff0c;以及查询时间&#xff0c;存储在数据库基于TCP&#xff0c;支持多客户端连接&#x…

python安装cv2失败

问题:安装cv2包失败 解决方法&#xff1a; pip install opencv-python或在Anaconda中conda install opencv-python

二、DataX安装

DataX安装 一、简介二、系统要求三、部署 一、简介 官方地址&#xff1a;https://github.com/alibaba/DataX/blob/master/userGuid.md 二、系统要求 LinuxJDK(1.8以上&#xff0c;推荐1.8) Centos7.9的java1.8安装命令&#xff1a;yum install java-1.8.0-openjdk.x86_64 Py…

【Java程序设计】【C00254】基于Springboot的java学习平台(有论文)

基于Springboot的java学习平台&#xff08;有论文&#xff09;&#xff09; 项目简介项目获取开发环境项目技术运行截图 项目简介 这是一个基于Springboot的学习平台 本系统分为系统功能模块、管理员功能模块、教师功能模块以及学生功能模块。 系统功能模块&#xff1a;在平台…