OSDev.org
https://forum.osdev.org/

Anyone tried out their kernel on Intel Edison?
https://forum.osdev.org/viewtopic.php?f=1&t=28707
Page 1 of 2

Author:  mutex [ Mon Nov 10, 2014 3:19 pm ]
Post subject:  Anyone tried out their kernel on Intel Edison?

Image

Mine just arrived today... Going to see if I can get it booting. Seems u-boot is the way to go.

Author:  Cjreek [ Tue Nov 11, 2014 3:10 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

Did you just buy the CPU or did you buy a board, too? Which board did you buy?

It surely seems interesting. I'm thinking about getting one myself :)
Altough I've got no experience with arduino or alike :mrgreen:

Author:  mutex [ Tue Nov 11, 2014 3:25 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

I bought this;

https://www.sparkfun.com/products/13025

and this

https://www.sparkfun.com/products/13097

to be sure....

The Edison has really two things inside;

1) Intel Quark microcontroller running at 100MHz. This is the part which runs the "Arduino" stuff...
2) Dual core Intel Atom at 500MHz. It includes a flash memory and ram. This means its basically a embedded PC. It lacks a 16-bit BIOS, so you are booting straight into 32-bit mode with the help from U-boot. Very similar to grub or uboot found on other hardware platforms.

There is also a DFU programming support and a FTDI (serial<->usb) onboard. That way you can access your device serial uart via your pc with a usb cable.

regards
Thomas

Author:  Cjreek [ Tue Nov 11, 2014 4:49 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

I looked at some documents/tutorials and I'm wondering (altough I don't even own one yet :D ) how you'd flash anything on it other than Yocto.

As I understand it you write files into the flash memory just by moving those files onto the "Edison" drive (windows)?
This seems a little bit strange. What does the CPU execute first when it turns on?

How does it work that you just copy the files of Yocto on this drive and then you can just connect to Yocto on your Edison board via putty (COM port).

It seems there's some magic involved or my brain just can't figure out how this works.

Author:  mutex [ Tue Nov 11, 2014 5:17 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

Quick explanation;

When the device powers on it loads a primary bootloader from flash. (Intel code).

This bootloader loads u-boot from flash emmc (The usb disk you see when you connect edison to a computer). Then u-boot loads whatever you tell it... Just copy your kernel to the disk and boot away... I think :lol:

From the usb serial port console on power-on the Edison:

Code:
******************************
******************************
PSH KERNEL VERSION: b0182727
                WR: 20104000
******************************

SCU IPC: 0x800000d0  0xfffce92c

PSH miaHOB version: TNG.B0.VVBD.0000000c

microkernel built 23:15:13 Apr 24 2014

******* 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 (Aug 20 2014 - 16:08:32)

       Watchdog enabled
DRAM:  980.6 MiB
MMC:   tangier_sdhci: 0
In:    serial
Out:   serial
Err:   serial

Hit any key to stop autoboot:  1 ... 0

boot >

Author:  Cjreek [ Tue Nov 11, 2014 5:28 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

So the intel bootloader is hard coded to load/use u-boot?
You just copy u-boot and your kernel on the flash drive and configure u-boot to load your kernel and everything should be fine, right?

What's PSH-Kernel? Is this the bootloader from intel which loads u-boot?

Author:  mutex [ Tue Nov 11, 2014 5:33 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

I guess you could replace u-boot with your own, but I'm not sure how it works. I guess the u-boot may be a ELF binary and that it jumps to the entry point... **not sure**

The PSH stuff is the Intel "hardcoded" bootloader. It's actually not hardcoded... Can also be replaced by connecting Edison in DFU mode and flashing it. Don't know if there is a "stage0" boot process that checks a signature or something. Intel can probably tell you that...

But u-boot works well. Does provide a useful environment for loading your kernel.

just "fatload mmc 0:7 0x1000000 yourkernel.img" and "go 0x1001000" or whatever...

I'll post a log from my experiment this evening.

regards
Thomas

Author:  Brynet-Inc [ Tue Nov 11, 2014 12:00 pm ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

From what I can gleam from Google, there are actually 3 cores in the second generation Edison. A dual-core Atom, which runs Linux by default.. and a single core Intel Quark, running a proprietary RTOS based on VxWorks (..called ViperOS).

The Intel Quark core might be playing a role similar to the GPU in the Raspberry Pi, being initialized first and later bootstrapping the faster Atom cores.

Author:  mutex [ Thu Nov 13, 2014 10:15 pm ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

Lack of documentation on the SoC made this a real pain.

My finding so far;

u-boot loading via emmc is simple. Just put the binary on the removable USB drive that shows up when you connect your computer to the USB OTG port and on the other USB console to u-boot just issue;

Code:
load emmc 0:9 0x100000 /kernel.img
go 0x100000


But doing that every time you need to test a new binary is painfull.

So i tried out serial loading of the kernel and it works pretty well (but slow).

Code:
loady 0x100000 115200


I then created a expect script on my host/build computer to upload the file with picocom and issue "go 0x100000" after its done. That worked well, but nothing happens on screen....! :?

Author:  mutex [ Thu Nov 13, 2014 10:32 pm ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

A major research issue was finding out how to output on the UART. I was hoping my IO port based serial port code would work. That was not the case! Since I was unable to find any documentation on the SoC I had to do some digging...

I booted the Linux image that came with Edison and took a look at /proc/tty/drivers and /proc/tty/driver/* for the current tty. Tells me its a MFD serial port. A look in lspci gave me the clue. Its a PCI serial port.

I added the vendor/device to my PCI serial driver and rebooted since that should work..... [-o< Nothing! #-o

I tried to write directly to the address I found in lspci from u-boot... [-o< [-o<

Code:
boot>mw.b 0xff010180 0x21 1
!boot>


That works.. So since u-boot initialized the UART to 115200 and mapped the BAR i was good..

So I created a dumb driver in my kernel to handle that. So now it boots with messages. =D>

Problem is that kernel does not find the PCI devices except host bridge and graphics adapter... Why???

So I did some more digging with dmesg and lspci

Looks like the PCI config space is not IO mapped but MMIO mapped. That was new to me.... So now I'm writing a new PCI enumerator supporting memory mapped config space..

That took some time figuring out :lol:

Author:  Cjreek [ Mon Nov 17, 2014 9:39 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

If you like you could add an article to our wiki in which you write about your experiences with Intel Edison.
How to start your OS with u-boot, how to write messages to the serial port and in general just some problems you encountered and how you solved them.

As I said I'm thinking about getting one myself but I think I wouldn't have been able to find out how to do those things on by myself. So I would be glad if such an article like mentioned above exists to help me get started :wink: :)

Author:  mutex [ Mon Nov 17, 2014 4:28 pm ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

I'll create a short summary on the wiki.

The Edison firmware starts a watchdog thats a part of the SoC peripherals. If that's not kept alive or stopped your board will reset within a minute or so.

The chipset is undocumented (released end of Q4) so I had to do some digging again.

This will disable the watchdog from u-boot:

Code:
mw.l 0xff009000 0x10f8 1


This will perform a board reset from your kernel:

Code:
*((dword*)0xff009000) = 0xf3;

Author:  tom9876543 [ Tue Nov 18, 2014 1:57 pm ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

Why would anyone buy one of these Intel Edisons, when a Rasberry Pi is about HALF the price?
You can get Linux prebuilt for Rasberry Pi, it seems there is no Linux ready for Edison yet.
Rasberry is much better documented so OS Development must be easier on Raspberry.
mutex sounds like he is an Intel employee or shareholder.

Author:  Cjreek [ Tue Nov 18, 2014 3:22 pm ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

For Intel Edison there's a linux distribution called Yocto which is available.
It's compatible with arduino and also: https://www.sparkfun.com/news/1603

Author:  Combuster [ Wed Nov 19, 2014 1:28 am ]
Post subject:  Re: Anyone tried out their kernel on Intel Edison?

tom9876543 wrote:
Why would anyone buy one of these Intel Edisons, when a Rasberry Pi is about HALF the price?
How about comparing it slightly more fairly to a raspberry with a wifi dongle?

Page 1 of 2 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/