<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Beyondlogic</title>
	<atom:link href="http://www.beyondlogic.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beyondlogic.org/blog</link>
	<description></description>
	<lastBuildDate>Sat, 07 Jan 2012 04:13:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Part 1: Updating the Kernel on the GuruPlug</title>
		<link>http://www.beyondlogic.org/blog/2012/01/part-1-updating-the-kernel-on-the-guruplug/</link>
		<comments>http://www.beyondlogic.org/blog/2012/01/part-1-updating-the-kernel-on-the-guruplug/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 10:59:36 +0000</pubDate>
		<dc:creator>Craig Peacock</dc:creator>
				<category><![CDATA[GuruPlug]]></category>

		<guid isPermaLink="false">http://www.beyondlogic.org/blog/?p=12</guid>
		<description><![CDATA[I&#8217;ve recently acquired an IoGear external DVI Video Interface using Display Link technology. It&#8217;s essentially a USB to DVI Video interface and just the thing to add a video display to my Guruplug. The kernel on my Guruplug is version 2.6.32-00007-g56678ec originally installed when it &#8230; <a href="http://www.beyondlogic.org/blog/2012/01/part-1-updating-the-kernel-on-the-guruplug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://www.beyondlogic.org/guruplug/guruplugdisplaylink.png"></center></p>
<p>I&#8217;ve recently acquired an IoGear external DVI Video Interface using Display Link technology. It&#8217;s essentially a USB to DVI Video interface and just the thing to add a video display to my Guruplug.</p>
<p>The kernel on my Guruplug is version 2.6.32-00007-g56678ec originally installed when it shipped from <a title="Global Scale Technologies" href="http://www.globalscaletechnologies.com">Global Scale Technologies</a> in May 2010. According to <a title="Freedesktop.org" href="http://libdlo.freedesktop.org/wiki/">freedesktop.org </a>the opensource DisplayLink driver was added to the mainline kernel in version 2.6.38, so rather than recompiling the driver as a module for 2.6.38, I made the decision in under 100 milliseconds to upgrade the kernel to the latest whiz bang 2.6 version &#8211; 2.6.39.4 at time of publication. After all, Why not?</p>
<p>This was my first serious adventure into the depths of the Guruplug. I was one of the excited individuals (picture Christmas time) to order the Guruplug Server Plus prior to its release, only to find out it was really the GuruPlug Server Plug plus Heat Problems when it arrived. An engineer at sometime, somewhere, underestimated the heat they could dissipate in such a small package and when the two ethernet ports were both used at gigabit rates, the unit would spontaneously reset. In addition, with marginally rated capacitors in the power supply and Australia being 240V and not 110V and there was a high instance of power supply failure.</p>
<p>The enthusiasm to do anything with this device rapidly died. Well until now.</p>
<p>Over the years I&#8217;ve learnt, many times the hard way, that you really need to understand the memory maps, MTD (Memory Technology Device) flash partitions, bootloader and recovery process prior to diving in head first and flashing the device with your newly built kernel.</p>
<p>When I pre-ordered the Guruplug Server Plus, Global Scale threw in a Guru Plug JTAG board that connects directly to the the GuruPlug&#8217;s JTAG and console ports. The JTAG board is based on a <a href="http://www.ftdichip.com/Products/ICs/FT2232D.htm">FTDI FT2232D</a> dual USB serial port with Multi-Protocol Synchronous Serial Engine (MPSSE). Basically, the device has two USB to serial converters &#8211; they use one for the 2.5V asynchronous serial based console port and the other one as the JTAG port using the MPSSE. <a href="http://openocd.berlios.de/">OpenOCD</a>, a free open source On Chip Debugger can then be used to program the device - essential if you break the bootloader and need to recover it.</p>
<h2>Bootloader</h2>
<p>The boot loader on the Guruplug is <a href="http://www.denx.de/wiki/U-Boot">DAS u-Boot</a>, or more commonly known as just u-Boot. Yes, you are right &#8211; it&#8217;s German.</p>
<p>The bootloader installed on my Guruplug is u-Boot 2009.11-rc1-00602-g28a9c08-dirty (Feb 09 2010 &#8211; 18:15:21) and looks like a modified version by Marvell, the chip manufacturer of the 1.2GHz Kirkwood processor that powers the plug. The bootloader should be accessible on the console port after power up. The console port is 115,200bps 8N1.</p>
<p>The GuruPlug&#8217;s memory consists of 512MB of NAND flash and 512MB of 800MHz DDR2 RAM. The memory map is quite simple.</p>
<p>The u-Boot bootloader, the bootloader&#8217;s environment/configuration space, the kernel and filesystem is all stored &#8211; naturally &#8211; on non-volatile flash. u-Boot and the configuration space occupies the first 1MB of memory. The kernel has the next 4 megabytes starting at offset 0&#215;100000. Then the filesystem has the remaining 507 megabytes from 0&#215;500000.</p>
<p>On the RAM side, u-Boot has the first 8 megabytes reserved. The rest is free. Some developer&#8217;s will load kernels and filesystems at 0&#215;800000 for programming to flash. Another common spot is at the 100 megabyte boundary (or offset 0&#215;640000).</p>
<p>u-Boot appears to be able to load a kernel from a FAT formatted USB stick (or drive) or via TFTP. To test your kernel from USB you can use the following commands :</p>
<p><tt>usb reset<br />
fatload usb 1:1 0x800000 uImage-guruplug<br />
setenv bootargs console=ttyS0,115200n8<br />
bootm 0x800000</tt></p>
<p>The USB reset command will reset the USB bus and scan (enumerate) devices on the bus. Running the command on a GuruPlug without any USB devices connectors should return a dialog similar to below :</p>
<p><tt>(Re)start USB...<br />
USB:   Register 10011 NbrPorts 1<br />
USB EHCI 1.00<br />
scanning bus for devices... 3 USB Device(s) found<br />
scanning bus for storage devices... Device NOT ready<br />
Request Sense returned 02 3A 00<br />
1 Storage Device(s) found</tt></p>
<p>A quick glance at the schematics will show the Guruplug incorporates a <a href="http://www.genesyslogic.com/product_01_1.php?id=42">Genesys Logic GL850G 4 Port Hub Controller</a> and Genesys Logic GL836 USB2 Flash Card Reader Controller. The Flash Card reader connects to two micro SD connectors, J3 an Internal connector, not populated on my board and J4 which is the external micro SD card slot.</p>
<h2>Cross Compiler</h2>
<p>Before you can start building the kernel for the GuruPlug, you will need to install an ARM cross compiler. I used the <a href="http://www.codesourcery.com/sgpp/lite/arm/portal/release1802">CodeSourcery G++ Lite 2011.03-42 for ARM EABI</a> and added the compiler&#8217;s bin directory to my path after installation.</p>
<h2>Kernel</h2>
<p>Next, you will need to download the kernel. Marvell has a <a href="http://git.marvell.com/?p=orion.git;a=summary">source tree here</a> but the latest release is 2.6.35rc1. According to people in the know, the Marvell tree is merged with the Kernel.org tree from time to time and vice versa. As 2.6.35rc1 apparently doesn&#8217;t have the DisplayLink drivers, I that I just love cutting edge, I couldn&#8217;t help to try the latest stable 2.6 version, Linux-2.6.29.4. O.k., I&#8217;m don&#8217;t crave cutting edge that much to try version 3 of the kernel. The bzip2 version of the source can be downloaded <a href="http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.3.tar.bz2">here</a>.</p>
<p><tt>http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2<br />
tar -xjf linux-2.6.39.4.tar.bz2</tt></p>
<p>Before we delve into building the kernel, u-boot has a special image format called uImage. It includes parameters such as descriptions, the machine/architecture type, compression type, load address, checksums etc. To make these images, you need to have a mkimage tool that comes part of the u-Boot distribution.</p>
<p><tt>wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2<br />
tar -xjf u-boot-latest.tar.bz2<br />
cd into u-boot directory<br />
make tools<br />
sudo install tools/mkimage /usr/local/bin</tt></p>
<p>u-Boot will not load images intended for a different machine. Doing so will result in an error similar to below :</p>
<p><tt>Marvell>> bootm 0x800000<br />
## Booting kernel from Legacy Image at 00800000 ...<br />
   Image Name:   Linux-2.6.39.4<br />
   Image Type:   ARM Linux Kernel Image (uncompressed)<br />
   Data Size:    2324344 Bytes =  2.2 MB<br />
   Load Address: 00008000<br />
   Entry Point:  00008000<br />
   Verifying Checksum ... OK<br />
   Loading Kernel Image ... OK<br />
OK</p>
<p>Starting kernel ...</p>
<p>Uncompressing Linux... done, booting the kernel.</p>
<p>Error: unrecognized/unsupported machine ID (r1 = 0x00000a29).</p>
<p>Available machine support:</p>
<p>ID (hex)        NAME<br />
00000690        Marvell DB-88F6281-BP Development Board<br />
00000691        Marvell RD-88F6192-NAS Development Board<br />
00000692        Marvell RD-88F6281 Reference Board<br />
0000078c        Marvell 88F6281 GTW GE Board<br />
00000a76        Marvell eSATA SheevaPlug Reference Board<br />
00000831        Marvell SheevaPlug Reference Board<br />
00000a63        Marvell GuruPlug Reference Board<br />
00000bb6        Seagate FreeAgent DockStar<br />
0000085b        QNAP TS-119/TS-219<br />
000009c6        QNAP TS-41x<br />
00000b44        Marvell OpenRD Ultimate Board<br />
00000939        Marvell OpenRD Client Board<br />
00000915        Marvell OpenRD Base Board<br />
0000089a        LaCie Network Space Max v2<br />
000008a0        LaCie Internet Space v2<br />
00000899        LaCie Network Space v2<br />
0000089b        LaCie d2 Network v2<br />
0000089e        LaCie 5Big Network v2<br />
0000089c        LaCie 2Big Network v2<br />
00000b1e        HP t5325 Thin Client</p>
<p>Please check your kernel config and/or bootloader.</tt></p>
<p>If you use bdinfo on the GuruPlug Server Plus shipped from GlobalScale Technologies you will find the architecture number is set to 0xA29 or decimal 2601.</p>
<p><tt>Marvell>> bdinfo<br />
Marvell>> bdinfo<br />
arch_number = 0x00000A29<br />
env_t       = 0x00000000<br />
boot_params = 0x00000100<br />
DRAM bank   = 0x00000000<br />
-> start    = 0x00000000<br />
-> size     = 0x10000000<br />
DRAM bank   = 0x00000001<br />
-> start    = 0x10000000<br />
-> size     = 0x10000000<br />
DRAM bank   = 0x00000002<br />
-> start    = 0x00000000<br />
-> size     = 0x00000000<br />
DRAM bank   = 0x00000003<br />
-> start    = 0x00000000<br />
-> size     = 0x00000000<br />
ethaddr     = 02:50:43:34:a8:cb<br />
ip_addr     = 192.168.0.250<br />
baudrate    = 115200 bps<br />
Marvell>></tt></p>
<p>In the kernel, MACH_TYPE_GURUPLUG is defined as decimal 2659 (0xA63). You have two choices, you can change the environment variable arch_number to 0xA63 or you can hack the include/generated/mach-types.h file and change the define for MACH_TYPE_GURUPLUG to 2601. I took the later option, changing the mach-types.h file. This hopefully allows the ability to interchange my kernels with the original kernel from Global Scale.</p>
<p><tt>#define MACH_TYPE_GURUPLUG             2601</tt></p>
<h2>Building the Kernel</h2>
<p>Before we can build the kernel, we need to configure it. Build the menu configuration using the following commands : </p>
<p><tt>cd linux-2.6.39.4/<br />
make ARCH=arm kirkwood_defconfig<br />
make ARCH=arm menuconfig</tt></p>
<p>As the objective is to build in DisplayLink USB support, we need to enable support for this.</p>
<p>Under <tt>Device Drivers -> Graphics Support -> Support for Frame Buffer Devices</tt>,  enable built-in support for <tt>DisplayLink USB Framebuffer Support</tt>. </p>
<p>Also in the <tt>Device Drivers -> Graphics Support</tt> menu, select <tt>Console display driver support</tt> and enable built-in <tt> Framebuffer Console support</tt>.</p>
<p><tt>Map the console to the primary display device</tt></p>
<p>Once you have finished configuring the kernel, you will want to build it :</p>
<p><tt>make ARCH=arm CROSS_COMPILE=arm-none-eabi- uImage</tt></p>
<p>This process should finish with a dialog similar to :</p>
<p><tt> OBJCOPY arch/arm/boot/zImage<br />
  Kernel: arch/arm/boot/zImage is ready<br />
  UIMAGE  arch/arm/boot/uImage<br />
Image Name:   Linux-2.6.39.4<br />
Created:      Sat Sep 17 04:26:42 2011<br />
Image Type:   ARM Linux Kernel Image (uncompressed)<br />
Data Size:    2324344 Bytes = 2269.87 kB = 2.22 MB<br />
Load Address: 00008000<br />
Entry Point:  00008000<br />
  Image arch/arm/boot/uImage is ready</tt></p>
<p>Now build the modules and install them to a suitable path :</p>
<p><tt>make ARCH=arm CROSS_COMPILE=arm-none-eabi- modules<br />
make ARCH=arm CROSS_COMPILE=arm-none-eabi- INSTALL_MOD_PATH=/home/cpeacock/export/rootfs-f12 modules_install</tt></p>
<h2>Testing</h2>
<p>In the next instalment (post), we will set about testing our kernel. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.beyondlogic.org/blog/2012/01/part-1-updating-the-kernel-on-the-guruplug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beyondlogic Facelift</title>
		<link>http://www.beyondlogic.org/blog/2011/06/beyondlogic-facelift/</link>
		<comments>http://www.beyondlogic.org/blog/2011/06/beyondlogic-facelift/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 13:28:26 +0000</pubDate>
		<dc:creator>Craig Peacock</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.beyondlogic.org/blog/?p=6</guid>
		<description><![CDATA[Welcome to the new format of the Beyondlogic website. The old website has served us well for the past ten years, but both the content and style is in need of an major overhaul. Over the coming weeks and months, &#8230; <a href="http://www.beyondlogic.org/blog/2011/06/beyondlogic-facelift/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Welcome to the new format of the Beyondlogic website. The old website has served us well for the past ten years, but both the content and style is in need of an major overhaul.</p>
<p>Over the coming weeks and months, readers can look forward to new and exciting content.</p>
<p>The old site has not disappeared. It has been relocated to <A HREF="http://retired.beyondlogic.org">http://retired.beyondlogic.org</A></p>
]]></content:encoded>
			<wfw:commentRss>http://www.beyondlogic.org/blog/2011/06/beyondlogic-facelift/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

