Using an Upstream Kernel

N.B. work in progress

These instructions show how to use a mainline kernel (not the standard TS vendor supplied or Debian kernel trees), you should be aware the mainline kernel only currently supports the:

  • typical orion5x chipset features - SATA, XOR DMA, hardware crypto, serial, watchdog, and USB
  • RTC
  • NAND operating in PIO mode (not DMA) - 3.4MiB/s read, 880kiB/s write speed
  • hardware random number generator

This means things like the ADC and SD slots are not supported.

git

My working git tree lurks at git://git.wormnet.eu/alex/ts78xx.git.

Future Work

FPGA

I'm working on overhauling the FPGA support in the kernel and exploring using Device Tree to describe the loaded FPGA bitstream. This means that:

  • we avoid hardcoding a lot of information into the kernel about every bitstream out there
  • the FPGA ID/revision is less important (many BTD's could map to a single FPGA ID)
  • opencore-esque modules can be released that you can import into your own FPGA project and trivially supported by the kernel by amending your BTS

It is straight forward to use the 'gpio-nand' driver and if we can work out how to ask the CPLD to power the SD slots the 'mmc_spi' driver (coupled with 'spi_gpio') can be used to provide SD card support.

Technologic Systems Statement

I asked Technologic Systems for the following:

  • FTP access to their FPGA bitstreams: now that you can put your own code onto the FPGA, I thought it would be handy to have the option to at runtime be able to put back the original TS FPGA bitstreams; another nice outcome of this would be that users should be able to upgrade their boards in the field to a newer FPGA revision to fix bugs. I asked TS if they could possibly put them in ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7800-linux/binaries/ts-bitstreams/
  • Information to instruct the CPLD to power the SD slots: powering the SD slots is a task performed by the CPLD which is in turn instructed by a the FPGA (holding a TS bitstream) to do so. As we have no idea what the FPGA sends to the CPLD (anyone got a four channel 1Ghz digital oscilliscope?), if you put your own bitstream into the FPGA there is no way to power the SD slot. If this information was known you could at least get PIO bitbanged access the SD cards running in MMC/SPI mode (slow and CPU consuming, but useful)

To both these requests, TS declined to provide the answers. The bitstreams apparently can be reverse engineered (now I am no HDL engineer but I thought…) which is why they will not put them on the FTP site, whilst questions in regards to the SD slot powering were unfortunately overlooked/unnoticed. If you find, as a customer of TS, that having these features would be handy to you, then please email them so they can register the interest, feed that back into management and show there is demand for this.

Links

NAND

I have submitted some work to speed up the NAND, but I need to add DMA support at some stage.

Cooking a Custom Kernel

You will need an armel toolchain, such as done by following my Installing an Emdebian Cross Compiling Toolchain instructions, before continuing.

Prepare the kernel tree:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux
$ cd linux

$ git remote add ts78xx git://git.wormnet.eu/alex/ts78xx.git
$ git fetch ts78xx

$ git checkout ts78xx

Select the configuration options you want and compile your kernel:

$ alias amake="ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make"

$ amake orion5x_defconfig
$ cat <<EOF >> .config
# these are necessary to boot
CONFIG_CMDLINE="console=ttyS0,115200n8 earlyprintk panic=10 rw ubi.mtd=rootfs,2048 root=ubi0:rootfs rootfstype=ubifs"
CONFIG_CMDLINE_FROM_BOOTLOADER=y

# I additionally use the following
# diff -u .config.orion5x .config | grep '^\(-\|+\)' | sed '/^-$/ d; /^\(---\|+++\)/ d; s/^-CONFIG_\([^=]\+\)=.*$/CONFIG_\1=n/; /^.#/ d; s/^+CONFIG_/CONFIG_/'
CONFIG_TINY_PREEMPT_RCU=n
CONFIG_PREEMPT_RCU=n
CONFIG_TINY_RCU=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_UID16=n
CONFIG_INLINE_SPIN_UNLOCK=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_PREEMPT_NONE=y
CONFIG_PREEMPT=n
CONFIG_PREEMPT_COUNT=n
CONFIG_OABI_COMPAT=n
CONFIG_FPE_NWFPE=n
CONFIG_VFP=n
CONFIG_XFRM=n
CONFIG_IP_PNP=n
CONFIG_IP_PNP_DHCP=n
CONFIG_IP_PNP_BOOTP=n
CONFIG_INET_XFRM_MODE_TRANSPORT=n
CONFIG_INET_XFRM_MODE_TUNNEL=n
CONFIG_INET_XFRM_MODE_BEET=n
CONFIG_IPV6=m
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_WIRELESS=n
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_RAID1=m
CONFIG_BLK_DEV_DM=m
CONFIG_DM_SNAPSHOT=m
CONFIG_WLAN=n
CONFIG_INPUT=n
CONFIG_INPUT_EVDEV=n
CONFIG_INPUT_KEYBOARD=n
CONFIG_KEYBOARD_GPIO=n
CONFIG_LEGACY_PTYS=n
CONFIG_LEGACY_PTY_COUNT=n
CONFIG_HWMON=n
CONFIG_SENSORS_LM75=n
CONFIG_HID_SUPPORT=n
CONFIG_HID=n
CONFIG_USB_HID=n
CONFIG_USB_EHCI_MV=y
CONFIG_EXT2_FS=n
CONFIG_EXT3_FS=n
CONFIG_EXT3_DEFAULTS_TO_ORDERED=n
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_JBD=n
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=m
CONFIG_DNOTIFY=n
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_NFS_FS=n
CONFIG_NFS_V3=n
CONFIG_ROOT_NFS=n
CONFIG_LOCKD=n
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
CONFIG_NFSD_V4=y
CONFIG_LOCKD=m
CONFIG_SUNRPC=n
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_DEBUG_PREEMPT=n
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_EARLY_PRINTK=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRC16=n
CONFIG_CRC16=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
EOF

$ amake menuconfig
$ amake
$ INSTALL_MOD_PATH=../linux-modules amake modules_install 

Now install your kernel:

$ tar -C linux-modules -zcf linux-modules.tar.gz .
$ [unpack linux-modules.tar.gz on your TS-7800 into /]

$ wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7800-linux/binaries/ts-images/sd-mbr.dd
# dd if=sd-mbr.dd of=/dev/mmcblk0
# blockdev --rereadpt /dev/mmcblk0
# { devio 'wl 0xe3a01c06,4' 'wl 0xe3811074,4'; cat linux-stable/arch/arm/boot/zImage; } | dd of=/dev/mmcblk0p2

Device Tree

This is only here for reference and you should ignore this sub-section unless you know what you are doing:

$ amake orion5x-ts7800.dtb
  DTC     arch/arm/boot/orion5x-ts7800.dtb
DTC: dts->dtb  on file "arch/arm/boot/dts/orion5x-ts7800.dts"

# { devio 'wl 0xe3a01c06,4' 'wl 0xe3811074,4'; cat linux-stable/arch/arm/boot/zImage linux-stable/arch/arm/boot/orion5x-ts7800.dtb; } | dd of=/dev/mmcblk0p2
 
ts78xx/kernel.txt · Last modified: 2012/05/17 23:22 by alex
 
Except where otherwise noted, content on this wiki is licensed under the following license:Public Domain
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki