<?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>twam&#039;s homepage &#38; weblog &#187; Kernel</title>
	<atom:link href="http://www.twam.info/tag/kernel/feed" rel="self" type="application/rss+xml" />
	<link>http://www.twam.info</link>
	<description>My computer, internet, Linux &#38; electronics blog</description>
	<lastBuildDate>Fri, 10 Sep 2010 08:43:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>GPIO on ALIX.3D3</title>
		<link>http://www.twam.info/linux/gpio-on-alix3d3</link>
		<comments>http://www.twam.info/linux/gpio-on-alix3d3#comments</comments>
		<pubDate>Sun, 17 May 2009 13:41:35 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[Kernel]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=497</guid>
		<description><![CDATA[The AMD CS5536 Geode companion on the ALIX.3D3 board has several general purpose input/output pins. Most of them have different functions as well, and there are some registers to set if they should be used as special function GPIO pins. The ALIX.3D3 uses 4 GPIO pins for 3 LEDs and 1 mode switch. Accessing the [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.amd.com/us-en/ConnectivitySolutions/ProductInformation/0,,50_2330_9863_13022,00.html">AMD CS5536</a> Geode companion on the ALIX.3D3 board has several general purpose input/output pins. Most of them have different functions as well, and there are some registers to set if they should be used as special function GPIO pins. The ALIX.3D3 uses 4 GPIO pins for 3 LEDs and 1 mode switch. <a href="http://www.twam.info/hardware/alix/leds-on-alix3d3">Accessing the leds</a> is very easy using the leds-alix2 driver, but they can be addressed as GPIO as well. There is already a driver for the GPIO pins in the kernel named cs5535_gpio.c, but it uses a non standard interface to communicate with kernel. So, I wrote a new kernel driver using the GPIO interface.<span id="more-497"></span></p>
<p>Installating is very easy: Download the patch (<a href="http://www.twam.info/wp-content/uploads/2009/05/gpio.patch">GPIO drivers for AMD CS5535/CS5536 (Kernel 2.6.30-rc6)</a>), patch it and compile the kernel:</p>
<pre>wget http://www.twam.info/wp-content/uploads/2009/05/gpio.patch -O /root/gpio.patch
cd /usr/src/linux
patch -p1 &lt; /root/gpio.patch</pre>
<p>Now run kernel configuration and select</p>
<pre>Device Drivers  ---&gt;
   [*] GPIO Support  ---&gt;
   [*]   /sys/class/gpio/... (sysfs interface)
   &lt;*&gt;   AMD CS5535/CS5536 (Geode Companion Device)</pre>
<p>Compile the kernel and reboot. If you go to <em>/sys/class/gpio</em> there should be a file name <em>gpiochip0</em>. Now we can enable some pins and test them. By</p>
<pre>echo 6 &gt; /sys/class/gpio/export</pre>
<p>we tell the kernel, that we want to use pin 6 from userspace. Pin 6 is connected to led. Now we configure pin 6 as an output by</p>
<pre>echo out &gt; /sys/class/gpio/GPIO6/direction</pre>
<p>Now we can toggle the values by</p>
<pre>echo 1 &gt; /sys/class/gpio/GPIO6/value
sleep 1
echo 0 &gt; /sys/class/gpio/GPIO6/value</pre>
<div id="attachment_501" class="wp-caption alignright" style="width: 147px"><a href="http://www.twam.info/wp-content/uploads/2009/05/alix_modeswitch.jpg"><img class="size-medium wp-image-501" title="ALIX.3D3: modeswitch pins" src="http://www.twam.info/wp-content/uploads/2009/05/alix_modeswitch-196x300.jpg" alt="ALIX.3D3: modeswitch pins" width="137" height="210" /></a><p class="wp-caption-text">ALIX.3D3: modeswitch pins</p></div>
<p>Notice, that the LED is connected to 3.3V, so setting value to 0 it will be lit. The other LEDs are connected to pin 25 &amp; pin 27. On pin 24 is a switch connected. We can read the value by enabling the pin, setting it as an input and reading the value:</p>
<pre>echo 24 &gt; /sys/class/gpio/export
echo in &gt; /sys/class/gpio/GPIO24/direction
cat /sys/class/gpio/GPIO24/value</pre>
<p>As the pin has an internal pull up, it will show 1 if the switch isn&#8217;t pressed or installed. If you press the switch or connect to the metal pins, it will result in 0.</p>
<p>Don&#8217;t forget to unexport all pins after when you&#8217;re done:</p>
<pre>echo 6 &gt; /sys/class/gpio/unexport
echo 24 &gt; /sys/class/gpio/unexport</pre>
<p><strong>Any feedback on the driver is welcome!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/gpio-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Kernel 2.6.29: Kernel Mode Setting with Intel GM965</title>
		<link>http://www.twam.info/linux/gentoo/kernel-mode-setting-with-intel-gm965</link>
		<comments>http://www.twam.info/linux/gentoo/kernel-mode-setting-with-intel-gm965#comments</comments>
		<pubDate>Sat, 04 Apr 2009 15:53:06 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=221</guid>
		<description><![CDATA[Kernel 2.6.29 introduced the Kernel Mode Setting feature, meaning the kernel to be able to change resolution and adresse other outputs. For example kernels pre 2.6.29 always actived the external DVI device (if connected) on my macbook and showed boot screens there. This is now configurable. Also switching between X11 and console is much faster. [...]]]></description>
			<content:encoded><![CDATA[<p>Kernel 2.6.29 introduced the Kernel Mode Setting feature, meaning the kernel to be able to change resolution and adresse other outputs. For example kernels pre 2.6.29 always actived the external DVI device (if connected) on my macbook and showed boot screens there. This is now configurable. Also switching between X11 and console is much faster. <span id="more-221"></span></p>
<p>To get KMS running on my macbook, I installed the 2.6.29 with the following settings</p>
<pre>  Device Drivers  ---&gt;
    Graphics support  ---&gt;
      &lt;*&gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  ---&gt;
        &lt;*&gt;   Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver)  ---&gt;
          i915 driver
          [ ]    Enable modesetting on intel by default</pre>
<p>You don&#8217;t have to enable KMS by default. It&#8217;s possible to do this via i915.modeset=1 as a boot option.</p>
<p>After booting the kernel, drm should have detected your outputs and load inteldrmfb</p>
<pre>[    1.905481] [drm] TV-15: set mode NTSC 480i 0
[    2.021462] allocated 1280x800 fb: 0x00fdf000, bo ffff88013eaf2900
[    2.094941] [drm] LVDS-8: set mode 1280x800 17
[    2.191879] Console: switching to colour frame buffer device 160x50
[    2.195013] fb0: inteldrmfb frame buffer device
[    2.195038] registered panic notifier
[    2.195059] [drm] Initialized i915 1.6.0 20080730 on minor 0</pre>
<p>To use KMS within X11, I had to update the latest xorg-server, x11-libs and xf86-video-intel from the x11-overlay. In /etc/X11/xorgs.conf must</p>
<pre>        Option          "AccelMethod"   "UXA"</pre>
<p>set in the intel driver section.</p>
<p>Notice that output names may have changed, if you use a multimonitor setup oder xrandr. I had VGA,TV,LVDS,TMDS-1 prior to 2.6.29 and now it&#8217;s VGA1,TV1,LVDS1,DVI1.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/gentoo/kernel-mode-setting-with-intel-gm965/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
