ARMADA 388 ClearFog: Enable Linux 4.4 for OpenWRT

OpenWRT trunk has support of Linux 4.1 for MVEBU platform. And it also maintains 4.4 as well. In order to use 4.4 in ClearFog board and PCIe bus, you should not only switch to 4.4 kernel but also enable i2c bus driver and gpio-pca9655 driver.

 [ 0.849089] i2c /dev entries driver [ 0.854577] GPIO line 496 (pcie1.0-clkreq) hogged as input [ 0.860688] GPIO line 499 (pcie1.0-w-disable) hogged as output/low [ 0.867199] GPIO line 500 (pcie2.0-clkreq) hogged as input [ 0.873317] GPIO line 503 (pcie2.0-w-disable) hogged as output/low [ 0.879812] GPIO line 501 (usb3-current-limit) hogged as input [ 0.886278] GPIO line 502 (usb3-power) hogged as output/high [ 0.892570] GPIO line 507 (m.2 devslp) hogged as output/low [ 0.898453] GPIO line 508 (sfp-los) hogged as input [ 0.903655] GPIO line 509 (sfp-tx-fault) hogged as input [ 0.909590] GPIO line 510 (sfp-tx-disable) hogged as output/low [ 0.915832] GPIO line 511 (sfp-mod-def0) hogged as input 

From the output of dmesg, we know that the i2c GPIO expander chip controls the enable of PCIe bus.

ARMADA 388 ClearFog: Add uboot-tools and fw_env.config

Clearfog Pro has a SD card slot which stores U-boot, device tree blob, Linux kernel and file system. We could modify the uboot paramenters directly from U-boot shell or from the userspace application called uboot-envtools. The uboot-envtools reads config file from /etc/fw_env.config which is not jet in OpenWRT system.

Therefore you need to install and config uboot-envtools:

 opkg install uboot-envtools vi /etc/fw_env.config 

and

 # Configuration file for fw_(printenv/saveenv) utility. # Up to two entries are valid, in this case the redundant # environment sector is assumed present. # Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash. # Futhermore, if the Flash sector size is ommitted, this value is assumed to # be the same as the Environment size, which is valid for NOR and SPI-dataflash # MMC device name Device offset Env. size Flash sector size Number of sectors /dev/mmcblk0 0xf0000 0x10000 0x1000 

And then enjoy it.

OpenOCD and ARMADA 388

Now I am playing a Clearfog Pro board and 802.11ac QCA9880 cards with OpenWRT trunk.

The ClearFog Pro board is the first open development kit SBC based on Marvell’s ARMADA 388 SoC. It includes 1GB RAM and a variety of I/O and connectivity technologies such as multiple mini-PCIe/mSATA sockets, audio/telephony module header, PoE expansion header and a not so popular interface called mikroBUS.

Since I have a OLIMEX ARM-USB-OCD-H adapter, I try to connect it with ClearFog Pro board.

In order to make openocd working for ClearFog Pro board, we need two config files for OLIMEX ARM-USB-OCD-H adapter and ARMADA 388.

Followings are configurations:

olimex-arm-usb-ocd.cfg

 # # Olimex ARM-USB-OCD-H # # http://www.olimex.com/dev/arm-usb-ocd-h.html # interface ftdi ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-OCD-H" ftdi_vid_pid 0x15ba 0x002b ftdi_layout_init 0x0908 0x0b1b ftdi_layout_signal nSRST -oe 0x0200 ftdi_layout_signal nTRST -data 0x0100 ftdi_layout_signal LED -data 0x0800 adapter_khz 40000 transport select jtag ftdi_tdo_sample_edge falling 

armada-388.cfg

 # # armada388 -- support for the Marvell Armada/388 CPU family # # Xue Liu <xue.liu@dks-koeln.de> if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME } else { set _CHIPNAME armada388 } if { [info exists CPUTAPID] } { set _CPUTAPID $CPUTAPID } else { set _CPUTAPID 0x4ba00477 } jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME cortex_a -chain-position $_CHIPNAME.dap proc armada388_dbginit {target} { cortex_a dbginit } $_TARGETNAME configure -event reset-assert-post "armada388_dbginit $_TARGETNAME" # We need to init now, so we can run the apsel command. init dap apsel 1 

or download from here