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.

SATA support with customized Linux kernel (3.3)

Other Parts Discussed in Thread: OMAPL138

Hi,

We have a custom board using the LogicPD OMAPL138 SOM that correctly identifies an attached SATA hard drive using the stock Davinci-PSP-SDK-03.22.00.03 using the da850_omapl138_defconfig and board-da850-evm.c board configurations. Once we modify the board configuration and kernel to match our actual hardware the hard drive is no long recognized and the SATA link stays down with a SStatus 0. The ATA, SCSI, and SATA portions of the kernel configuration are identical to the defconfig and it seems like the basic SATA, ATA, and SCSI subsystems come up correctly on our board. The bus link just never goes up and identifies the hard drive. Our custom board uses RMII instead of MII, has a couple more devices on the SPI0 bus, and we've chopped out a fair amount of the video/audio/expansion board support from the default board configuration but none of the changes seem related to the SATA interface.

Are there any dependencies for the board/platform bringup to get SATA working that would not be immediately obvious (Sata clock dependent on SPI, or McASP, MII, VPIF, etc.)? I've copied excerpts of the two kernels booting below (same physical hardware booted one uImage after the other with no filesystem or uboot changes).

Thanks in advance,

Scott

SATA Working with original EVM configuration and board configuration:

## Booting kernel from Legacy Image at c0700000 ...
   Image Name:   Linux-3.3.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2544528 Bytes = 2.4 MiB
   Load Address: c0008000
    Entry Point:  c0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Booting Linux on physical CPU 0
Linux version 3.3.0 (todd@Dev-laptop) (gcc version 4.5.2 (Sourcery CodeBench 2011.03-65) ) #2 PREEMPT Mon Nov 4 20:47:20 EST 2013
 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DA850/OMAP-L138/AM18x EVM
Memory policy: ECC disabled, Data cache writeback
BUG: mapping for 0x80000000 at 0xfffe0000 out of vmalloc space
 DaVinci da850/omap-l138/am18x variant 0x1
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 28416
Kernel command line: mem=48M@0xc0000000 mem=64M@0xc4000000 console=ttyS1,115200n8 rootfstype=ext3 rootwait ip=192.168.1.201 root=/dev/mmcblk0p2 rw
 PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 48MB 64MB = 112MB total
Memory: 108272k/108272k available, 6416k reserved, 0K highmem
 Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
     modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc04bb000   (4812 kB)
      .init : 0xc04bb000 - 0xc04e6000   ( 172 kB)
      .data : 0xc04e6000 - 0xc05221c0   ( 241 kB)
       .bss : 0xc05221e4 - 0xc053fcac   ( 119 kB)
 SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:245
Console: colour dummy device 80x30
Calibrating delay loop... 148.88 BogoMIPS (lpj=744448)
pid_max: default: 32768 minimum: 301
 Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc03928f8 - 0xc0392950
gpiochip_add: registered GPIOs 0 to 31 on device: DaVinci
gpiochip_add: registered GPIOs 32 to 63 on device: DaVinci
 gpiochip_add: registered GPIOs 64 to 95 on device: DaVinci
gpiochip_add: registered GPIOs 96 to 127 on device: DaVinci
gpiochip_add: registered GPIOs 128 to 143 on device: DaVinci
DaVinci: 144 gpio irqs
print_constraints: dummy:
 NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
 print_constraints: VDCDC1: 3200 <--> 3300 mV at 3300 mV
print_constraints: VDCDC2: 1750 <--> 3300 mV at 3300 mV
print_constraints: VDCDC3: 950 <--> 1350 mV at 1200 mV
print_constraints: LDO1: 1800 mV
 print_constraints: LDO2: 1150 <--> 1300 mV at 1200 mV
pca953x 1-0020: failed reading register
pca953x 1-0021: failed reading register
i2c-gpio i2c-gpio.1: using pins 20 (SDA) and 21 (SCL)
Advanced Linux Sound Architecture Driver Version 1.0.24.
 Switching to clocksource timer0_1
musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
musb-hdrc musb-hdrc: dma type: dma-cppi41
MUSB255 controller's USBSS revision = 4ea11003
Waiting for USB PHY clock good...
 musb-hdrc musb-hdrc: USB OTG mode controller at fee00000 using DMA, IRQ 58
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
 TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
 NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
 EMAC: MII PHY configured, RMII PHY will not be functional
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 211
io scheduler noop registered (default)
da8xx_lcdc da8xx_lcdc.0: GLCD: Found Sharp_LK043T1DG01 panel
 Console: switching to colour frame buffer device 60x34
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25) is a AR7
serial8250.0: ttyS1 at MMIO 0x1d0c000 (irq = 53) is a AR7
 console [ttyS1] enabled
serial8250.0: ttyS2 at MMIO 0x1d0d000 (irq = 61) is a AR7
brd: module loaded
ahci ahci: forcing PORTS_IMPL to 0x1 
ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode 
 ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc 
scsi0 : ahci_platform 
ata1: SATA max UDMA/133 mmio [mem 0x01e18000-0x01e19fff] port 0x100 irq 67 
spi_davinci spi_davinci.1: DMA: supported
spi_davinci spi_davinci.1: DMA: RX channel: 18, TX channel: 19, event queue: 0
 m25p80 spi1.0: unrecognized JEDEC id 7f7f7f
spi_davinci spi_davinci.1: Controller at 0xfef0e000
davinci_mdio davinci_mdio.0: davinci mdio revision 1.5
davinci_mdio davinci_mdio.0: detected phy mask ffffffef
davinci_mdio.0: probed
 davinci_mdio davinci_mdio.0: phy[4]: device davinci_mdio-0:04, driver SMSC LAN8710/LAN8720
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci ohci.0: DA8xx OHCI
ohci ohci.0: new USB bus registered, assigned bus number 1
 Waiting for USB PHY clock good...
ohci ohci.0: irq 59, io mem 0x01e25000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
 USB Mass Storage support registered.
input: TPS6507x Touchscreen as /devices/platform/i2c-gpio.1/i2c-1/1-0048/input/input0
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
omap_rtc: RTC power up reset detected
 omap_rtc: already running
i2c /dev entries driver
lirc_dev: IR Remote Control driver registered, major 253
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
 IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR RC5 (streamzap) protocol handler initialized
IR SANYO protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
 IR LIRC bridge handler initialized
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
watchdog watchdog: heartbeat 60 sec
cpuidle: using governor ladder
 cpuidle: using governor menu
davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usbcore: registered new interface driver snd-usb-audio
 soc-audio soc-audio.0: ASoC: Failed to create card debugfs directory
_regulator_get: 1-0018 supply IOVDD not found, using dummy regulator
_regulator_get: 1-0018 supply DVDD not found, using dummy regulator
_regulator_get: 1-0018 supply AVDD not found, using dummy regulator
 _regulator_get: 1-0018 supply DRVDD not found, using dummy regulator
asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok
ALSA device list:
  #0: DA850/OMAP-L138 EVM
TCP cubic registered
mmc0: new high speed SDHC card at address e624
 NET: Registered protocol family 17
mmcblk0: mmc0:e624 SU32G 29.7 GiB (ro)
 mmcblk0: p1 p2
regulator_init_complete: LDO2: incomplete constraints, leaving on
regulator_init_complete: LDO1: incomplete constraints, leaving on
 regulator_init_complete: VDCDC3: incomplete constraints, leaving on
regulator_init_complete: VDCDC2: incomplete constraints, leaving on
regulator_init_complete: VDCDC1: incomplete constraints, leaving on
console [netcon0] enabled
 netconsole: network logging started
davinci_emac davinci_emac.1: using random MAC addr: 7e:e8:73:6b:67:df
omap_rtc omap_rtc: setting system clock to 2000-01-01 09:11:43 UTC (946717903)
PHY davinci_mdio-0:00 not found
 net eth0: could not connect to phy davinci_mdio-0:00
IP-Config: Failed to open eth0
IP-Config: No network devices available.
ata1: link is slow to respond, please be patient (ready=0) 
ata1: softreset failed (device not ready) 
 ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300) 
ata1.00: ATA-7: ST940814AS, 3.ALC, max UDMA/133 
ata1.00: 78140160 sectors, multi 0: LBA48 NCQ (depth 31/32) 
ata1.00: configured for UDMA/133 
scsi 0:0:0:0: Direct-Access ATA ST940814AS 3.AL PQ: 0 ANSI: 5 
 sd 0:0:0:0: [sda] 78140160 512-byte logical blocks: (40.0 GB/37.2 GiB) 
