Mainline U-Boot and Kernel -> SPI/Network Not Working

Started by MarkusP, August 18, 2016, 01:51:08 PM

Previous topic - Next topic

MarkusP

Hi,

I'm trying to port my company's existing hardware device based on an A13-OLinuXino-WIFI from using the linux-sunxi software stack to using mainline U-Boot and kernel.

I created an image for testing using the following commands:

truncate -s4G test.img
dev=$(losetup --show -f "$IMG")
fdisk "${dev}"
=> 64MB Boot
=> 2G root
=> for the rest var
partprobe "${dev}"

in the U-Boot sources (checked out 2016.07)
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
dd if=u-boot-sunxi-with-spl.bin of="${dev}" bs=1k seek=8

mkfs.ext4 "${dev}"p1
mkfs.ext4 "${dev}"p2
mkfs.ext4 "${dev}"p3

mount "${dev}"p2 /mnt/chroot
mkdir -pv /mnt/chroot/var
mount "${dev}"p3 /mnt/chroot/var
qemu-debootstrap --arch=armhf --variant=minbase jessie /mnt/chroot http://ftp.de.debian.org/debian
umount -Rv /mnt/chroot

in the kernel sources (checked out 4.7.1)
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs
cp -v arch/arm/boot/zImage /mnt/chroot/
cp -v arch/arm/boot/dts/sun5i-a13-olinuxino.dtb /mnt/chroot/
umount /mnt/chroot
losetup -D

dd if=test.img of=/dev/sdc bs=256K

ext4load mmc 0:1 0x46000000 zImage
ext4load mmc 0:1 0x49000000 sun5i-a13-olinuxino.dtb
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 rootfstype=ext4
bootz 0x46000000 - 0x49000000


For U-Boot I changed the following settings compared to the standard configuration:

217c217
< CONFIG_VIDEO_LCD_MODE=""
---
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0"
221c221
< CONFIG_VIDEO_LCD_BL_EN=""
---
> CONFIG_VIDEO_LCD_BL_EN="AXP0-1"


For the mainline kernel I did the following adjustments (only listening hardware specific ones):

741c874,896
< # CONFIG_WIRELESS is not set
---
> CONFIG_WIRELESS=y
> CONFIG_WEXT_CORE=y
> CONFIG_WEXT_PROC=y
> CONFIG_CFG80211=y
> # CONFIG_NL80211_TESTMODE is not set
> # CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
> CONFIG_CFG80211_DEFAULT_PS=y
> # CONFIG_CFG80211_INTERNAL_REGDB is not set
> CONFIG_CFG80211_CRDA_SUPPORT=y
> CONFIG_CFG80211_WEXT=y
> # CONFIG_LIB80211 is not set
> CONFIG_MAC80211=y
> CONFIG_MAC80211_HAS_RC=y
> CONFIG_MAC80211_RC_MINSTREL=y
> CONFIG_MAC80211_RC_MINSTREL_HT=y
> # CONFIG_MAC80211_RC_MINSTREL_VHT is not set
> CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
> CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
> # CONFIG_MAC80211_MESH is not set
> # CONFIG_MAC80211_LEDS is not set
> # CONFIG_MAC80211_MESSAGE_TRACING is not set
> # CONFIG_MAC80211_DEBUG_MENU is not set
> CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
780c935,936
< # CONFIG_DMA_SHARED_BUFFER is not set
---
> CONFIG_DMA_SHARED_BUFFER=y
> # CONFIG_FENCE_TRACE is not set
791c947,948
< # CONFIG_CONNECTOR is not set
---
> CONFIG_CONNECTOR=y
> CONFIG_PROC_EVENTS=y
1026c1183,1186
< # CONFIG_NET_VENDOR_MICROCHIP is not set
---
> CONFIG_NET_VENDOR_MICROCHIP=y
> CONFIG_ENC28J60=y
> # CONFIG_ENC28J60_WRITEVERIFY is not set
> # CONFIG_ENCX24J600 is not set
1096c1256,1286
< # CONFIG_USB_USBNET is not set
---
> CONFIG_USB_USBNET=y
> CONFIG_USB_NET_AX8817X=y
> CONFIG_USB_NET_AX88179_178A=y
> CONFIG_USB_NET_CDCETHER=y
> # CONFIG_USB_NET_CDC_EEM is not set
> CONFIG_USB_NET_CDC_NCM=y
> # CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
> # CONFIG_USB_NET_CDC_MBIM is not set
> # CONFIG_USB_NET_DM9601 is not set
> # CONFIG_USB_NET_SR9700 is not set
> # CONFIG_USB_NET_SR9800 is not set
> # CONFIG_USB_NET_SMSC75XX is not set
> # CONFIG_USB_NET_SMSC95XX is not set
> # CONFIG_USB_NET_GL620A is not set
> CONFIG_USB_NET_NET1080=y
> # CONFIG_USB_NET_PLUSB is not set
> # CONFIG_USB_NET_MCS7830 is not set
> # CONFIG_USB_NET_RNDIS_HOST is not set
> CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
> CONFIG_USB_NET_CDC_SUBSET=y
> # CONFIG_USB_ALI_M5632 is not set
> # CONFIG_USB_AN2720 is not set
> CONFIG_USB_BELKIN=y
> CONFIG_USB_ARMLINUX=y
> # CONFIG_USB_EPSON2888 is not set
> # CONFIG_USB_KC2190 is not set
> CONFIG_USB_NET_ZAURUS=y
> # CONFIG_USB_NET_CX82310_ETH is not set
> # CONFIG_USB_NET_KALMIA is not set
> # CONFIG_USB_NET_QMI_WWAN is not set
> # CONFIG_USB_NET_INT51X1 is not set
1098c1288,1344
< # CONFIG_WLAN is not set
---
> # CONFIG_USB_SIERRA_NET is not set
> # CONFIG_USB_VL600 is not set
> # CONFIG_USB_NET_CH9200 is not set
> CONFIG_WLAN=y
> CONFIG_WLAN_VENDOR_ADMTEK=y
> CONFIG_WLAN_VENDOR_ATH=y
> # CONFIG_ATH_DEBUG is not set
> # CONFIG_ATH9K is not set
> # CONFIG_ATH9K_HTC is not set
> # CONFIG_CARL9170 is not set
> # CONFIG_ATH6KL is not set
> # CONFIG_AR5523 is not set
> # CONFIG_ATH10K is not set
> # CONFIG_WCN36XX is not set
> CONFIG_WLAN_VENDOR_ATMEL=y
> # CONFIG_AT76C50X_USB is not set
> CONFIG_WLAN_VENDOR_BROADCOM=y
> # CONFIG_B43 is not set
> # CONFIG_B43LEGACY is not set
> # CONFIG_BRCMSMAC is not set
> # CONFIG_BRCMFMAC is not set
> CONFIG_WLAN_VENDOR_CISCO=y
> CONFIG_WLAN_VENDOR_INTEL=y
> CONFIG_WLAN_VENDOR_INTERSIL=y
> # CONFIG_HOSTAP is not set
> # CONFIG_P54_COMMON is not set
> CONFIG_WLAN_VENDOR_MARVELL=y
> # CONFIG_LIBERTAS is not set
> # CONFIG_LIBERTAS_THINFIRM is not set
> # CONFIG_MWIFIEX is not set
> CONFIG_WLAN_VENDOR_MEDIATEK=y
> # CONFIG_MT7601U is not set
> CONFIG_WLAN_VENDOR_RALINK=y
> # CONFIG_RT2X00 is not set
> CONFIG_WLAN_VENDOR_REALTEK=y
> # CONFIG_RTL8187 is not set
> CONFIG_RTL_CARDS=y
> CONFIG_RTL8192CU=y
> CONFIG_RTLWIFI=y
> CONFIG_RTLWIFI_USB=y
> # CONFIG_RTLWIFI_DEBUG is not set
> CONFIG_RTL8192C_COMMON=y
> # CONFIG_RTL8XXXU is not set
> CONFIG_WLAN_VENDOR_RSI=y
> # CONFIG_RSI_91X is not set
> CONFIG_WLAN_VENDOR_ST=y
> # CONFIG_CW1200 is not set
> CONFIG_WLAN_VENDOR_TI=y
> # CONFIG_WL1251 is not set
> # CONFIG_WL12XX is not set
> # CONFIG_WL18XX is not set
> # CONFIG_WLCORE is not set
> CONFIG_WLAN_VENDOR_ZYDAS=y
> # CONFIG_USB_ZD1201 is not set
> # CONFIG_ZD1211RW is not set
> # CONFIG_MAC80211_HWSIM is not set
> # CONFIG_USB_NET_RNDIS_WLAN is not set
1330a1577
> CONFIG_I2C_ALGOBIT=y
1405a1653
> # CONFIG_NTP_PPS is not set
1906,1907c2154,2155
< CONFIG_DVB_TUNER_DIB0070=m
< CONFIG_DVB_TUNER_DIB0090=m
---
> CONFIG_DVB_TUNER_DIB0070=y
> CONFIG_DVB_TUNER_DIB0090=y
1918c2166,2182
< # CONFIG_DRM is not set
---
> CONFIG_DRM=y
> # CONFIG_DRM_DP_AUX_CHARDEV is not set
> CONFIG_DRM_KMS_HELPER=y
> CONFIG_DRM_KMS_FB_HELPER=y
> CONFIG_DRM_FBDEV_EMULATION=y
> # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
> CONFIG_DRM_GEM_CMA_HELPER=y
> CONFIG_DRM_KMS_CMA_HELPER=y
>
> #
> # I2C encoder or helper chips
> #
> # CONFIG_DRM_I2C_ADV7511 is not set
> # CONFIG_DRM_I2C_CH7006 is not set
> # CONFIG_DRM_I2C_SIL164 is not set
> # CONFIG_DRM_I2C_NXP_TDA998X is not set
> # CONFIG_DRM_HDLCD is not set
1922a2187,2212
> # CONFIG_DRM_VGEM is not set
> # CONFIG_DRM_EXYNOS is not set
> # CONFIG_DRM_UDL is not set
> # CONFIG_DRM_ARMADA is not set
> CONFIG_DRM_SUN4I=y
> # CONFIG_DRM_OMAP is not set
> # CONFIG_DRM_TILCDC is not set
> # CONFIG_DRM_FSL_DCU is not set
> CONFIG_DRM_PANEL=y
>
> #
> # Display Panels
> #
> # CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set
> # CONFIG_DRM_PANEL_LG_LG4573 is not set
> # CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set
> CONFIG_DRM_BRIDGE=y
>
> #
> # Display Interface Bridges
> #
> # CONFIG_DRM_ANALOGIX_ANX78XX is not set
> # CONFIG_DRM_NXP_PTN3460 is not set
> # CONFIG_DRM_PARADE_PS8622 is not set
> # CONFIG_DRM_STI is not set
> # CONFIG_DRM_ARCPGU is not set
1937,1939c2227,2229
< # CONFIG_FB_SYS_FILLRECT is not set
< # CONFIG_FB_SYS_COPYAREA is not set
< # CONFIG_FB_SYS_IMAGEBLIT is not set
---
> CONFIG_FB_SYS_FILLRECT=y
> CONFIG_FB_SYS_COPYAREA=y
> CONFIG_FB_SYS_IMAGEBLIT=y
1941c2231,2232
< # CONFIG_FB_SYS_FOPS is not set
---
> CONFIG_FB_SYS_FOPS=y
> CONFIG_FB_DEFERRED_IO=y
1950a2242
> # CONFIG_FB_UVESA is not set
1963a2256,2257
> CONFIG_VIDEOMODE_HELPERS=y
> CONFIG_HDMI=y
2163c2457
< # CONFIG_HID_KYE is not set
---
> CONFIG_HID_KYE=y
2181c2475
< # CONFIG_HID_MULTITOUCH is not set
---
> CONFIG_HID_MULTITOUCH=y
2246c2540
< # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
---
> CONFIG_USB_EHCI_ROOT_HUB_TT=y
2275c2569,2584
< # CONFIG_USB_STORAGE is not set
---
> CONFIG_USB_STORAGE=y
> # CONFIG_USB_STORAGE_DEBUG is not set
> # CONFIG_USB_STORAGE_REALTEK is not set
> # CONFIG_USB_STORAGE_DATAFAB is not set
> # CONFIG_USB_STORAGE_FREECOM is not set
> # CONFIG_USB_STORAGE_ISD200 is not set
> # CONFIG_USB_STORAGE_USBAT is not set
> # CONFIG_USB_STORAGE_SDDR09 is not set
> # CONFIG_USB_STORAGE_SDDR55 is not set
> # CONFIG_USB_STORAGE_JUMPSHOT is not set
> # CONFIG_USB_STORAGE_ALAUDA is not set
> # CONFIG_USB_STORAGE_ONETOUCH is not set
> # CONFIG_USB_STORAGE_KARMA is not set
> # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
> # CONFIG_USB_STORAGE_ENE_UB6250 is not set
> # CONFIG_USB_UAS is not set
2305c2614,2665
< # CONFIG_USB_SERIAL is not set
---
> CONFIG_USB_SERIAL=y
> # CONFIG_USB_SERIAL_CONSOLE is not set
> # CONFIG_USB_SERIAL_GENERIC is not set
> # CONFIG_USB_SERIAL_SIMPLE is not set
> # CONFIG_USB_SERIAL_AIRCABLE is not set
> # CONFIG_USB_SERIAL_ARK3116 is not set
> # CONFIG_USB_SERIAL_BELKIN is not set
> # CONFIG_USB_SERIAL_CH341 is not set
> # CONFIG_USB_SERIAL_WHITEHEAT is not set
> # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
> CONFIG_USB_SERIAL_CP210X=y
> # CONFIG_USB_SERIAL_CYPRESS_M8 is not set
> # CONFIG_USB_SERIAL_EMPEG is not set
> # CONFIG_USB_SERIAL_FTDI_SIO is not set
> # CONFIG_USB_SERIAL_VISOR is not set
> # CONFIG_USB_SERIAL_IPAQ is not set
> # CONFIG_USB_SERIAL_IR is not set
> # CONFIG_USB_SERIAL_EDGEPORT is not set
> # CONFIG_USB_SERIAL_EDGEPORT_TI is not set
> # CONFIG_USB_SERIAL_F81232 is not set
> # CONFIG_USB_SERIAL_GARMIN is not set
> # CONFIG_USB_SERIAL_IPW is not set
> # CONFIG_USB_SERIAL_IUU is not set
> # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
> # CONFIG_USB_SERIAL_KEYSPAN is not set
> # CONFIG_USB_SERIAL_KLSI is not set
> # CONFIG_USB_SERIAL_KOBIL_SCT is not set
> # CONFIG_USB_SERIAL_MCT_U232 is not set
> # CONFIG_USB_SERIAL_METRO is not set
> # CONFIG_USB_SERIAL_MOS7720 is not set
> # CONFIG_USB_SERIAL_MOS7840 is not set
> # CONFIG_USB_SERIAL_MXUPORT is not set
> # CONFIG_USB_SERIAL_NAVMAN is not set
> # CONFIG_USB_SERIAL_PL2303 is not set
> # CONFIG_USB_SERIAL_OTI6858 is not set
> # CONFIG_USB_SERIAL_QCAUX is not set
> # CONFIG_USB_SERIAL_QUALCOMM is not set
> # CONFIG_USB_SERIAL_SPCP8X5 is not set
> # CONFIG_USB_SERIAL_SAFE is not set
> # CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
> # CONFIG_USB_SERIAL_SYMBOL is not set
> # CONFIG_USB_SERIAL_TI is not set
> # CONFIG_USB_SERIAL_CYBERJACK is not set
> # CONFIG_USB_SERIAL_XIRCOM is not set
> # CONFIG_USB_SERIAL_OPTION is not set
> # CONFIG_USB_SERIAL_OMNINET is not set
> # CONFIG_USB_SERIAL_OPTICON is not set
> # CONFIG_USB_SERIAL_XSENS_MT is not set
> # CONFIG_USB_SERIAL_WISHBONE is not set
> # CONFIG_USB_SERIAL_SSU100 is not set
> # CONFIG_USB_SERIAL_QT2 is not set
> # CONFIG_USB_SERIAL_DEBUG is not set
2346d2705
< # CONFIG_USB_GADGET_DEBUG_FS is not set
2449c2808
< # CONFIG_LEDS_TRIGGER_TIMER is not set
---
> CONFIG_LEDS_TRIGGER_TIMER=y
2453c2812
< # CONFIG_LEDS_TRIGGER_CPU is not set
---
> CONFIG_LEDS_TRIGGER_CPU=y
2478,2479c2837,2838
< # CONFIG_RTC_INTF_SYSFS is not set
< # CONFIG_RTC_INTF_PROC is not set
---
> CONFIG_RTC_INTF_SYSFS=y
> CONFIG_RTC_INTF_PROC=y
2746,2747c3105,3106
< # CONFIG_EXT4_FS_POSIX_ACL is not set
< # CONFIG_EXT4_FS_SECURITY is not set
---
> CONFIG_EXT4_FS_POSIX_ACL=y
> CONFIG_EXT4_FS_SECURITY=y
2756a3116
> # CONFIG_OCFS2_FS is not set
2790c3150
< # CONFIG_MSDOS_FS is not set
---
> CONFIG_MSDOS_FS=y
2795c3155,3157
< # CONFIG_NTFS_FS is not set
---
> CONFIG_NTFS_FS=y
> # CONFIG_NTFS_DEBUG is not set
> CONFIG_NTFS_RW=y
2807,2808c3169,3170
< # CONFIG_TMPFS_POSIX_ACL is not set
< # CONFIG_TMPFS_XATTR is not set
---
> CONFIG_TMPFS_POSIX_ACL=y
> CONFIG_TMPFS_XATTR=y
2810c3172
< # CONFIG_CONFIGFS_FS is not set
---
> CONFIG_CONFIGFS_FS=y
2909a3272
> # CONFIG_DLM is not set
2920d3282
< # CONFIG_DYNAMIC_DEBUG is not set
2925,2928c3287,3290
< CONFIG_ENABLE_WARN_DEPRECATED=y
< CONFIG_ENABLE_MUST_CHECK=y
< CONFIG_FRAME_WARN=1024
< # CONFIG_STRIP_ASM_SYMS is not set
---
> # CONFIG_ENABLE_WARN_DEPRECATED is not set
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_FRAME_WARN=2048
> CONFIG_STRIP_ASM_SYMS=y
2930c3292
< CONFIG_DEBUG_FS=y
---
> # CONFIG_DEBUG_FS is not set
2959c3321
< # CONFIG_STACKTRACE is not set
---
> CONFIG_STACKTRACE=y
2981d3342
< # CONFIG_LKDTM is not set
3003c3364,3365
< # CONFIG_STRICT_DEVMEM is not set
---
> CONFIG_STRICT_DEVMEM=y
> # CONFIG_IO_STRICT_DEVMEM is not set
3023c3385
< # CONFIG_SECURITYFS is not set
---
> CONFIG_SECURITYFS=y


I also ensured that the following are enabled:
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_SUN4I=y
CONFIG_SPI_SUN6I=y


But unfortunately when I boot the system I don't get any output related to SPI or enc28j60. What could I be missing?

Could it be counterproductive that I chose CONFIG_FIRMWARE_IN_KERNEL=y?

JohnS

You might do better to ask in a place dedicated to Linux on ARM or even on AW chips - such as linux-sunxi.

John