Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated title to conform to new naming scheme.

...

  1. Follow Section 5.1.1 of the Yocto Project Development Manual to create your own layer.

  2. Create the following directories in your custom meta-layer to match the path to the barebox recipe in meta-phytec:

     

    Code Block
    mkdir recipes-bsp/
    mkdir recipes-bsp/barebox/
    mkdir recipes-bsp/barebox/files/


  3. The following patch modifies arch/arm/dts/am335x-phytec-phycore-som.dtsi. The UART1_rxd and UART1_txd pins are configured with the appropriate pads and the existing UART1 node is configured to have control over these pins. Once UART1 is configured, the standard output path is switched from UART0 to UART1. Download the patch and save it to your meta-layer under recipes-bsp/files/.

    Code Block
    From 9f49aed044075f438bb73c61912058801fb21eed Mon Sep 17 00:00:00 2001
    From: Anna Horstmann <ahorstmann@phytec.com>
    Date: Mon, 2 Mar 2015 10:35:13 -0800
    Subject: [PATCH] ARM: dts: am335x-phytec-phycore-som.dtsi: set console to UART1
    ---
     arch/arm/dts/am335x-phytec-phycore-som.dtsi | 15 ++++++++++++++-
     1 file changed, 14 insertions(+), 1 deletion(-)
    diff --git a/arch/arm/dts/am335x-phytec-phycore-som.dtsi b/arch/arm/dts/am335x-phytec-phycore-som.dtsi
    index 8c40c06..379911d 100644
    --- a/arch/arm/dts/am335x-phytec-phycore-som.dtsi
    +++ b/arch/arm/dts/am335x-phytec-phycore-som.dtsi
    @@ -1,6 +1,6 @@
     / {
     	chosen {
    -		linux,stdout-path = &uart0;
    +		linux,stdout-path = &uart1;
    
     		environment-spi {
     			compatible = "barebox,environment";
    @@ -39,6 +39,13 @@
     			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
     		>;
     	};
    +	
    +	uart1_pins: pinmux_uart1_pins {
    +                pinctrl-single,pins = <
    +                        0x180 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
    +                        0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
    +                >;
    +        };
    
     	mmc1_pins: pinmux_mmc1_pins {
     		pinctrl-single,pins = <
    @@ -173,6 +180,12 @@
     	status = "okay";
     };
    
    +&uart1 {
    +        pinctrl-names = "default";
    +        pinctrl-0 = <&uart1_pins>;
    +        status = "okay";
    +};
    +
     &davinci_mdio {
     	pinctrl-names = "default";
     	pinctrl-0 = <&davinci_mdio_default>;
    -- 
    1.9.1


  4. Create a file recipes-bsp/barebox/barebox_%.bbappend to append the barebox recipe that is in the meta-phyam335x meta layer. The following lines will include the patch in the build:

    Code Block
    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
    
    SRC_URI += " \
        file://0001-ARM-dts-am335x-phytec-phycore-som.dtsi-set-console-to-UART1.patch \
    "


  5. Once the changes have been made, rebuild barebox with the following command (executed from the Yocto build directory):

    Code Block
     bitbake barebox -f -c compile && bitbake barebox


  6. Copy the images to your desired boot source. 

  7. For the kernel to use UART1 as the serial console instead of UART0, change the file /etc/inittab in the root filesystem. If booting from SD card, this can be done from your Host machine. Modify the line “O0:12345:respawn:/sbin/getty 115200 ttyO0” to:

    Code Block
    O1:12345:respawn:/sbin/getty -L 115200 ttyO1


...