sd 0:0:0:0: Attached scsi generic sg0 type 0 
sd 0:0:0:0: [sda] Write Protect is off 
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA 
 sda: sda1 sda2 
sd 0:0:0:0: [sda] Attached SCSI disk 
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)
Please append a correct "root=" boot option; here are the available partitions:
 b300        31166976 mmcblk0  driver: mmcblk
  b301        29050864 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
  b302         2115584 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2
0800        39070080 sda  driver: sd
   0801          102400 sda1 00000000-0000-0000-0000-000000000sda1
  0802        38965248 sda2 00000000-0000-0000-0000-000000000sda2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

[THIS IS AS FAR AS THE SYSTEM BOOTS due to the incompatibility of our actual custom board and the stock image]


## Booting kernel from Legacy Image at c0700000 ...
   Image Name:   Linux-3.3.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2935856 Bytes = 2.8 MiB
   Load Address: c0008000
    Entry Point:  c0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Booting Linux on physical CPU 0
Linux version 3.3.0 (todd@Dev-laptop) (gcc version 4.5.2 (Sourcery CodeBench 2011.03-65) ) #1 PREEMPT Mon Nov 4 23:38:34 EST 2013
 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DA850/OMAP-L138/AM18x EVM
Memory policy: ECC disabled, Data cache writeback
BUG: mapping for 0x80000000 at 0xfffe0000 out of vmalloc space
 DaVinci da850/omap-l138/am18x variant 0x1
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 28416
Kernel command line: mem=48M@0xc0000000 mem=64M@0xc4000000 console=ttyS1,115200n8 rootfstype=ext3 rootwait ip=192.168.1.201 root=/dev/mmcblk0p2 rw
 PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 48MB 64MB = 112MB total
Memory: 107380k/107380k available, 7308k reserved, 0K highmem
 Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
     modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc0587000   (5628 kB)
      .init : 0xc0587000 - 0xc05b5000   ( 184 kB)
      .data : 0xc05b6000 - 0xc05fe750   ( 290 kB)
       .bss : 0xc05fe774 - 0xc061edc8   ( 130 kB)
 SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:245
Console: colour dummy device 80x30
Calibrating delay loop... 148.88 BogoMIPS (lpj=744448)
pid_max: default: 32768 minimum: 301
 Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc0415a08 - 0xc0415a60
gpiochip_add: registered GPIOs 0 to 31 on device: DaVinci
gpiochip_add: registered GPIOs 32 to 63 on device: DaVinci
 gpiochip_add: registered GPIOs 64 to 95 on device: DaVinci
gpiochip_add: registered GPIOs 96 to 127 on device: DaVinci
gpiochip_add: registered GPIOs 128 to 143 on device: DaVinci
DaVinci: 144 gpio irqs
print_constraints: dummy:
 NET: Registered protocol family 16
da850_evm_init: Force RMII Init if selected in .config
da850_evm_init: RMII_EN: 1
 GPIO6[6] IRQ= 203
 GPIO6[8] IRQ= 205
 GPIO6[9] IRQ= 206
 GPIO2[9] ADXL345 IRQ= 142
  GPIO7[8] IRQ= 221
 GPIO7[9] IRQ= 222
 GPIO7[10] IRQ= 223
 GPIO7[12] IRQ= 225
 GPIO7[13] IRQ= 226
da850_evm_init: gpio6[0] GPIO line setup failed: -16
da850_evm_init: SPI0 pins setup passed.
 da8xx_register_spi_both_busses:post spi_register_board, len: 3
   1.0:0
  0.2:0
  0.3:0
  32512.0:0
da850_evm_init: spi busses0-1 registration passed.
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
 usbcore: registered new interface driver hub
usbcore: registered new device driver usb
print_constraints: VDCDC1: 3200 <--> 3300 mV at 3300 mV
print_constraints: VDCDC2: 1750 <--> 3300 mV at 3300 mV
 print_constraints: VDCDC3: 950 <--> 1350 mV at 1200 mV
print_constraints: LDO1: 1800 mV
print_constraints: LDO2: 1150 <--> 1300 mV at 1200 mV
i2c-gpio i2c-gpio.1: using pins 20 (SDA) and 21 (SCL)
Advanced Linux Sound Architecture Driver Version 1.0.24.
 Switching to clocksource timer0_1
musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
musb-hdrc musb-hdrc: dma type: dma-cppi41
MUSB255 controller's USBSS revision = 4ea11003
Waiting for USB PHY clock good...
 musb-hdrc musb-hdrc: USB OTG mode controller at fee00000 using DMA, IRQ 58
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
 TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
 NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
 EMAC: RMII PHY configured, MII PHY will not be functional
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 209
io scheduler noop registered (default)
da8xx_lcdc da8xx_lcdc.0: GLCD: Found Sharp_LK043T1DG01 panel
 Console: switching to colour frame buffer device 60x34
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25) is a AR7
serial8250.0: ttyS1 at MMIO 0x1d0c000 (irq = 53) is a AR7
 console [ttyS1] enabled
serial8250.0: ttyS2 at MMIO 0x1d0d000 (irq = 61) is a AR7
brd: module loaded
at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
ahci ahci: forcing PORTS_IMPL to 0x1 
ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode 
 ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc 
scsi0 : ahci_platform 
ata1: SATA max UDMA/133 mmio [mem 0x01e18000-0x01e19fff] port 0x100 irq 67 
spi_davinci spi_davinci.0: DMA: supported
spi_davinci spi_davinci.0: DMA: RX channel: 14, TX channel: 15, event queue: 0
 gpiochip_add: registered GPIOs 180 to 187 on device: eser
sc16is7x2 spi0.2: sc16is7x2 at CS2 (irq 152), 2 UARTs, 8 GPIOs
    eser0, eser1, gpiochip180
gpiochip_add: registered GPIOs 188 to 195 on device: eser
sc16is7x2 spi0.3: sc16is7x2 at CS3 (irq 151), 2 UARTs, 8 GPIOs
     eser2, eser3, gpiochip188
spi_davinci spi_davinci.0: Controller at 0xfec41000
spi_davinci spi_davinci.1: DMA: supported
spi_davinci spi_davinci.1: DMA: RX channel: 18, TX channel: 19, event queue: 0
m25p80 spi1.0: unrecognized JEDEC id 7f7f7f
 spi_davinci spi_davinci.1: Controller at 0xfef0e000
davinci_mdio davinci_mdio.0: davinci mdio revision 1.5
davinci_mdio davinci_mdio.0: detected phy mask ffffffee
davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[0]: device davinci_mdio-0:00, driver unknown
 davinci_mdio davinci_mdio.0: phy[4]: device davinci_mdio-0:04, driver SMSC LAN8710/LAN8720
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci ohci.0: DA8xx OHCI
ohci ohci.0: new USB bus registered, assigned bus number 1
 Waiting for USB PHY clock good...
ohci ohci.0: irq 59, io mem 0x01e25000
ata1: SATA link down (SStatus 0 SControl 300) 
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
 usb usb1: Product: DA8xx OHCI
usb usb1: Manufacturer: Linux 3.3.0 ohci_hcd
usb usb1: SerialNumber: ohci.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver cdc_acm
 cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver libusual
 usbcore: registered new interface driver microtekX6
input: TPS6507x Touchscreen as /devices/platform/i2c-gpio.1/i2c-1/1-0048/input/input0
rtc-ds1307 1-0068: rtc core: registered ds3231 as rtc0
i2c /dev entries driver
 lirc_dev: IR Remote Control driver registered, major 252
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
 IR RC5 (streamzap) protocol handler initialized
IR SANYO protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR LIRC bridge handler initialized
Linux video capture interface: v2.00
 usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
watchdog watchdog: heartbeat 60 sec
cpuidle: using governor ladder
cpuidle: using governor menu
davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
 davinci_mmc davinci_mmc.1: Using DMA, 4-bit mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usbcore: registered new interface driver snd-usb-audio
soc-audio soc-audio.0: ASoC: Failed to create card debugfs directory
 ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
VFP support v0.3: not present
regulator_init_complete: LDO2: incomplete constraints, leaving on
 regulator_init_complete: LDO1: incomplete constraints, leaving on
regulator_init_complete: VDCDC3: incomplete constraints, leaving on
regulator_init_complete: VDCDC2: incomplete constraints, leaving on
regulator_init_complete: VDCDC1: incomplete constraints, leaving on
 console [netcon0] enabled
