1 2 3 Previous Next 114 Replies Latest reply on Jul 31, 2017 12:40 PM by 0andriy

    Newer Kernel on Edison (OpenWrt)

    lth

      I have been spending some time trying to get a newer kernel running on the Edison and that has turned out to be a bit of a jungle.  Ultimately, I want to get OpenWrt running on the module and in order to do that, kernel 3.18 (current mainstream) or 4.0 (next mainstream) kernels would be the preferred choice.

       

      Googling a lot I found very little on this topic.  By far the most encouraging was this blog post:

       

      Запускаем свежайшее ядро Linux на Intel Edison / Хабрахабр

       

      Which unfortunately is in Russian (of which I understand absolutely nothing - but with a little help from Google Translate I got the gist of it).

       

      I have now tried quite a number of different approaches.  I have tried to follow the method outlined in the above blog post.  I have tried a linux-4.0.1 kernel from kernel.org with the original Edison .config as a starting point or with the stdconfig outlined in the blogpost + lines added.  I have also tried simply replacing the /boot/vmlinuz on a working edison rather than going through the elaborate process described in the blog.  No matter what - the result is the same each and every time:

       

      U-boot finds the kernel, loads it, identifies it and start running it - and then nothing.  about a minute later (probably watchdog related) the device reboots.

       

      My guess is that the kernel might actually run but I don't get the console output.  By default, Edison is using ttyMFD2 for logging, but that require support in the kernel for the high speed UART in the Edison.  The thing is - I would suspect that support IS actually there in kernel 4.0.1 (but that contradicts what the Russian is writing in the above).

       

      I got the following in my .config:

       

      CONFIG_SERIAL_MFD_HSU=y

      CONFIG_SERIAL_MFD_HSU_CONSOLE=y

      CONFIG_EARLY_PRINTK_INTEL_MID=y

       

      Just for the hell of it I also tried:

       

      CONFIG_SERIAL_EARLYCON=y

      CONFIG_SERIAL_8250=y

      CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y

      CONFIG_SERIAL_8250_CONSOLE=y

      CONFIG_SERIAL_8250_SYSRQ=y

      CONFIG_SERIAL_8250_DMA=y

      CONFIG_SERIAL_8250_PCI=y

      CONFIG_SERIAL_8250_NR_UARTS=4

      CONFIG_SERIAL_8250_RUNTIME_UARTS=4

       

      I have tried to pass various arguments to the kernel:

       

      console=ttyMFD2

      console=ttyMFD1 (MFD0 appears to be bluetooth in the edison, so if that doesn't exist.....)

      console=ttyMFD0

      console=ttyS0

      console=ttyS1

      console=ttyS2

      console=ttyS3


      No luck - no go.  Unfortunately the above blog offers no way I can identify to contact the blog author, but I can of course hope that he is following this forum and that his English is a bit better than my Russian.


      Else - any ideas, hints or suggestions would be greatly appreciated.  I am on Jabber/XMPP for chat if anybody is interested in working with me on this.


      Lars Boegild Thomsen

      Jabber/XMPP: lth@bright-things.com


        • 1. Re: Newer Kernel on Edison (OpenWrt)
          lth

          After 2 all nighters on this one I decided on a slightly different approach.  The tricky part here is Intel's quite insane 150 k line single patch.  That is _really_ hard to deal with.  So I decided to do the following:

           

          1. A few lines of awk that chop Intel's patch into - hold on to something - 475 different small patches nicely numbered.

          2. Try to build OpenWrt around the 3.10.17 kernel using the standard Quilt + the above 475 patch files

           

          And voila - that actually worked quite well.  For a start I used the OpenWrt build root to create a kernel and threw that on the Edison as a replacement - and that worked fine and more important - I got console output so I can see what I am doing.

           

          Next step now would be to get the rest of OpenWrt bundled around this kernel and make some flashable images, but that is a hell of a lot easier than the kernel stuff.

           

          Finally, once this is up and running, I will probably work my way up in kernel versions.  It should be quite easy to get up to the last 3.10 (it is what - .78 or thereabouts), but by taking small steps and tweaking/removing individual patches along the way - it should be reasonably easy to get up to a kernel version from this century.

          • 2. Re: Newer Kernel on Edison (OpenWrt)
            neilalexander

            I would certainly like to follow your progress with this. I am horribly confused as to how the Intel Edison BSP was ever allowed to be such a horrible mess!

             

            I have not been able to figure out how to integrate these patches into any newer version of the kernel, I haven't been able to transplant the 3.10.17 kernel into any other useful distribution and Yocto makes me want to scream.

             

            From what I can tell, these Intel patches are awfully lazy - rather than adding in new definitions/drivers into the kernel in a portable way, they are simply overwriting definitions for the Moorestown processors. Surely this means that these patches are therefore destructive, kernel version specific and can never be contributed upstream into the main Linux kernel repository?

             

            In which case, if we can't bring this platform back up into the main Linux kernel with some decent device support, then what good is this platform to anyone?

            • 3. Re: Newer Kernel on Edison (OpenWrt)
              lth

              One of the main issues is that the patch contains a lot of stuff that is irrelevant for the Edison device and it is pretty hard to nail down exactly what is needed and what is not.

               

              I have been changing directions a few times.  As mentioned in an earlier message I initially tried to port all the patches to a newer kernel.  I have admittedly turned a bit cold on that one, so I am back to the Russian guys approach.  IF I could get a 4.0 kernel up and running on the Edison WITH console output then I'd be in business.  Once I got the kernel starting and the console output so I can see what is happening, then it'd be a relatively simple matter to cherry pick the necessary patches/drivers from the old kernel and bring them up to date.

               

              By using OpenWrt's Quilt approach to patching it becomes a lot more structured and manageable.

               

              Unfortunately so far I have _still_ not managed to get console output on a 4.0 kernel but I have not given up completely yet.

               

              //Lars...

              • 4. Re: Newer Kernel on Edison (OpenWrt)
                neilalexander

                Are you using an unpatched vanilla 4.0 kernel in the meantime? I notice that in the 4.0 branch there is some Intel MID support already, although it does not seem as comprehensive as that which is provided in Intel's patch and I have not yet had the opportunity to test it.

                 

                Have you managed to overcome the watchdog issue where the device reboots shortly after trying to boot new kernels?

                • 5. Re: Newer Kernel on Edison (OpenWrt)
                  lth

                  I am currently trying to figure out the difference between the 4.0 kernel and 4.1.  I have managed to boot a vanilla 4.1 kernel and that seems to work quite nicely.

                   

                  It is still a bit rough around the edges, but I am describing the progress of that one here:

                   

                  https://edison.internet-share.com/wiki/Edison_Firmware_with_Stock_Kernel

                   

                  Status right now - with the 4.1-rc7 stock kernel:

                   

                  CPU works fine

                  UARTS detected as 8250 device - console log works on those

                  USB sub system works fine

                   

                  I am working on the nand flash right now.

                  • 6. Re: Newer Kernel on Edison (OpenWrt)
                    neilalexander

                    Delighted to see that you are making progress. I will attempt later today to follow your guide and see if I can replicate your success.

                     

                    I examined the source of some of the drivers/firmware loaders from the Intel patches for 802.11b/g/n and Bluetooth this morning, they look straight-forward enough to port. I may see if I can add these into the mix if they are not already working.

                     

                    It may not be too difficult to backport these efforts into OpenWRT.

                    • 7. Re: Newer Kernel on Edison (OpenWrt)
                      lth

                      No, I don't think it will be too difficult at all.  Right now I am attempting to see if I can get the 4.0 kernel going rather than the 4.1.rc7.  The main reason for that is that OpenWrt is currently using 3.8 or 4.0.  If I can't get the 4.0 kernel up and running with console output I will just build the OpenWrt using the 4.1 (which is possible - just require a bit more steps and maintenance).

                      • 8. Re: Newer Kernel on Edison (OpenWrt)
                        neilalexander

                        I have built a linux-next kernel and an initrd to go with it based on yours and Andy's instructions, but unfortunately the kernel does not seem to start. It sits at "Starting kernel" for a few seconds, before rebooting itself. I am going to have a look over the build/defconfigs and see if anything stands out.

                         

                        ******* PSH loader *******

                        PCM page cache size = 192 KB

                        Cache Constraint = 0 Pages

                        Arming IPC driver ..

                        Adding page store pool ..

                        PagestoreAddr(IMR Start Address) = 0x04899000

                        pageStoreSize(IMR Size)          = 0x00080000

                         

                        *** Ready to receive application ***

                         

                         

                        U-Boot 2014.04 (Apr 29 2015 - 03:53:19)

                         

                               Watchdog enabled

                        DRAM:  980.6 MiB

                        MMC:   tangier_sdhci: 0

                        In:    serial

                        Out:   serial

                        Err:   serial

                        Hit any key to stop autoboot:  0

                        boot > run bootcmd_edsboot

                        reading vmlinuz.efi

                        5781808 bytes read in 145 ms (38 MiB/s)

                        reading initrd

                        1650194 bytes read in 51 ms (30.9 MiB/s)

                        Valid Boot Flag

                        Setup Size = 0x00003e00

                        Magic signature found

                        Using boot protocol version 2.0d

                        Linux kernel version 4.1.0-rc6-next-20150605+ (linux@openwrt-buildroot) #2 SMP Tue Jun 9 16:04:47 UTC 2015

                        Building boot_params at 0x00090000

                        Loading bzImage at address 00100000 (5765936 bytes)

                        Magic signature found

                        Initial RAM disk at linear address 0x00800000, size 8388608 bytes

                        Kernel command line: "console=tty1 console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0x800000,8M"

                         

                        Starting kernel ...

                        • 9. Re: Newer Kernel on Edison (OpenWrt)
                          neilalexander

                          To follow up on the above, the problem is with the latest bleeding edge of linux-next somewhere. When I checked out the v4.1-rc6 tag, mrproper'd and rebuilt, the new image has booted successfully!

                          • 10. Re: Newer Kernel on Edison (OpenWrt)
                            lth

                            I managed both although (and I forgot to mention that on the wiki) I did have to checkout a linux-next that was a few days old, because the head failed building at all.

                             

                            What is way more important is that I managed to get in email touch with Andy and he gave me some pointers exactly what needs to be pack ported to 4.0 to get that running too.  It doesn't look too bad actually - I think it is possible.

                            • 11. Re: Newer Kernel on Edison (OpenWrt)
                              lth

                              You are of course welcome to register on that Wiki and jot down corrections and your own notes   The more participating with this the better.

                               

                              I might be a little "disconnected" the next 3-4 days - I hear a tropical beach calling.  But on Monday I will return with a vengeance.

                              • 12. Re: Newer Kernel on Edison (OpenWrt)
                                neilalexander

                                I shall certainly contribute some additions to that.

                                 

                                I have been looking today (without much success) at compiling in some drivers to expand the hardware support. I think the main blocker here are the SDIO/I2C/SPI interfaces, as I have noticed that it is not possible to enumerate devices beyond these interfaces. The unpatched drivers supplied in v4.1-rc6 seem not to be suitable - building using parameters from the Intel patched edison_defconfig are not helping.

                                 

                                I will look at the patches closer, as I expect that once SDIO is working, that Bluetooth and Wi-Fi will fall right into place.

                                • 13. Re: Newer Kernel on Edison (OpenWrt)
                                  lth

                                  I think Wifi/Bluetooth will be fairly straight forward.  I am a bit worried about the nand flash, but I'll look at that early next week.

                                  • 14. Re: Newer Kernel on Edison (OpenWrt)
                                    jkramarz

                                    Hi there,

                                     

                                    I've dug a bit through Edison and ASUS ZenFone sources trying to identify PCI devices on Edison platform and responsible drivers.

                                    Here are my unconfirmed findings, I hope it will help a bit to not duplicate work.

                                    00:01.0 SD Host controller [0805]: Intel Corporation Device [8086:1190] (rev 01) - SDHCI on PCI bus interface; eMMC device in Merrifield

                                         ./drivers/mmc/host/sdhci-pci.c

                                    00:02.0 Display controller [0380]: Intel Corporation Device [8086:1182] (rev 01) - Merrifield Display Controller from Tungsten Graphics, seems to be same as 8086:1180

                                         ./drivers/external_drivers/intel_media/display/tng/drv/psb_drv.c (ZenFone)

                                    00:04.0 Serial controller [0700]: Intel Corporation Device [8086:1191] (rev 01) - HSU serial ports

                                         ./tty/serial/mfd_pci.c

                                    00:05.0 Serial controller [0700]: Intel Corporation Device [8086:1192] (rev 01) - HSU serial ports DMA

                                         ./tty/serial/mfd_pci.c

                                    00:06.0 System peripheral [0880]: Intel Corporation Device [8086:1193] (rev 01) - I2S controller (audio, DMA through 00:0e.0)

                                         ./sound/pci/intel_mid_i2s/intel_mid_i2s.h

                                    00:07.0 System peripheral [0880]: Intel Corporation Device [8086:1194] (rev 01) -  Bulverde SSP core on Intel MID platforms (DMA through 00:15.0)

                                         /drivers/spi/intel_mid_ssp_spi.c

                                    00:08.0 Communication controller [0780]: Intel Corporation Device [8086:1195] (rev 01) - Synopsys DesignWare I2C adapter

                                         ./drivers/i2c/busses/i2c-designware-pcidrv.c

                                    00:09.0 Communication controller [0780]: Intel Corporation Device [8086:1196] (rev 01) - Synopsys DesignWare I2C adapter

                                         ./drivers/i2c/busses/i2c-designware-pcidrv.c

                                    00:0a.0 Communication controller [0780]: Intel Corporation Device [8086:1197] (rev 01) - Intel HSI controller

                                         ./include/linux/hsi/intel_mid_hsi.h

                                    00:0b.0 Encryption controller [1080]: Intel Corporation Device [8086:1198] (rev 01) - ??

                                         no support in sources

                                    00:0c.0 System peripheral [0880]: Intel Corporation Device [8086:1199] (rev 01)- Intel Langwell chip GPIO

                                         ./drivers/gpio/gpio-langwell.c

                                    00:0d.0 Multimedia audio controller [0401]: Intel Corporation Device [8086:119a] (rev 01) - Intel SST (audio engine)

                                         ./sound/soc/intel/sst/sst.h

                                    00:0e.0 System peripheral [0880]: Intel Corporation Device [8086:119b] (rev 01) - Intel Langwell DMA controller for I2S

                                         ./sound/pci/intel_mid_i2s/intel_mid_i2s.h

                                         ./drivers/dma/intel_mid_dma.c

                                         ./sound/soc/intel/sst/sst.h

                                    00:11.0 USB controller [0c03]: Intel Corporation Device [8086:119e] (rev 01) - SuperSpeed (SS) USB 3.0 Dual-Role-Device

                                         ./drivers/usb/dwc3/dwc3-pci.c

                                    00:12.0 Signal processing controller [1180]: Intel Corporation Device [8086:119f] (rev 01) - Parallel Trace Interface (PTI) for cJTAG data extraction

                                         ./drivers/misc/pti.c

                                    00:13.0 Co-processor [0b40]: Intel Corporation Device [8086:11a0] (rev 01) - Intel SCU IPC mechanism

                                         ./drivers/platform/x86/intel_scu_ipc.c

                                    00:14.0 Co-processor [0b40]: Intel Corporation Device [8086:11a1] (rev 01) - Power Management Units configuration interface

                                         ./arch/x86/platform/intel-mid/intel_soc_pmu.h

                                    00:15.0 System peripheral [0880]: Intel Corporation Device [8086:11a2] (rev 01) - Intel Langwell DMA controller for SPI

                                         ./drivers/dma/intel_mid_dma.c

                                    00:16.0 Co-processor [0b40]: Intel Corporation Device [8086:11a3] (rev 01) - Intel PSH IPC

                                         ./drivers/external_drivers/drivers/platform/x86/intel_psh_ipc.c

                                    00:16.1 Co-processor [0b40]: Intel Corporation Device [8086:11a4] (rev 01) - PSH IA side driver for Merrifield Platform

                                         ./drivers/external_drivers/drivers/hwmon/psh.c

                                    00:17.0 System peripheral [0880]: Intel Corporation Device [8086:11a5] (rev 01) - PWM on Intel MID platform

                                         ./drivers/pwm/pwm-intel-mid.c

                                    00:18.0 Display controller [0380]: Intel Corporation Device [8086:11a6] (rev 01) - Merrifield HDMI

                                         ./arch/x86/platform/intel-mid/intel_soc_pmu.h (ZenFone)

                                         ./drivers/external_drivers/intel_media/otm_hdmi/pil/specific/mrfld/ps_hdmi.c (ZenFone)

                                    When backporting changes from ZenFone to Edison, please don't do it blind - eg. ZenFone sources has support for only one PWM channel (vibra) in PWM controller.

                                    1 of 1 people found this helpful
                                    1 2 3 Previous Next