World Day # ArduinoD15

I have prepared material on the configuration and launch of the freshest Linux kernel on the Intel Edison (Arduino Edition) board.
Earlier, I already wrote about how to ensure the loading of the vanilla core on the Intel Galileo board, but now it was the turn for Intel Edison.

For the current day, there is no serial port driver in vanilla cores, which practically makes working with the board impossible. Today, Greg KH, the maintener of the tty subsystem, has approved changes that bring support for the Intel Edison High Speed UART to the core. In reality, changes in the main branch will appear only in version v4.1-rc1.
So let's get started. I want to immediately note that I will not re-describe some of the actions described in the article
Launch the vanilla core on Intel Galileo . I also assume that you are using stock firmware based on Yocto.
')
Preparing the kernel and file system
First of all, we need a kernel that easily comes from
the linux-next repository of the tty subsystem repository (we will need the tty-next
branch) :
mkdir ~/devel cd ~/devel git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git cd ~/devel/linux-next
You need to make a few minimal edits to the default configuration, namely the
arch / x86 / configs / i386_defconfig file . If for some reason you do not want to touch this file, we can easily copy it with the command
cp arch/x86/configs/{i386,eds}_defconfig
, and in this case use
eds_defconfig where the article mentions
i386_defconfig .
So, it was (we delete lines from the file):
CONFIG_DRM_I915 = y
It became (add lines to the file):
# CONFIG_DRM_I915 is not set
CONFIG_BACKLIGHT_LCD_SUPPORT = y
CONFIG_USB_XHCI_HCD = y
CONFIG_USB_DWC3 = y
CONFIG_USB_DWC3_GADGET = y
CONFIG_GPIOLIB = y
CONFIG_GPIO_INTEL_MID = y
CONFIG_INTEL_MID_WATCHDOG = y
CONFIG_X86_EXTENDED_PLATFORM = y
CONFIG_X86_INTEL_MID = y
CONFIG_EFI_STUB = y
CONFIG_EARLY_PRINTK_EFI = y
CONFIG_HSU_DMA = y
CONFIG_HSU_DMA_PCI = y
CONFIG_SERIAL_8250_DMA = y
CONFIG_SERIAL_8250_PCI = y
This configuration will immediately include USB, watchdog, GPIO, HSU drivers.
We collect the received:
make i386_defconfig make -j4
The result will be the file
arch / x86 / boot / bzImage .
The process of preparing the image of the file system is no different from
that described earlier with the exception of the output device, which for Intel Edison will be
/ dev / ttyS2 , and accordingly it is necessary to specify it in the Buildroot configuration parameters:
BR2_TARGET_GENERIC_GETTY_PORT = "ttyS2"
As a result of the assembly, we get the file
output / images / rootfs.cpio.bz2 .
Copy results to eMMC
The
~ / devel / linux / arch / x86 / boot / bzImage files obtained during the build process and
~ / devel / buildroot / output / images / rootfs.cpio.bz2 must be copied to our board under the names
vmlinuz.efi and
initrd, respectively.
We start the board on the stock firmware before switching it to device mode via USB and connecting it with a cable to the computer on which we assembled. After starting the board, the computer will find the USB disk device. It is what we need. We copy our files directly to the root of the connected drive.
Configuring the U-Boot bootloader
The most interesting part of the story is in the magic lines that we need to write to the U-Boot configuration. This is what we need to do.
- Load the board into the U-Boot command line by pressing any key.
- Add a few environment variables so that you get the following:
boot_edsboot=zboot 0x100000 0 0x3000000 0x800000 bootargs_edsboot=console=tty1 console=ttyS2,115200n8 rootfstype=ramfs rw bootcmd_edsboot=setenv bootargs ${bootargs_edsboot}; run load_edsboot; run boot_edsboot load_edsboot=load mmc 0:9 0x100000 vmlinuz.efi; load mmc 0:9 0x3000000 initrd
This is done using the setenv
command (detailed examples can be found here ). - Save our changes without spoiling the existing ones:
setenv bootcmd_orig ${bootcmd} setenv bootcmd ${bootcmd_edsboot} saveenv
Now you can load the board, for example, with this command:
run bootcmd
or by pressing the reset button.
Accordingly, you can always return to the original configuration by running:
run bootcmd_orig
And that is all!
See what happenedWelcome to Buildroot
buildroot login: root
# uname -a
Linux buildroot 4.0.0-rc5 + # 1 SMP Fri Mar 27 15:15:28 EET 2015 i686 GNU / Linux
# lspci -kn
00: 00.0 0600: 8086: 1170 (rev 01)
00: 01.0 0805: 8086: 1190 (rev 01)
00: 01.2 0805: 8086: 1190 (rev 01)
00: 01.3 0805: 8086: 1190 (rev 01)
00: 02.0 0380: 8086: 1182 (rev 01)
00: 04.0 0700: 8086: 1191 (rev 01)
00: 04.1 0700: 8086: 1191 (rev 01)
Kernel driver in use: serial
00: 04.2 0700: 8086: 1191 (rev 01)
Kernel driver in use: serial
00: 04.3 0700: 8086: 1191 (rev 01)
Kernel driver in use: serial
00: 05.0 0700: 8086: 1192 (rev 01)
Kernel driver in use: hsu_dma_pci
00: 06.0 0880: 8086: 1193 (rev 01)
00: 06.1 0880: 8086: 1193 (rev 01)
00: 07.0 0880: 8086: 1194 (rev 01)
00: 07.1 0880: 8086: 1194 (rev 01)
00: 07.2 0880: 8086: 1194 (rev 01)
00: 08.0 0780: 8086: 1195 (rev 01)
00: 08.1 0780: 8086: 1195 (rev 01)
00: 08.2 0780: 8086: 1195 (rev 01)
00: 08.3 0780: 8086: 1195 (rev 01)
00: 09.0 0780: 8086: 1196 (rev 01)
00: 09.1 0780: 8086: 1196 (rev 01)
00: 09.2 0780: 8086: 1196 (rev 01)
00: 0a.0 0780: 8086: 1197 (rev 01)
00: 0b.0 1080: 8086: 1198 (rev 01)
00: 0c.0 0880: 8086: 1199 (rev 01)
Kernel driver in use: intel_mid_gpio
00: 0d.0 0401: 8086: 119a (rev 01)
00: 0e.0 0880: 8086: 119b (rev 01)
00: 11.0 0c03: 8086: 119e (rev 01)
Kernel driver in use: dwc3-pci
00: 12.0 1180: 8086: 119f (rev 01)
00: 13.0 0b40: 8086: 11a0 (rev 01)
Kernel driver in use: intel_scu_ipc
00: 14.0 0b40: 8086: 11a1 (rev 01)
00: 15.0 0880: 8086: 11a2 (rev 01)
00: 16.0 0b40: 8086: 11a3 (rev 01)
00: 16.1 0b40: 8086: 11a4 (rev 01)
00: 17.0 0880: 8086: 11a5 (rev 01)
00: 18.0 0380: 8086: 11a6 (rev 01)
# cat / proc / interrupts
CPU0 CPU1
15: 0 0 IO-APIC 15-fasteoi watchdog
31: 3 1 IO-APIC 31-fasteoi hsu_dma_pci
34: 50 49 IO-APIC 34-fasteoi xhci-hcd: usb1
48: 0 0 IO-APIC 48-fasteoi intel_scu_ipc
54: 61 65 IO-APIC 54-fasteoi serial
...