netconsole: network logging started
davinci_emac davinci_emac.1: using random MAC addr: c2:d4:08:88:d7:22
mmc0: new high speed SDHC card at address e624
rtc-ds1307 1-0068: setting system clock to 2013-11-02 20:43:53 UTC (1383425033)
 mmcblk0: mmc0:e624 SU32G 29.7 GiB
 mmcblk0: p1 p2
davinci_mdio davinci_mdio.0: resetting idled controller
net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:00, id=20005ce1)
mmc1: card claims to support voltages below the defined range. These will be ignored.
 mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
mmc1: new SDIO card at address 0001
PHY: davinci_mdio-0:00 - Link is Up - 100/Full
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
 EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
Freeing init memory: 184K

  • As a follow up, the SATA link will not come up if the RMII interface is set for the EMAC (particularly the following assingment):

    soc_info->emac_pdata->rmii_en = 1;

    Running the defconfig from the EVM and modifying it line by line the SATA link stopped working with CONFIG_UI_RMII getting set.  I rolled that change back and manually enabled each portion of the board-da850-evm.c code that would have been enables by the configuration option.  Ethernet on our board started working with that assignment (and the raw reads/writes to cfg_chip3_base), but SATA stopped working.

    Is there any known reason why setting soc_info->emac_pdata->rmii_en = 1 would cause SATA to stop functioning?

  • As I continue to debug I've enabled the debug statements in the ATA and AHCI portions of the kernel drivers.  I'm now using the same .config and code with one #define difference in the board initialization code and can reliably cause SATA to work if the RMII phy is not enabled, and SATA to not work if the RMII phy is enabled.  It looks like the AHCI port is reporting differences in link detection depending on whether or not RMII is enabled, see excerpts from dmesg below.

    The particular part I'm looking at is the ahci_port_init: PORT_SCR_ERR which on the working board indicates COMINT signal was received, CommWake, PhyRdy changed state, and Communicaitons recovered.

    For the non-working configuration it indicates nothing from the PHY.

     

    SATA works, rmii_en is not set in board initialization:

     

    da850_sata_init: val raw written: 80183048 o address: fee18178
    ahci ahci: forcing PORTS_IMPL to 0x1
    ata_host_alloc: ENTER
    ata_port_alloc: ENTER
    ahci_port_init:  port_mmio 0xfee18100
    ahci_port_init: PORT_SCR_ERR 0x4050002
    ahci_port_init: PORT_IRQ_STAT 0x0
    ahci_init_controller: HOST_CTL 0x80000000
    ahci_init_controller: HOST_CTL 0x80000002
    ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
    ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc
    __ata_port_freeze: ata4294967295 port frozen
    scsi0 : ahci_platform
    ata1: SATA max UDMA/133 mmio [mem 0x01e18000-0x01e19fff] port 0x100 irq 67


    SATA does not work, rmii_en=1 in board initialization:

    da850_sata_init: val raw written: 80183048 o address: fee18178
    ahci ahci: forcing PORTS_IMPL to 0x1
    ata_host_alloc: ENTER
    ata_port_alloc: ENTER
    ahci_port_init:  port_mmio 0xfee18100
    ahci_port_init: PORT_SCR_ERR 0x0
    ahci_port_init: PORT_IRQ_STAT 0x0
    ahci_init_controller: HOST_CTL 0x80000000
    ahci_init_controller: HOST_CTL 0x80000002
    ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
    ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc
    __ata_port_freeze: ata4294967295 port frozen
    scsi0 : ahci_platform
    ata1: SATA max UDMA/133 mmio [mem 0x01e18000-0x01e19fff] port 0x100 irq 67

  • I've added some additional prints into the AHCI initialization routines to see if any basic settings are different with rmii_en=1.  The host controller registers seem to be getting set identically, but the port register values are certainly different during the ahci_port_init call.

    SATA works, RMII is not enabled:

    root@arago:~# dmesg | grep -i 'scsi\|ahci\|ata'
    CPU: VIVT data cache, VIVT instruction cache
    Memory policy: ECC disabled, Data cache writeback
          .data : 0xc04f4000 - 0xc052ed00   ( 236 kB)
    SCSI subsystem initialized
    libata version 3.00 loaded.
    musb-hdrc: ConfigData=0x06 (UTMI-8, dyn FIFOs, SoftConn)
    ahci_probe: Made it to AHCI probe...
    da850_sata_init: val raw written: 80183048 o address: fee18178
    ahci ahci: forcing PORTS_IMPL to 0x1
    ata_host_alloc: ENTER
    ata_port_alloc: ENTER
    ahci_probe:  HOST_CAP:         0x1e18000
    ahci_probe:  HOST_CTL:         0xe
    ahci_probe:  HOST_IRQ_STAT:    0x13
    ahci_probe:  HOST_PORTS_IMPL:  0x1001c
    ahci_probe:  HOST_VERSION:     0x10
    ahci_probe:  HOST_EM_LOC:      0xa
    ahci_probe:  HOST_EM_CTL:      0x1e24000
    ahci_probe:  HOST_CAP2:        0x23
    ahci_port_init:  PORT_LST_ADDR:    0x0
    ahci_port_init:  PORT_LST_ADDR_HI: 0x0
    ahci_port_init:  PORT_FIS_ADDR:    0x0
    ahci_port_init:  PORT_FIX_ADDR_HI: 0x0
    ahci_port_init:  PORT_IRQ_STAT:    0x400040
    ahci_port_init:  PORT_IRQ_MASK:    0x0
    ahci_port_init:  PORT_CMD:         0x6
    ahci_port_init:  PORT_TFDATA:      0x80
    ahci_port_init:  PORT_SIG:         0x101
    ahci_port_init:  PORT_CMD_ISSUE:   0x0
    ahci_port_init:  PORT_SCR_STAT:    0x113
    ahci_port_init:  PORT_SCR_CTL:     0x0
    ahci_port_init:  PORT_SCR_ERR:     0x4050002
    ahci_port_init:  PORT_SCR_ACT:     0x0
    ahci_port_init:  PORT_SCR_NTF:     0x0
    ahci_port_init:  PORT_FBS:         0x0
    ahci_port_init: PORT_SCR_ERR 0x4050002
    ahci_port_init: PORT_IRQ_STAT 0x0
    ahci_init_controller: HOST_CTL 0x80000000
    ahci_init_controller: HOST_CTL 0x80000002
    ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
    ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc
    __ata_port_freeze: ata4294967295 port frozen
    scsi0 : ahci_platform
    ata1: SATA max UDMA/133 mmio [mem 0x01e18000-0x01e19fff] port 0x100 irq 67
    ata_port_schedule_eh: port EH scheduled
    ata_scsi_error: ENTER
    ata_eh_link_autopsy: ENTER
    ata_eh_recover: ENTER
    __ata_port_freeze: ata1 port frozen
    ahci_hardreset: ENTER
    sata_link_hardreset: ENTER
    sata_link_hardreset: EXIT, rc=-11
    ata_dev_classify: found ATA device by sig
    ahci_hardreset: EXIT, rc=-11, class=1
    ahci_softreset: ENTER
    ahci_do_softreset: ENTER
    ata1: link is slow to respond, please be patient (ready=0)

    SATA does not work, RMII is enabled:

    root@arago:~# dmesg | grep -i 'scsi\|ahci\|ata'
    CPU: VIVT data cache, VIVT instruction cache
    Memory policy: ECC disabled, Data cache writeback
          .data : 0xc04f4000 - 0xc052ed00   ( 236 kB)
    SCSI subsystem initialized
    libata version 3.00 loaded.
    musb-hdrc: ConfigData=0x06 (UTMI-8, dyn FIFOs, SoftConn)
    ahci_probe: Made it to AHCI probe...
    da850_sata_init: val raw written: 80183048 o address: fee18178
    ahci ahci: forcing PORTS_IMPL to 0x1
    ata_host_alloc: ENTER
    ata_port_alloc: ENTER
    ahci_probe:  HOST_CAP:         0x1e18000
    ahci_probe:  HOST_CTL:         0xe
    ahci_probe:  HOST_IRQ_STAT:    0x13
    ahci_probe:  HOST_PORTS_IMPL:  0x1001c
    ahci_probe:  HOST_VERSION:     0x10
    ahci_probe:  HOST_EM_LOC:      0xa
    ahci_probe:  HOST_EM_CTL:      0x1e24000
    ahci_probe:  HOST_CAP2:        0x23
    ahci_port_init:  PORT_LST_ADDR:    0x0
    ahci_port_init:  PORT_LST_ADDR_HI: 0x0
    ahci_port_init:  PORT_FIS_ADDR:    0x0
    ahci_port_init:  PORT_FIX_ADDR_HI: 0x0
    ahci_port_init:  PORT_IRQ_STAT:    0x0
    ahci_port_init:  PORT_IRQ_MASK:    0x0
    ahci_port_init:  PORT_CMD:         0x6
    ahci_port_init:  PORT_TFDATA:      0x7f
    ahci_port_init:  PORT_SIG:         0xffffffff
    ahci_port_init:  PORT_CMD_ISSUE:   0x0
    ahci_port_init:  PORT_SCR_STAT:    0x0
    ahci_port_init:  PORT_SCR_CTL:     0x0
    ahci_port_init:  PORT_SCR_ERR:     0x0
    ahci_port_init:  PORT_SCR_ACT:     0x0
    ahci_port_init:  PORT_SCR_NTF:     0x0
    ahci_port_init:  PORT_FBS:         0x0
    ahci_port_init: PORT_SCR_ERR 0x0
    ahci_port_init: PORT_IRQ_STAT 0x0
    ahci_init_controller: HOST_CTL 0x80000000
    ahci_init_controller: HOST_CTL 0x80000002
    ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
    ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc
    __ata_port_freeze: ata4294967295 port frozen
    scsi0 : ahci_platform
    ata1: SATA max UDMA/133 mmio [mem 0x01e18000-0x01e19fff] port 0x100 irq 67
    ata_port_schedule_eh: port EH scheduled
    ata_scsi_error: ENTER
    ata_eh_link_autopsy: ENTER
    ata_eh_recover: ENTER
    __ata_port_freeze: ata1 port frozen
    ahci_hardreset: ENTER
    sata_link_hardreset: ENTER
    sata_link_hardreset: EXIT, rc=0
    ahci_hardreset: EXIT, rc=0, class=0
    ata_eh_thaw_port: ata1 port thawed
    ata_std_postreset: ENTER
    ata1: SATA link down (SStatus 0 SControl 300)
    ata_std_postreset: EXIT
    ata_eh_revalidate_and_attach: ENTER
    ata_eh_recover: EXIT, rc=0
    ata_scsi_error: EXIT
    EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode

     

     

     

  • So, the original pre-production SOMs from LogicPD had a selectable enable for the MDIO_CLK running to the on-SOM PHY.  This line also runs to a MOSFET that can pull the CE pin of the SATA clock generator low disabling the SATA clock.  In production versions of the SOM the buffer for the MDIO_CLK line has been replaced by a jumper, so the kernel does not need to do any soft-configuring of the buffer using GP2[6].  Sadly, the code for the pre-production SOMs has stayed in the mainline kernel board-da850-evm.c file, this is the line that kicks off the adventure:

    #define DA850_MII_MDIO_CLKEN_PIN                GPIO_2_PIN(2, 6)

    Then in the da850_evm_config_emac function there are a couple of gpio setup lines that are no longer needed (or wanted), where the MUX is configured by conventional gpio mux name, but the direction control is handled using that previously defined macro to get the gpio pin.

    After the gpio config in da850_evm_config_emac there is this gem:
    gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN,rmii_en);

    Which sets the value of the output based on rmii_en.  This is totally unnecessary on production hardware, and in fact will disable SATA when RMII mode is selected so I recommend we excise the following lines from da850_evm_config_emac:

    1054         ret = davinci_cfg_reg(DA850_GPIO2_6);
    1055         if (ret)
    1056                 pr_warning("da850_evm_init:GPIO(2,6) mux setup "
    1057                                                         "failed\n");
    1058
    1059         ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
    1060         if (ret) {
    1061                 pr_warning("Cannot open GPIO %d\n",
    1062                                         DA850_MII_MDIO_CLKEN_PIN);
    1063                 return ret;
    1064         }
    1065
    1066         /* Enable/Disable MII MDIO clock */
    1067         gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);

    We can also get rid of the #define:

    57 #define DA850_MII_MDIO_CLKEN_PIN        GPIO_TO_PIN(2, 6)