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.

No messages starting linux kernel

Other Parts Discussed in Thread: UNIFLASH, AM4372, PROFIBUS

Background:

Custom board
Processor: AM4379BZDNA100
Linux distro: TI PROCESSOR-SDK-LINUX-AM437X v2.00.00.00 (Linux v4.1.6)
Main com port: UART1
Boot mode[4:0]: 10111b EMAC1, SPI, QSPI, MMC1
UniFlash: Running on Win7 PC
Linux build environment: Ubuntu 14.04.1 VM

Situation:

I have made necessary modifications to u-boot to operate on UART1 instead of UART0.

My end game for now, is to load an initramfs version of linux for use in formating the eMMC1 device for eventual system bootup - using the following reference as a rough guide: http://processors.wiki.ti.com/index.php/Sitara_Linux_Program_the_eMMC_on_Beaglebone_Black

I am using CCS UniFlash (Win7 PC) to load u-boot-spl.bin and u-boot.img into the processor via EMAC1 and u-boot starts successfully - u-boot messages shown below.  I am now trying to use the u-boot command "run netboot" to manually load a linux uImage and device tree binary via tftp with UniFlash as the server.  The files are transferred successfully via tftp but on kernel startup I get absolutely no output and I suspect that it may be because we are trying to use UART1 instead of UART0 but not certain.

I modified the kernel to add "low-level" debug messages to the output on UART2 hoping this might provide more info but no change in the results.

Anything I am missing here?  Is it not showing output simply because we are not using uart0? if so, how do I modify the kernel to use uart1 (u-boot console env setting already changed to /dev/ttyO1)?  Is netboot trying to start from an uncompressed image?

Thanks in advance.  I hope I've provided all the pertinent information needed below...

Tim

U-boot output after loading from UniFlash

U-Boot SPL 2015.07-00114-gf8d68d1-dirty (Nov 05 2015 - 16:02:14)
Using default environment

mac addr: c4:be:84:cc:78:f4
<ethaddr> not set. Validating first E-fuse MAC
Registering cpsw_data...
cpsw
cpsw Waiting for PHY auto negotiation to complete.... done
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
Using cpsw device
TFTP from server 192.168.2.1; our IP address is 192.168.2.2
Filename 'u-boot-restore.img'.
Load address: 0x807fffc0
Loading: ####################
         1.2 MiB/s
done
Bytes transferred = 279228 (442bc hex)


U-Boot 2015.07-00114-gf8d68d1-dirty (Nov 05 2015 - 16:02:14 -0500)

I2C:   ready
DRAM:  1 GiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1

** Unable to use mmc 1:1 for loading the env **
Using default environment

Net:   mac addr: c4:be:84:cc:78:f4
<ethaddr> not set. Validating first E-fuse MAC
Registering cpsw_data...
cpsw, usb_ether
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Card did not respond to voltage select!
** Bad device mmc 0 **
starting USB...
USB0:   Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

USB device 0: unknown device
U-Boot#

"run netboot" output

U-Boot# run netboot
Booting from network ...
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.2.2 (7 ms)
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.2.1; our IP address is 192.168.2.2
Filename 'uImage'.
Load address: 0x82000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##################################
3.1 MiB/s
done
Bytes transferred = 52978528 (3286360 hex)
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.2.1; our IP address is 192.168.2.2
Filename 'am437x-ndct.dtb'.
Load address: 0x88000000
Loading: ###
2.2 MiB/s
done
Bytes transferred = 36426 (8e4a hex)
Kernel image @ 0x82000000 [ 0x000000 - 0x3286360 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff4000, end 8ffffe49 ... OK

Starting kernel ...

printenv from u-boot

U-Boot# printenv
arch=arm
args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
baudrate=115200
board=am43xx
board_name=am43xx
bootcmd=run findfdt; run mmcboot;run usbboot;
bootdelay=1
bootdir=/boot
bootenv=uEnv.txt
bootfile=zImage
bootm_size=0x10000000
bootpart=0:2
console=ttyO1,115200n8
cpu=armv7
devnum=0
devtype=usb
dfu_alt_info_emmc=MLO raw 0x100 0x100 mmcpart 0;u-boot.img raw 0x300 0x1000 mmcpart 0
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
dfu_bufsiz=0x10000
eth1addr=c4:be:84:cc:78:f6
ethact=cpsw
ethaddr=c4:be:84:cc:78:f4
fdt_addr_r=0x88000000
fdtaddr=0x88000000
fdtfile=am437x-ndct.dtb
findfdt=setenv fdtfile am437x-ndct.dtb
finduuid=part uuid mmc ${mmcdev}:2 uuid
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
kernel_addr_r=0x82000000
loadaddr=0x82000000
loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz
mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${devnum};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run loadfdt; echo Booting from mmc${mmcdev} ...; run args_mmc; bootz ${loadaddr} - ${fdtaddr}; fi;fi;
mmcdev=1
mmcrootfstype=ext4 rootwait
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
netloadfdt=tftp ${fdtaddr} ${fdtfile}
netloadimage=tftp ${loadaddr} ${bootfile}
nfsopts=nolock
partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
ramdisk_addr_r=0x88080000
ramroot=/dev/ram0 rw
ramrootfstype=ext2
rdaddr=0x88080000
rootpath=/export/rootfs
soc=am33xx
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial
usbargs=setenv bootargs console=${console} ${optargs} root=${usbroot} rootfstype=${usbrootfstype}
usbboot=setenv devnum ${usbdev}; setenv devtype usb; usb start ${usbdev}; if usb dev ${usbdev}; then if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run loadfdt; echo Booting from usb ${usbdev}...; run usbargs;bootz ${loadaddr} - ${fdtaddr}; fi;fi
usbdev=0
usbnet_devaddr=c4:be:84:cc:78:f6
usbroot=/dev/sda2 rw
usbrootfstype=ext4 rootwait
vendor=ti
ver=U-Boot 2015.07-00114-gf8d68d1-dirty (Nov 05 2015 - 16:02:14 -0500)

Environment size: 3325/65532 bytes
U-Boot#

DTS file am437x-ndct.dts

/*
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

/dts-v1/;

#include "am4372.dtsi"
#include <dt-bindings/pinctrl/am43xx.h>
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
model = "Generic AM43 (Flattened Device Tree)";
compatible = "ti,am4372","ti,am43"; //"ti,am437x-gp-evm",

// gpio_keys: gpio_keys {
// compatible = "gpio-keys";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio_keys_pins_default>;
// #address-cells = <1>;
// #size-cells = <0>;

// switch@0 {
// label = "power-button";
// linux,code = <KEY_POWER>;
// gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
// };

// Uncomment this section if we want to use gpio-keys driver instead of sysfs GPIO
// oled@0 {
// label = "oled-button";
// linux,code = <0>; // select a more appropriate key value than 0!
// gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
// };

// Uncomment this section if we want to use gpio-keys driver instead of sysfs GPIO
// profi-int@0 {
// label = "profi-interrupt";
// linux,code = <0>; // select a more appropriate key value than 0!
// gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
// };
// };
};

&am43xx_pinmux {
// gpio_keys_pins_default: gpio_keys_pins_default {
// pinctrl-single,pins = <
// 0xb8 (PIN_INPUT | MUX_MODE7) /* (C20) dss_data6.gpio2[12] - Profibus INT input */
// 0x180 (PIN_INPUT | MUX_MODE7) /* (K21) udart1.rxd.gpio0[14] - OLED button input */
// 0x1b8 (PIN_INPUT | MUX_MODE7) /* cam0_field.gpio4_2 - User switch SW1 on IDK */
// >;
// };

i2c0_pins_default: i2c0_pins_default {
pinctrl-single,pins = <
0x188 (PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_sda.i2c0_sda */
0x18c (PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_scl.i2c0_scl */
>;
};

i2c0_pins_sleep: i2c0_pins_sleep {
pinctrl-single,pins = <
0x188 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x18c (PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};

i2c1_pins_default: i2c1_pins_default {
pinctrl-single,pins = <
0x20c (PIN_INPUT | SLEWCTRL_FAST | MUX_MODE3) /* cam0_data1.i2c1_scl */
0x208 (PIN_INPUT | SLEWCTRL_FAST | MUX_MODE3) /* cam0_data0.i2c1_sda */
>;
};

i2c1_pins_sleep: i2c1_pins_sleep {
pinctrl-single,pins = <
0x20c (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x208 (PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};

mmc1_pins_default: pinmux_mmc1_pins_default {
pinctrl-single,pins = <
0x80 (PIN_INPUT | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
0x84 (PIN_INPUT | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
0x3c (PIN_INPUT | MUX_MODE2) /* gpmc_ad15.mmc1_dat7 */
0x38 (PIN_INPUT | MUX_MODE2) /* gpmc_ad14.mmc1_dat6 */
0x34 (PIN_INPUT | MUX_MODE2) /* gpmc_ad13.mmc1_dat5 */
0x30 (PIN_INPUT | MUX_MODE2) /* gpmc_ad12.mmc1_dat4 */
0x2c (PIN_INPUT | MUX_MODE2) /* gpmc_ad11.mmc1_dat3 */
0x28 (PIN_INPUT | MUX_MODE2) /* gpmc_ad10.mmc1_dat2 */
0x24 (PIN_INPUT | MUX_MODE2) /* gpmc_ad9.mmc1_dat1 */
0x20 (PIN_INPUT | MUX_MODE2) /* gpmc_ad8.mmc1_dat0 */
// 0x (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
>;
};

mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
pinctrl-single,pins = <
0x80 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn1.mmc1_clk */
0x84 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn2.mmc1_cmd */
0x3c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad15.mmc1_dat7 */
0x38 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad14.mmc1_dat6 */
0x34 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad13.mmc1_dat5 */
0x30 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad12.mmc1_dat4 */
0x2c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad11.mmc1_dat3 */
0x28 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad10.mmc1_dat2 */
0x24 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad9.mmc1_dat1 */
0x20 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad8.mmc1_dat0 */
>;
};

uart1_pins_default: uart1_pins_default {
pinctrl-single,pins = <
0x178 (DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE0)
0x17C (DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE0)
0x180 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart1_rxd.uart1_rxd */
0x184 (PIN_INPUT | PULL_DISABLE | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart1_txd.uart1_txd */
>;
};

uart1_pins_sleep: uart1_pins_sleep {
pinctrl-single,pins = <
0x178 (DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7)
0x17C (DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7)
0x180 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart1_rxd.uart1_rxd */
0x184 (PIN_INPUT_PULLDOWN | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart1_txd.uart1_txd */
>;
};


cpsw_default: cpsw_default {
pinctrl-single,pins = <
0x12c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txclk.rgmii1_tclk */
0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.rgmii1_tctl */
0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii1_td0 */
0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii1_td1 */
0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii1_td2 */
0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii1_td3 */
0x130 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxclk.rmii1_rclk */
0x118 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxdv.rgmii1_rctl */
0x140 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd0.rgmii1_rd0 */
0x13c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd1.rgmii1_rd1 */
0x138 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd0.rgmii1_rd2 */
0x134 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd1.rgmii1_rd3 */
>;
};

cpsw_sleep: cpsw_sleep {
pinctrl-single,pins = <
0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};

davinci_mdio_default: davinci_mdio_default {
pinctrl-single,pins = <
/* MDIO */
0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
>;
};

davinci_mdio_sleep: davinci_mdio_sleep {
pinctrl-single,pins = <
/* MDIO reset value */
0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};

/* These pinmux settings are piggy-backed onto the normal mmc1 pinmuxes just to get these setup properly for the ICSS0_PRU1 to drive the OLED display using memory mapped driver in userspace */
// pruoled_pins_default: pruoled_pins_default {
// pinctrl-single,pins = <
// 0xe0 (PIN_INPUT | DS0_PULL_UP_DOWN_EN | MUX_MODE7) /* dss.vsync gpio2[12] - Yellow LED */
// 0x1d0 (PIN_INPUT | DS0_PULL_UP_DOWN_EN | MUX_MODE3) /* Reset */
// 0x1d4 (PIN_INPUT | DS0_PULL_UP_DOWN_EN | MUX_MODE3) /* SPI Clk */
// 0x1f4 (PIN_INPUT | DS0_PULL_UP_DOWN_EN | MUX_MODE4) /* SPI dout */
// 0x1fc (PIN_INPUT | DS0_PULL_UP_DOWN_EN | MUX_MODE4) /* SPI CS */
// 0x204 (PIN_INPUT | DS0_PULL_UP_DOWN_EN | MUX_MODE4) /* C/D */
// >;
// };
};

&i2c0 {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c0_pins_default>;
pinctrl-1 = <&i2c0_pins_sleep>;
clock-frequency = <100000>;

// at24@50 {
// compatible = "at24,24c256";
// pagesize = <64>;
// reg = <0x50>;
// };
};

&i2c1 {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c1_pins_default>;
pinctrl-1 = <&i2c1_pins_sleep>;
clock-frequency = <100000>;
};

&epwmss0 {
status = "okay";
};

//&ecap0 {
// status = "okay";
// pinctrl-names = "default";
// pinctrl-0 = <&ecap0_pins_default>;
//};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&gpio2 {
status = "okay";
};

&gpio4 {
status = "okay";
};

&gpio5 {
status = "okay";
};

&uart1 {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart1_pins_default>;
pinctrl-1 = <&uart1_pins_sleep>;
};

&mmc1 {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&mmc1_pins_default>;//,<&pruoled_pins_default>;
pinctrl-1 = <&mmc1_pins_sleep>;//,<&pruoled_pins_default>;
bus-width = <8>;
// cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
};

&mac {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = "okay";
};

&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
status = "okay";
};

&cpsw_emac0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "rgmii";
};

&rtc {
status = "okay";
ext-clk-src;
};

&wdt {
status = "okay";
};

&cpu {
// cpu0-supply = <&tps>;
};

//&sgx {
// status = "okay";
//};

  • I will ask the Linux team to check this.
  • Hi Tim,

    This seems like the wrong/erroneous dts file is used.

    At first glance at your dts, I can see that there are no child nodes within i2c0, and you should at least have the pmic child node set there. Have a look at any other am43xx dts for reference.

    Another thing, which may not be relevant, in u-boot/include/configs/am43xx_evm.h, can you try changing the bootfile to uImage?

    Best Regards,
    Yordan
  • Hi Yordan,

    Our design does not use the PMIC.  We use pre-programmed EXAR power supplies to sequence the the power to the processor and have checked that operation closely - all appears correct with that.  Is it possible the kernel is expecting the PMIC to be there?  I have attached the kernel config file below.

    I did also change the bootfile from zImage to uImage but with no change in the results.  With low-level debug messages and earlyprintk options enabled in the kernel should I at least expect to see messages about decompressing the kernel image?  I am still concerned that I do not have configured the kernel to use uart1 properly somewhere but not sure if that is the issue or not.

    My config file is attached below.  I noticed that CONFIG_TTY_PRINTK is not set (after reading help on this, I don't think it is necessary).  Is that perhaps why I do not see any of the earlyprintk messages?

    Thanks,

    Tim

    am437x-ndct-debuginitramfs_defconfig.txt

  • Hi Tim,

    Tim Dicke said:
     With low-level debug messages and earlyprintk options enabled in the kernel should I at least expect to see messages about decompressing the kernel image?

    Yes, enabling low-level debug & earlyprintk options is a good idea. You should be able to see additional information on your serial console, and setting CONFIG_TTY_PRINTK should help. 

    I'll check the config file & dts to see if I find something wrong in your setup.

    Regarding your doubt on pmic:  

    Tim Dicke said:
    Our design does not use the PMIC.  We use pre-programmed EXAR power supplies to sequence the the power to the processor and have checked that operation closely - all appears correct with that.  Is it possible the kernel is expecting the PMIC to be there?  

     

    Kernel does not necessarily expect pmic. But usually some modules nodes (i.e. &cpu, &mmc, ) in dts are set to use some voltage defined in the power supply node (in general case this is the tps chip). So, IMO, you should have some description of your pre-programmed EXAR power supplies in the dts. 

    Best Regards, 
    Yordan

  • OK.  I tried enabling CONFIG_TTY_PRINTK but still no new output after starting the kernel.  Just for my own clarification, my understanding is that after the u-boot scripts create the bootargs and load all the relevant pieces into memory (compressed kernel image and device tree), it first starts to execute a small piece of "bootstrap" code at the head of the kernel that is required to decompress the kernel image and in this case the initramfs.  This happens even ahead of processing the device tree correct?  Are the earlyprintk messages buffered until after the kernel configures the uart?  Is this perhaps why I don't see the early printks assuming the kernel hangs before the finish of device tree processing?  Just hoping to understand this better so I know where to start looking for the problem.

    I am not sure what definitions are needed for our EXAR power supply in the dts.  Are you able to provide some guidance here?

    Thanks again, Tim.

  • Hi Yordan,

    Any new information you can supply here?  It has been a while.  I did some more to try and troubleshoot how for the boot process is progressing.  I am still not able to get any linux  kernel messages to output and not sure why.  I added my own very simple print function in misc.c so I could track the progress of the function decompress_kernel, as well as a few cache init functions and all looks ok.  I see plenty of puts and error functions in the linux preloader but I am not able to get any of them to send output to uart1 for some reason.  I'm sure I'm still missing something in the kernel setup to allow this but don't know what it could be.

    #define UART1_BASE 0x48022000
    #define UART_THD 0x0
    static void myputc(const char ch)
    {
     *((unsigned long *)(UART1_BASE+UART_THD)) = ch;
    }

    I tried to use the same technique to track progress in the kernel initialization but my simple function above no longer works there and causes the kernel to hang I think (not really sure).

    Thanks again for your help.

    Tim

  • I made a little bit of progress getting debug messages to come out from the linux preloader.  In the menuconfig output I supplied above, I had selected CONFIG_DEBUG_OMAP2UART2=y to try and enable debug messages to be routed to UART2 (ttyO1).  This did not work.  Instead, I have now selected CONFIG_DEBUG_LL_UART_8250=y.  This also forces one to configure both CONFIG_DEBUG_UART_PHYS and CONFIG_DEBUG_UART_VIRT.  For CONFIG_DEBUG_UART_PHYS it is easy to find the physical address of the appropriate UART in the TRM.

    CONFIG_DEBUG_UART_PHYS=0x48022000 (for UART2 - ttyO1)

    But I'm not sure what address to use for CONFIG_DEBUG_UART_VIRT.  It looks like there are predefined virtual addresses defined for other processors searching the web but couldn't find values for the AM437x.  Any ideas?

    I now get the following messages out before the system hangs...

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.

    Thanks,

    Tim

  • Hi Tim,

    Sorry for the delayed response.

    I checked your config file again, and noticed the following:

    You set Main com port: UART1, but in the kernel config file there is the following CONFIG_DEBUG_OMAP2UART2=y, which as per debug/omap2plus.S sets UART2 as your debug console. Can you verify that there is no mismatch between u-boot & kernel configuration in this regard (debug uart used).

    Best Regards,
    Yordan
  • Hi,

    For this last part:

    "Uncompressing Linux... done, booting the kernel."

    Check this guide first: processors.wiki.ti.com/.../Kernel_-_Common_Problems_Booting_Linux

    Best Regards,
    Yordan
  • Hi Yordan,

    U-Boot# run args_mmc

    U-Boot# printenv bootargs

    bootargs=console=ttyO1,115200n8 root=PARTUUID=f6c1ce4b-b669-584e-b679-a5619081822f rw rootfstype=ext4 rootwait

    I've also attached my updated menuconfig file for reference.

    am437x-ndct_defconfig.txt

  • Hi Yordan,

    I'm having a similar problem as Tim, and I wanted to jump in here if I could. I do not believe that CONFIG_DEBUG_OMAP2UART2=y is the correct setting here. Looking in the AM437x reference manual, UART1 registers start at 0x4802200. In debug/omap2plus.S, this corresponds to TI8XX_UART2_BASE (similarly, AM437X UART0 corresponds to TI81XX_UART1_BASE and AM437X UART2 corresponds to TI81XX_UART3_BASE).
  • Hi Tim,

    I'm seeing a similar issue, and I can make it happen on the TI's GP EVM as well. Specifically:

    1. Use branch ti2013.12.01 from git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git

    2. Use the arch/arm/boot/dts/am437x-gp-evm.dts dts.

    3. Use the tisdk_am437x-evm_defconfig config, which is their default config for from the ti2013.12.01 tag, excepting that I've enabled low level debugging and early printk.

    Now, if you build all that, it works fine, but you don't get any early printk because you haven't set earlyprintk in U-Boot. If you do so, then you get nothing past "Starting Kernel". Now, I hacked it a bit and got some stuff printing out the serial port, but it doesn't quite work because it causes the system to hang after the call to local_flush_tlb_all (basically, when it dereferences the pointer to initial_boot_params in order to get at anything in that struct).

    So, basically, using TI's reference implementation on TI hardware, early printk is broken. Any help that TI can provide to assist in this issue would be greatly appreciated. I expect that, if you fix the above issue with the EVM, the same fix will likely fix Tim's issue.

  • Oh, also - I tried this using the ti2015.01 branch, thinking maybe someone has fixed it later on. It does not appear so, still broken.

    Now, that said, it could be that my config is wrong. I fail to believe they shipped a reference kernel implementation with a nonworking early printk setup. If so, a simple config tweak should set it right.
  • Might be a long shot, but a customer was having similar difficulty with ProcessorSDK1.03 and not using UART0 as the Linux console. They found when /sbin/init was running, it was calling /etc/rcS.d/S03udev that has a check for devtmpfs. But they had NOT enabled Device Drivers -> Generic Driver Options->Maintain/Automount devtmpfs in menuconfig.

    Thus instead of writing error messages to a tty device, they were going to a file. Once the logging was fixed, they were able to trace a couple of minor errors to get booting. Turns out SDK6 populates /dev while ProcSDK does not (they actually fixed by populating the same /dev file from SDK6 to ProcSDK especially tty0 as type "c" for character device. This allowed the script to assign ttyO3 to tty0). The new lines in /etc/init.d/udev (symlink for S03udev) for did not matter in SDK6.
  • Hi Joe,

    I'm pretty sure that's not it, because:

    1. The earlyprintk messages are supposed to come out before init runs.
    2. If I don't pass earlyprintk on the command line, I get the "normal" console output messages.
    3. This is on the EVM, so UART0 is the console.
    4. That option is selected in TI's reference config, and I didn't disable it.

    Thanks for the thought though.

  • Hi Matthew,

    I think it may be working for me.  I was missing the earlyprintk in my boot options.  now that I have that the messages below are what I get:

    U-Boot SPL 2015.07-00114-gf8d68d1-dirty (Dec 07 2015 - 13:36:50)
    USB0:   Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 2 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2015.07-00114-gf8d68d1-dirty (Dec 07 2015 - 13:36:50 -0500)
    
    I2C:   ready
    DRAM:  1 GiB
    Success probing Si5388 at 0x70 - Initializing...
    Si5388 disable all outputs.
    Si5388 pause LOL.
    Si5388 set register map.
    Si5388 validating input clock status.
    Si5388 configuring PLL for locking.
    Si5388 initiate locking of PLL.
    Si5388 restart LOL.
    Si5388 waiting for PLL lock...
    Si5388 LOS status = 0x8.
    Si5388 copying FCAl values.
    Si5388 set PLL to use FCAl values.
    Si5388 enable outputs.
    Si5388 initialization complete.
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc1:1 **
    Using default environment
    
    Net:   mac addr: c4:be:84:cc:7d:6b
    <ethaddr> not set. Validating first E-fuse MAC
    Registering cpsw_data...
    cpsw, usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading uEnv.txt
    732 bytes read in 2 ms (357.4 KiB/s)
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    starting USB...
    USB0:   Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 2 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    
    USB device 0:
        Device 0: Vendor: JetFlash Rev: 1100 Prod: Transcend 2GB
                Type: Removable Hard Disk
                Capacity: 2048.0 MB = 2.0 GB (4194304 x 512)
    ... is now current device
    reading uEnv.txt
    738 bytes read in 27 ms (26.4 KiB/s)
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    3526552 bytes read in 2123 ms (1.6 MiB/s)
    35996 bytes read in 285 ms (123 KiB/s)
    Booting from usb 0...
    Kernel image @ 0x82000000 [ 0x000000 - 0x35cf98 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff4000, end 8ffffc9b ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 4.1.6-g52c4aa7 (udsp@udsp-VirtualBox) (gcc version 4.9.3 20150413 (prerelease) (Linaro GCC 4.9-2015.05) ) #18 SMP Mon Dec 7 18:15:12 EST 2015
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine model: Generic AM43 (Flattened Device Tree)
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] cma: Reserved 16 MiB at 0xbf000000
    [    0.000000] Memory policy: Data cache writeback
    

    My uEnv.txt file: 

    # 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.
    #optargs=video=HDMI-A-1:800x600
    optargs=earlyprintk
    
    # Uncomment the following line to enable HDMI display and disable LCD display.
    #fdtfile=am437x-gp-evm-hdmi.dtb
    

  • Hi Tim,

    I don't think those aren't the early printk output. By the time you see the timestamps leading the messages, they're the ones that printk has buffered and then spits out once the main console has been set up. That's why their timestamp is all 0.00000.

    Early printk messages look like this:

    ## Booting kernel from Legacy Image at 90000000 ...
       Image Name:   Linux-3.12.10-00023-g508133e
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4135088 Bytes = 3.9 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 85000000
       Booting using the fdt blob at 0x85000000
       Loading Kernel Image ... OK
       Loading Device Tree to bef2f000, end bef3b70c ... OK
    
    Starting kernel ...
    
    6Booting Linux on physical CPU 0x0
    5Linux version 3.12.10-00023-g508133e (mattc@E2-06L) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #32 Fri Dec 4 13:11:37 EST 2015
    CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    6Machine: Generic AM43 (Flattened Device Tree), model: TI AM437x gp EVM
    7search "chosen", depth: 0, uname: 
    7search "chosen", depth: 1, uname: chosen
    7Looking for initrd properties... 7Command line is: console=0,115200 sxid=sxni-am43xx_cpu9 sxserno= panic=5 ubi.mtd=8 ubi.mtd=9 ubi.mtd=10 root=ubi0_0 mtdparts=nand.0:128k(spl0),128k(spl1),128k(spl2),128k(spl3),1m(uboot),256k(env1),256k(env2),64M(buffer),64M(root1),64M(root2),8M(config),7dt_root_size_cells = 1
    7dt_root_addr_cells = 1
    7memory scan node memory, reg size 8, data: 80 40 2000000 1000000,
    7 - 80000000 ,  40000000
    6cma: CMA: reserved 24 MiB at ae000000
    Memory policy: ECC disabled, Data cache writeback
    7On node 0 totalpages: 261376
    7free_area_init_node: node 0, pgdat c08426f0, node_mem_map c087d000
    7  Normal zone: 1520 pages used for memmap
    7  Normal zone: 0 pages reserved
    7  Normal zone: 194560 pages, LIFO batch:31
    7  HighMem zone: 528 pages used for memmap
    7  HighMem zone: 66816 pages, LIFO batch:15
    

    And then, after that, it should flip the console to the new one and will emit what you see.

    I do find it interesting that you don't see a hang when you enable earlyprintk.. but you're also not getting the early messages.

  • Hi Matthew,

    I think I have progressed to the point you referenced in your second post. Using a sprinkling of pr_info() calls, I've traced startup progress to the point where local_flush_tlb_all() is called from within devicemaps_init(). It hangs there. I guess you believe that this is related enabling earlyprintk correct? Just want to make sure I am getting on the same page as you...

    Thanks,

    Tim
  • Hi Tim,

    Yes, I believe we are on the same page. For giggles, remove the optargs=earlyprintk from your uEnv.txt. I would speculate that you would lose your early printk formatting, but would get the same boot messages which you were getting in your post above (the ones with [ 0.000000] leading the lines.
  • I tried removing earlyprintk option but lost all the messages:
    Kernel image @ 0x82000000 [ 0x000000 - 0x35cff0 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff4000, end 8ffffc9b ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    

  • I think CONFIG_PRINTK_TIME=y is what controls the time formatting preceding the messages not CONFIG_EARLY_PRINTK=y and the earlyprintk boot option.
  • CONFIG_PRINTK_TIME does control that formatting, but IIRC, they're prepended to the normal printk output not the early printk output.

    Also, I have that enabled and do not see them in my "fudged" early printk output (which is cheating).

    The fact that your boot messages go away when you drop earlyprintk is very interesting. Might you share your config? It's possible that there is some missing option in my mod of the TI EVM config which you have found, and, by comparing the two, I might find out what it is. This would mean that I am wrong about the timestamps only being on the post-console-init messages, and you are indeed seeing early printk output, but I can handle that if we're moving forward.

    Thanks.
  • See attached...  I think my address for CONFIG_DEBUG_UART_VIRT is almost certainly wrong but don't know what it should be.

    7875.am437x-ndct_defconfig.txt

  • Please keep in mind that I am using the 4.1.6 Kernel. Perhaps the difference in output format is due to recent changes there? Are you still working with the earlier SDK? I think I recall you said you tried both in an earlier post?
  • Hi Matthew,

    Maybe you already understand this, but I am beginning to believe that the console uart and the low-level debug uart are actually 2 different ports. Normally configured to be the same but could be different. I see debug uart output that causes the kernel to hang for some mysterious reason but I'm not sure I see any output from the console uart. If I disable the earlyprintk option so that the kernel does not hang as we've seen, my board reacts differently in that there are some LEDs controlled by digital IO pins that are turned on in u-boot and they are eventually turned off by the kernel when it is allowed to progress further than the earlyprink option allows. Just thinking "out loud" here a little...
  • Okay, so I grabbed your config and I noticed that the main difference is that you're using the generic 8250 UART option whereas I was using the TI81XX option. This ends up using different drivers, hence the different behavior. When I enable the generic 8250 UART and give it the address of UART0 (for the EVM), I get the same results as you do, namely:

    Kernel image @ 0x80200000 [ 0x000000 - 0x3f1770 ]
    ## Flattened Device Tree blob at 80f80000
       Booting using the fdt blob at 0x80f80000
       Loading Device Tree to 9fff1000, end 9ffff587 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 3.12.10-00003-ge9bef61 (mattc@E2-06L) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #3 Wed Dec 9 12:57:09 EST 2015
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: Generic AM43 (Flattened Device Tree), model: TI AM437x gp EVM
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] cma: CMA: reserved 24 MiB at ae000000
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    

    So, it appears that I was either in error, or the different drivers have slightly different output formats.

    Answering other questions:

    1. Yes, I am on the earlier kernel. 3.12 series.
    2. Yes, the console UART and the low-level debug UART can be 2 different ports, but they should also be allowed to be the same (at least, they have been in the past). The idea is that the debug one is used until the main one is initialized. I find that the debug output is vital for figuring out problems with device tree misconfiguration - hence why I'm working on getting the debug stuff working on the EVM, as it has a known working device tree. It is quite possible that your board is booting enough that you should be able to see console messages - you just need to have your console boot parameter properly set (something like console=ttyS1,115200.. though looking at the EVM, it looks like (at least on 3.12) the device may be named ttyO1.
    3. For what it's worth, I've tried setting the consoles to two different ports in case they're fighting each other - no improvement.

  • Thanks again Matthew. I have the console boot parameter set to "console=ttyO1,115200n8". I do not get any console output however when earlyprintk is disabled. Maybe just to add to my confusion, the UARTs are numbered 1-6 in the AM437x TRM. In the DTS files they are referenced as uart0-5. The console boot parameters go ttyO0, ttyO1, ttyO2... Is it possible I've got everything crossed up? I know TRM-UART1 is not available on my board - that is now wired to a CAN port so there's no opportunity to revert to the TI SDK defaults at this point.

    Does the dts file come into play getting the console uart configured, pinmuxed and working (I suspect it does)?

    Obviously, I've been working with UART2 (0x48022000) in U-boot with great success but have been unable to translate that good fortune to the kernel. I did however have to hack at u-boot a decent amount to TRM-UART2 to start up as the u-boot console...
  • I also tried setting the consoles to two different ports and got the same results as you - no change. I also forgot to mention this earlier but there is a fairly ominous comment at the top of devicemaps_init():

    /*
    * Set up the device mappings. Since we clear out the page tables for all
    * mappings above VMALLOC_START, we will remove any debug device mappings.
    * This means you have to be careful how you debug this function, or any
    * called function. This means you can't use any function or debugging
    * method which may touch any device, otherwise the kernel _will_ crash.
    */

    Maybe you already saw that too. It seems to indicate that the kernel will crash if you use any previously mapped device (like the console?) to try and debug this function. Just wondering if this also holds for printk's to the console called after this function returns. Doesn't really seem like that was the intent but seems like it may be related to the issue at hand...

    Tim
  • I fear your TRM might be different than mine. I have SPRUHL7A from Oct 2014 and says:
    UART0 0x44E0_9000
    UART1 0x4802_2000
    UART2 0x4802_4000
    UART3 0x481A_6000
    UART4 0x481A_8000
    UART5 0x481A_A000

    and that matches what the reference .dts from the SDK says.

    For what it's worth, I have a board where we did similar - we used the UART 0 pins as GPIOs, so I'm trying to do the same thing as you are. I just also have one of the EVMs, so I'm using that as known good to try and fix the early printk on it so I can fix my board.

    The dts file does come into play getting the console UART configured and pinmuxed, though I have all of the muxing done in U-Boot, so theoretically I could have the .dts leave it along and it should be fine.

    I also have 0x48022000 (which I call UART1) working in U-Boot without issue, but also am not able to get that working under Linux. I also can't even get any early printk stuff out that port on my board, even using similar settings as you did on the EVM (where get some basic output and then it hangs).
  • I was wrong before.  While I do have a newer version of the TRM (SPRUHL7D from April 2015) it does reference them the same as you described above.  I think I got them confused with the uboot references to COM1-COM6 and the menuconfig references to debug UARTs being 1 based instead of 0-based.  I'm easily confused though... ;)

    I don't know if you found this 

    Thought maybe it might offer some clues to you that I've not been able to glean out of it.

    Tim

  • Hi Tim,

    No, that doesn't really help. Sorry.

    However, I have made some progress. I note that this is on MY protoboard, not the EVM, so the config is slightly different. I've found that:

    1. Setting the config to use CONFIG_DEBUG_TI81XXUART2 works for AM437x UART1. So, the generic 8250 UART is not necessary.
    2. If I do the above, and set earlyprintk for the kernel command line, I get early printk messages.
    3. The failure after local_flush_tlb is cured by restricting where U-Boot puts the FDT. The environment variable fdt_high is key here. Using the value 0xa0000000 (which is what the reference u-boot environment uses), prevents a page fault I was seeing.

    Now I'm at the point where it just hangs (just like the EVM) and I'm trying to chase down why. It's not complaining about the dts, so it's something else.

    I also note that if I turn off earlyprintk, then it doesn't hang, it just reboots after some amount of time, which suggests that the kernel is panicking and then rebooting before the console is up, so I'm likely going to try dumping the __log_buf section of memory out of the JTAG port to get at those debug messages.
  • Wow Matthew!  Thanks.  I swear I tried configuring for CONFIG_DEBUG_TI81XXUART2 but maybe that was before I realized I needed to have the earlyprintk in my boot options as well as in the menuconfig setup not sure.  Poking around the code I found what looked like support for CONFIG_DEBUG_AM33XXUART2 but there wasn't an option to select it in the menuconfig.  I tried adding it manually but it did not work.

    I did not quite understand what you were referring to for the fdt_high environment variable so I did not make that change.  Maybe I don't need this for my board? These are my boot messages now (I think I'm past the point where the earlyprintk would hang before):

    Kernel image @ 0x82000000 [ 0x000000 - 0x35d2f8 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff4000, end 8ffffc9b ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 4.1.6-g52c4aa7 (udsp@udsp-VirtualBox) (gcc version 4.9.3 20150413 (prerelease) (Linaro GCC 4.9-2015.05) ) #43 SMP Thu Dec 10 11:52:17 EST 2015
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine model: Generic AM43 (Flattened Device Tree)
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] cma: Reserved 16 MiB at 0xbf000000
    [    0.000000] setup_arch: 0
    [    0.000000] paging_init: 0[    0.000000] Memory policy: Data cache writeback
    [    0.000000] paging_init: 1
    [    0.000000] paging_init: 2paging_init: 3
    [    0.000000] paging_init: 4[    0.000000] devicemaps_init: 7
    [    0.000000] paging_init: 5
    [    0.000000] paging_init: 6paging_init: 7
    [    0.000000] paging_init: 8paging_init: 9
    [    0.000000] On node 0 totalpages: 262144
    [    0.000000] free_area_init_node: node 0, pgdat c099f800, node_mem_map eeef9000
    [    0.000000]   Normal zone: 1710 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 194560 pages, LIFO batch:31
    [    0.000000]   HighMem zone: 67584 pages, LIFO batch:15
    [    0.000000] paging_init: 10
    [    0.000000] paging_init: 11paging_init: 12
    [    0.000000] setup_arch: 1setup_arch: 2
    [    0.000000] setup_arch: 3setup_arch: 4
    [    0.000000] setup_arch: 5[    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM437x ES1.2 (sgx neon )
    [    0.000000] PERCPU: Embedded 13 pages/cpu @eeeb9000 s22976 r8192 d22080 u53248
    [    0.000000] pcpu-alloc: s22976 r8192 d22080 u53248 alloc=13*4096
    [    0.000000] pcpu-alloc: [0] 0
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260434
    [    0.000000] Kernel command line: console=ttyO1,115200n8 debug earlyprintk root=/dev/sda2 rw rootfstype=ext4 rootwait
    [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] mm_init:1
    [    0.000000] mm_init:2
    [    0.000000] Memory: 1003740K/1048576K available (6329K kernel code, 800K rwdata, 2320K rodata, 436K init, 8221K bss, 28452K reserved, 16384K cma-reserved, 253952K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc087ab14   (8651 kB)
    [    0.000000]       .init : 0xc087b000 - 0xc08e8000   ( 436 kB)
    [    0.000000]       .data : 0xc08e8000 - 0xc09b01f0   ( 801 kB)
    [    0.000000]        .bss : 0xc09b3000 - 0xc11ba448   (8222 kB)
    [    0.000000] mm_init:3
    [    0.000000] mm_init:4
    [    0.000000] mm_init:5
    [    0.000000] mm_init:6
    [    0.000000] mm_init:7
    [    0.000000] mm_init:8
    [    0.000000] Running RCU self tests
    [    0.000000] Hierarchical RCU implementation.
    [    0.000000]  RCU lockdep checking is enabled.
    [    0.000000]  Additional per-CPU info printed with stalls.
    [    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] L2C: platform modifies aux control register: 0x0e030000 -> 0x3e430000
    [    0.000000] L2C: DT/platform modifies aux control register: 0x0e030000 -> 0x3e430000
    [    0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [    0.000000] OMAP L2C310: ROM does not support power control setting
    [    0.000000] L2C-310 ID prefetch enabled, offset 1 lines
    [    0.000000] L2C-310 dynamic clock gating disabled, standby mode disabled
    [    0.000000] L2C-310 cache controller enabled, 16 ways, 256 kB
    [    0.000000] L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x7e430000
    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [    0.000013] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.008092] clocksource timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.017535] OMAP clocksource: timer1 at 24000000 Hz
    [    0.023603] Console: colour dummy device 80x30
    [    0.028240] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    [    0.036245] ... MAX_LOCKDEP_SUBCLASSES:  8
    [    0.040503] ... MAX_LOCK_DEPTH:          48
    [    0.044856] ... MAX_LOCKDEP_KEYS:        8191
    [    0.049382] ... CLASSHASH_SIZE:          4096
    [    0.053914] ... MAX_LOCKDEP_ENTRIES:     32768
    [    0.058527] ... MAX_LOCKDEP_CHAINS:      65536
    [    0.063138] ... CHAINHASH_SIZE:          32768
    [    0.067759]  memory used by lock dependency info: 5167 kB
    [    0.073355]  per task-struct memory footprint: 1152 bytes
    [    0.078961] Calibrating delay loop... 1987.37 BogoMIPS (lpj=9936896)
    [    0.136295] pid_max: default: 32768 minimum: 301
    [    0.141391] Security Framework initialized
    [    0.145824] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.152658] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.162702] Initializing cgroup subsys blkio
    [    0.167233] Initializing cgroup subsys memory
    [    0.171841] Initializing cgroup subsys devices
    [    0.176579] Initializing cgroup subsys freezer
    [    0.181313] Initializing cgroup subsys perf_event
    [    0.186270] CPU: Testing write buffer coherency: ok
    [    0.192680] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [    0.198704] Setting up static identity map for 0x80008340 - 0x800083b0
    [    0.211191] Brought up 1 CPUs
    [    0.214398] SMP: Total of 1 processors activated (1987.37 BogoMIPS).
    [    0.220958] CPU: All CPU(s) started in SVC mode.
    [    0.228975] devtmpfs: initialized
    [    0.258618] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [    0.312000] omap_hwmod: tptc0 using broken dt data from edma
    [    0.318314] omap_hwmod: tptc1 using broken dt data from edma
    [    0.324609] omap_hwmod: tptc2 using broken dt data from edma
    

  • Sorry, I jumped ahead of myself. On my board. I was seeing the following:

    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 3.12.10 (mattc@E2-06L) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #7 PREEMPT Thu Dec 10 08:35:36 EST 2015
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: Generic AM43 (Flattened Device Tree), model: RedLion AM437x CPU9
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] Unable to handle kernel paging request at virtual address fef2e000
    [    0.000000] pgd = c0004000
    [    0.000000] [fef2e000] *pgd=00000000
    [    0.000000] Internal error: Oops: 5 [#1] PREEMPT ARM
    [    0.000000] Modules linked in:
    [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.10 #7
    [    0.000000] task: c05752e8 ti: c056a000 task.ti: c056a000
    [    0.000000] PC is at __unflatten_device_tree+0x24/0x15c
    [    0.000000] LR is at unflatten_device_tree+0x30/0x3c
    [    0.000000] pc : [<c0303db8>]    lr : [<c0551dc8>]    psr: a00001d3
    [    0.000000] sp : c056bf20  ip : c056bf58  fp : c056bf54
    [    0.000000] r10: c0576218  r9 : c0599b90  r8 : c0576218
    [    0.000000] r7 : c0532fcc  r6 : c0de7080  r5 : c055df54  r4 : fef2e000
    [    0.000000] r3 : c05dda04  r2 : 0000feed  r1 : c05dd9f4  r0 : fef2e000
    [    0.000000] Flags: NzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
    [    0.000000] Control: 10c53c7d  Table: 80004059  DAC: 00000015
    [    0.000000] Process swapper (pid: 0, stack limit = 0xc056a238)
    [    0.000000] Stack: (0xc056bf20 to 0xc056c000)
    [    0.000000] bf20: c0599b90 c0576218 c056bf54 c05dd9f4 c056bf5c c0532fcc c055df54 c0de7080
    [    0.000000] bf40: 80000200 c0576218 c056bf6c c056bf58 c0551dc8 c0303da0 c05d6344 c055df54
    [    0.000000] bf60: c056bfb4 c056bf70 c05329f0 c0551da4 c01c2e20 10c53c7d c056bfa4 c055ee04
    [    0.000000] bf80: c052ff2c c04ba37c c04b8e7c 0000d440 c0572000 c056a000 00000001 80004059
    [    0.000000] bfa0: 412fc09a 00000000 c056bff4 c056bfb8 c053085c c0532384 00000000 00000000
    [    0.000000] bfc0: 00000000 00000000 00000000 c055ee04 10c53c7d c0572044 c055ee00 c0576320
    [    0.000000] bfe0: 80004059 412fc09a 00000000 c056bff8 80008070 c05307ac 00000000 00000000
    [    0.000000] Backtrace: 
    [    0.000000] [<c0303d94>] (__unflatten_device_tree+0x0/0x15c) from [<c0551dc8>] (unflatten_device_tree+0x30/0x3c)
    [    0.000000]  r8:c0576218 r7:80000200 r6:c0de7080 r5:c055df54 r4:c0532fcc
    [    0.000000] [<c0551d98>] (unflatten_device_tree+0x0/0x3c) from [<c05329f0>] (setup_arch+0x678/0x6e0)
    [    0.000000]  r5:c055df54 r4:c05d6344
    [    0.000000] [<c0532378>] (setup_arch+0x0/0x6e0) from [<c053085c>] (start_kernel+0xbc/0x2e8)
    [    0.000000] [<c05307a0>] (start_kernel+0x0/0x2e8) from [<80008070>] (0x80008070)
    [    0.000000]  r9:412fc09a r8:80004059 r7:c0576320 r6:c055ee00 r5:c0572044
    r4:10c53c7d
    [    0.000000] Code: e1a07002 e50b1028 0a00003c e30f2eed (e5943000) 
    [    0.000000] ---[ end trace da227214a82491b7 ]---
    [    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!

    This crash was happening when trying to access the the device tree in memory after a local_flush_tlb_all. This did not happen on the EVM, and I noticed that the fdt was being loaded to a different place by the EVM's U-Boot. That is controlled by the fdt_high environment variable. Using the value from the EVM fixes it. I expect that this is because there is some internal MMU restriction in accessing that memory.

    If your board has a small amount of memory (both the EVM and my board have 1G) then that is likely why you don't have this problem.

  • Something strange just happened for me.  I had a lot of pr_info() calls sprinkled around to try and find out where things were hanging up and with the success I had earlier, I thought I could remove them.  Now I only get this:

    Kernel image @ 0x82000000 [ 0x000000 - 0x35ce90 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff4000, end 8ffffc9b ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 4.1.6-g52c4aa7 (udsp@udsp-VirtualBox) (gcc version 4.9.3 20150413 (prerelease) (Linaro GCC 4.9-2015.05) ) #44 SMP Thu Dec 10 12:30:00 EST 2015
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine model: Generic AM43 (Flattened Device Tree)
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] cma: Reserved 16 MiB at 0xbf000000
    [    0.000000] Memory policy: Data cache writeback
    

    I believe this is where local_flush_tlb_all is called...

    The environment variable you are referring to "fdt_high", where exactly does it belong?  In the uenv.txt or is it compiled into your u-boot image?  I tried setting that manually "setenv fdt_high 0xa0000000" before doing "run usbboot" but I didn't get any joy...

    Completely ignore this post.  I overwrote my .config file with one that reverted back to the 8250 debug UART settings...  Doh!

  • I do have 1GB of DDR3 RAM... Wonder why I didn't see the same issue you did?
  • That's where it gets stuck on the EVM w/ the 8250 driver. Also on the EVM, if you use TI81XXUART1 (which should be the same port, based on the addresses), it doesn't print any messages. On my board, if I use TI81XXUART2, I get what I described above..

    Very strange.
  • I don't know why you didn't see what I did.

    Again, strange.
  • Maybe that's a difference between the different kernel versions? Have you tried using the latest SDK?
  • Perhaps it is a difference. No, I have not tried the latest SDK on my board.

    I have learned a couple of things. First, by debugging via JTAG dumps of the printk log buffer, I figured out that the reason I couldn't get the serial port to work after a time was because the pinmux stuff wasn't working because I had turned off the pinconfig-single driver in my new kernel configuration. OOops.

    Second, I note that ttyO1 may be correct, EXCEPT if you've added an alias to your DTS, as in:

    serial0 = &uart1;

    In that case, at least with my kernel, 

    console=ttyO0,115200

    gets me nice messages without earlyprintk.

  • Thinking on this more, it may have more to do with the fact that I leave UART0 disabled in the dts and therefore UART1 is the first enumerated one. The alias may or may not actually matter.
  • I tried playing around with a few of your suggestions but none of them had any positive effects on my setup (only negative effects like no messages at all).

    I seem to be stuck someplace in the device tree processing but having trouble finding exactly where.  I think it gets through omap_hwmod_setup_all() but not sure what comes after that in the call chain.  Tables of pointers to functions...

  • Do you get messages when you don't set earlyprintk in the U-Boot environment?
  • No. Nothing without earlyprintk. I tried adding "debug initcall_debug" to try and get more messages and I believe the initcall_debug parmeter causes all messages to stop even with earlyprintk.

    I just tried debug earlyprintk 'ddebug_query="+p"' and now I get an overload of messages. Need to find a happy medium...
  • Interestingly enough, when it finally stopped spitting out messages, here's where I ended up:

    [  141.712149] omap_hwmod: timer7: disabling clocks
    [  141.716954] omap_hwmod: tpcc: enabling
    [  141.720860] powerdomain: completed transition in 0 loops
    [  141.726379] clockdomain: l3_clkdm: enabled
    [  141.730635] omap_hwmod: tpcc: enabling clocks
    [  141.735172] omap_hwmod: tpcc: _omap4_enable_module: 2
    [  141.740407] omap_hwmod: tpcc: resetting
    [  141.744409] omap_hwmod: tpcc: idling
    [  141.748135] omap_hwmod: tpcc: _omap4_disable_module
    [  141.753191] omap_hwmod: tpcc: disabling clocks
    [  141.757819] omap_hwmod: uart2: enabling
    [  141.761813] powerdomain: completed transition in 0 loops
    [  141.767332] clockdomain: l4ls_clkdm: enabled
    [  141.771766] omap_hwmod: uart2: enabling clocks
    [  141.776390] clock: locking DPLL dpll_per_ck
    [  141.780738] omap_hwmod: uart2: _omap4_enable_module: 2
    [  141.786071] omap_hwmod: uart2: resetting
    [  141.790150] omap_hwmod: uart2: resetting via OCP SOFTRESET
    

    uart2.  Now I have uart2 disabled at the moment in the dts file so I wasn't sure why this was even being initialized.  When I looked closer at the dts include am4372.dtsi I found the following:

    		uart1: serial@48022000 {
    			compatible = "ti,am4372-uart","ti,omap2-uart";
    			reg = <0x48022000 0x2000>;
    			interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
    			ti,hwmods = "uart2";
    			status = "disabled";
    		};
    

    So...   uart1 is actually uart2 in the omap_hwmod setups...

    Going to try and disable all the uarts in my dts for now.

  • I gave up on earlyprintk because it would hang. I used JTAG to dump out the contents of the kernel log buffer memory and debugged from there. I realized that the issue was that I had disabled the pinmux-single driver and once I enabled that and set console=ttyO0,115200, everything just worked. I note that none of the above changed the earlyprintk behavior.

    I do not see any output like you're seeing. By the time my timestamps get to 4.xxx, it's starting to run init. I don't have any of the omap_hwmod messages like you see, but that may be down to kernel options.
  • Yes, I'm sure the kernel options are what's up'ing the timestamps. Without the extra debug options it will hang in about 0.5sec. With the load of messages enabled, that jumps to over 140secs. There's a LOT of messages coming out. Working on changing the dynamic debug options to reduce that if I can...
  • The opmap_hwmod for uart2 was killing the output for my earlyprintk messages. It is resetting the debug uart at that point and output would stop. I put in a special case to skip over _setup if the device name was uart2 and now it progresses beyond the point I was at before and now stops with at the message:

    bootconsole [earlycon0] disabled

    Perhaps it's not really dead but I suspect that my debug uart is disabled at this point...

    BTW, I sent you a LinkedIn connection request. I see you work at Red Lion Controls. Small world - I work at NDC Technologies (Beta LaserMike) a sister company of yours...
  • Hi Yordan,

    Haven't heard anything from you in a while. I have made progress getting earlyprintk to work (at least partly) but something is still not correctly setting the console uart to the linux kernel. Debug messages come out until, the kernel subsequently tries to re-initialize the uart and then console output stops but I think the kernel continues to boot. If I skip the kernel setup for uart1, I get more messages but now it eventually stops with the message " bootconsole [earlycon0] disabled". I added an alias to my device tree "serial1=&uart1" and now it stops earlier with the message:
    [ 0.989194] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [ 1.000916] omap_uart 48022000.serial: no wakeirq for uart1
    [ 1.006698] of_get_named_gpiod_flags: can't parse 'rts-gpio' property of node '/ocp/serial@48022000[0]'
    [ 1.016548] omap_uart 48022000.serial: No clock speed specified: using default: 48000000

    Any ideas?

    Thanks again.

    Tim
  • Hey Tim,

    Can you attach your current .dts? I wonder if you're not setting up the serial port correctly and the omap_hwmod goes off and tries to use the .dts and that's why it goes kaput.

    (It's just a thought, and likely a long shot, but I don't have any better ideas).

  • Hi Matthew,

    I did get the serial port working properly yesterday afternoon.  I was going to gather up everything I could think of to post a final solution here.  I am not exactly certain what actually made the difference in the end but I thought I could post a few key points that I think are significant.

    At this point I have all the debugging messages (earlyprintk etc) turned off.  I am now stuck trying to get it to boot off a USB stick.  It hangs with:

    [ 1.617195] Waiting for root device /dev/sda2...

    Not sure but it seems like I may not have the kernel setup to boot from a USB stick properly (maybe I don't have the proper usbroot device setting or lack of driver support/initialization).

    I think the keys to getting my serial port working included:

    1) creating an alias in the dts file for serial1

    serial1 = &uart1

    2) removing pinmux settings for uart1 from dts file (to me having the pinctrl setups should be OK but not necessary as these are setup in u-boot)

    &uart1 {

    // pinctrl-names = "default", "sleep";
    // pinctrl-0 = <&uart1_pins_default>;
    // pinctrl-1 = <&uart1_pins_sleep>;
    status = "okay";
    };

    3) disabling uart0 in dts file

    &uart0 {

    status = "disabled";
    };

    4) Adding console settings to my uenv.txt.  I checked numerous times to be sure the console environment variable was set properly in the u-boot environment.  Not sure, but maybe there is a corruption in the environment somehow.

    console=ttyO1,115200n8

    Thanks again for all your help.

    Tim