Building etna_viv on the sabre lite

At the moment I am playing around with a cute nice little imx6q board – the sabre lite.

I am running a freescale based RFS with the binary libGAL.so blob in the user space. So why
not look into etna_viv and get it compiled. It turns out to be as simple as this.

git clone git://github.com/laanwj/etna_viv.git
cd etna_viv/native
export GCABI=imx6
export CFLAGS="-D_POSIX_C_SOURCE=200809 -D_GNU_SOURCE -DLINUX -pthread"
export CXXFLAGS="-D_POSIX_C_SOURCE=200809 -D_GNU_SOURCE -DLINUX -pthread"
make

At the moment the GC2000 support is non existent but it should be possible to add support
for it in the foreseeable future. To get a picture what needs to be done have a lookt at
https://blog.visucore.com/2013/3/3/gc2000-vs-gc800

Posted in Linux, Programming | Tagged , | Leave a comment

JQuery: autoscroll to last line of a div

Image you are working on a small web application where you use a JQuery UI dialog
to inform the user about the current process.

<ul id="progress" style="width: 300px; height: 200px; overflow: auto">
</ul>

Triggered via SSE I am appending some messages via JavaScript.

$('#progress').append("<span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em';></span>" + stderr + "<br>");

In order to automaticly scroll to the last line I am using this two magic lines of JavaScript:

var height = $('#progress')[0].scrollHeight;
$('#progress').scrollTop(height);

It is simple as that.

Posted in Programming | Tagged | Leave a comment

git: RPC failed; result=22, HTTP code = 504

git clone http://review.coreboot.org/p/coreboot.git coreboot
Cloning into 'coreboot'...
error: RPC failed; result=22, HTTP code = 504
fatal: The remote end hung up unexpectedly

The error occurs in ‘libcurl’, which is the underlying protocol for http. To get more details about the error, set GIT_CURL_VERBOSE=1

Posted in Stuff | Tagged | Leave a comment

SMBus Compatibility With an I²C Device

Some naive guys – like me – think that SMBus and I²C are equal expect the bus level. But in the last days I run into a problem where an at24 based EEPROM connected via SMBus triggers a bus collision after a warm reboot. After some hours of debugging – even staring minutes at a oscilloscope showing SDD and SDC lines – I started to add some dump_stack() calls into i2c_core.c file form a recent linux kernel. And I found the bad bus transaction – i2c_probe_func_quick_read(..).

But whats exactly the problem here?

The SMBus specification describes a number of standardized
transactions. Each chip on the bus can support each given transaction
type or not. In practice, each slave chip only supports a subset of the
SMBus specification. The Linux i2c subsystem abuses this
transaction type for device detection purposes, because it is known to
give good results in practice, but ideally it shouldn’t do that.

There have been some devices known to lock up the SMBus on Quick
command with data bit = 1. In most cases
these were write-only devices, which didn’t expect a transaction
starting like a read (the SMBus specification says that a Quick command
with data bit = 1 is writing 1 bit to the slave, but the I2C
specification says this is a _read_ transaction of length 0.)

This SMBus Quick command thing keeps causing trouble and confusing
people. Not much we can do though. If your slaves don’t like the quick
command, just don’t send that command to them.

SMBus quick command problem

The solution is quite simple: use i2c_new_probed_device(..) function for probing devices on the SMBus/I²C-Bus. By the way I have found a nice comparison from TI: SMBus vs. I²C

Posted in Linux, Programming | Tagged , , | Leave a comment

Sending patches from a local git repository

At the moment I am reworking some old seabios patches as I want them in upstream. At the moment my git log shows this:

commit fd7e6128d5fb9b8297a4a20f3288c130a554147b
Author: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Date:   Thu Feb 14 10:24:59 2013 +0100

    geodevga: fix wrong define name
    
    Signed-off-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;

commit b1268e8100f0bcf0655b65326856e6f33e3625c1
Author: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Date:   Thu Feb 14 10:22:58 2013 +0100

    geodevga: add debug to msr functions
    
    Signed-off-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;

commit dde4df84126a460c454ca79fc8dc5b0ae4aa876e
Author: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Date:   Thu Feb 14 10:19:05 2013 +0100

    geodevga: move output setup to own function
    
    Signed-off-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;

commit bba85a38c67aa2b52f146b5cefe58b00f516fc2e
Author: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Date:   Thu Feb 14 10:13:59 2013 +0100

    geodevga: move framebuffer setup
    
    Framebuffer setup has nothing to do with dc_setup(..) so
    move it to  geodevga_init(..).
    
    Signed-off-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;

commit 0b3dee01385e65f2b88600c9b663589343ac4abe
Author: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Date:   Thu Feb 14 10:05:45 2013 +0100

    geodevga: fix errors in geode_fp_* functions
    
    Signed-off-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;

commit 4b1d2be6e1c73d1fc9a984ca7fe6c14d433171cc
Author: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Date:   Sun Feb 10 00:51:56 2013 +0000

    Unify return path for CSM to go via csm_return()
    
    This allows us to keep the entry_csm code simple, and ensures that we
    consistently do things like saving the PIC mask (and later setting
    UmbStart) on the way back to UEFI.
...

The first step is to generate the patches.

$ git format-patch -M origin/master
0001-geodevga-fix-errors-in-geode_fp_-functions.patch
0002-geodevga-move-framebuffer-setup.patch
0003-geodevga-move-output-setup-to-own-function.patch
0004-geodevga-add-debug-to-msr-functions.patch
0005-geodevga-fix-wrong-define-name.patch

Now we simply need to send them via mail – git helps here too :)

$ git send-email *.patch
0001-geodevga-fix-errors-in-geode_fp_-functions.patch
0001-geodevga-fix-wrong-define-name.patch
0002-geodevga-move-framebuffer-setup.patch
0003-geodevga-move-output-setup-to-own-function.patch
0004-geodevga-add-debug-to-msr-functions.patch
0005-geodevga-fix-wrong-define-name.patch
Who should the emails appear to be from? [Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;]                                                                   
Emails will be sent from: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Who should the emails be sent to (if any)? seabios@seabios.org                                                                                               
Message-ID to be used as In-Reply-To for the first email (if any)?                                                                                           
(mbox) Adding cc: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt; from line 'From: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;'
(body) Adding cc: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt; from line 'Signed-off-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;'

From: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
To: seabios@seabios.org
Cc: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Subject: [PATCH 1/5] geodevga: fix errors in geode_fp_* functions
Date: Thu, 14 Feb 2013 10:34:32 +0100
Message-Id: &lt;1360834477-18802-1-git-send-email-christian.gmeiner@gmail.com&gt;
X-Mailer: git-send-email 1.7.12.2.421.g261b511

    The Cc list above has been expanded by additional
    addresses found in the patch commit message. By default
    send-email prompts before sending whenever this occurs.
    This behavior is controlled by the sendemail.confirm
    configuration setting.

    For additional information, run 'git send-email --help'.
    To retain the current behavior, but squelch this message,
    run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[q]uit|[a]ll): a                                                                                                                
OK. Log says:
Server: smtp.gmail.com
MAIL FROM:&lt;christian.gmeiner@gmail.com&gt;
RCPT TO:&lt;seabios@seabios.org&gt;
RCPT TO:&lt;christian.gmeiner@gmail.com&gt;
From: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
To: seabios@seabios.org
Cc: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Subject: [PATCH 1/5] geodevga: fix errors in geode_fp_* functions
Date: Thu, 14 Feb 2013 10:34:32 +0100
Message-Id: &lt;1360834477-18802-1-git-send-email-christian.gmeiner@gmail.com&gt;
X-Mailer: git-send-email 1.7.12.2.421.g261b511

Result: 250 2.0.0 OK 1360833086 q5sm77386411eep.11 - gsmtp

...
...
Posted in Programming | Tagged , | Leave a comment

I ♥ Free Software

Today is February 14. Some think of it as flower grocer appreciation day, but most (and for better reasons) celebrate it as the international I ♥ Free Software day.

valentine-2010

Free and open source software makes it possible to fix problems and/or implement new features in software I use. I could write a lot of text why I think it is a good idea to support the open source community but I want you to form an opinion about this topic buy simply using open source software and support it. It does not mean you need to send in some patches… it starts with simple things like bug reports or user support.

Posted in Stuff | Tagged | Leave a comment

Which colors can work together?

In some rare cases I need to find the correct colors that can ‘work’ together. As I do not call me the graphical/designer guy I always use little helpers.

http://colorschemedesigner.com

Posted in Uncategorized | Tagged | Leave a comment

The choice of jQuery selector’s

Sometimes if you are doing some fancy HTML5 development you wonder what jQuery selector
would do the job. In such a case I can recommend the following little helper :)

http://codylindley.com/jqueryselectors/

Posted in Programming | Tagged , | Leave a comment

Add vendor specific information’s to a coreboot rom

Sometimes it is needed to add some vendor specific information’s like a version string
to a generated coreboot rom. For this example we assume we want the area from 0×00 to 0×30
for such kind of data.

The first idea is to use cbfstool. Thanks to some guys in the IRC channel it looks like the
current build system does something like:

cbfstool -o $$(( $(CONFIG_ROM_SIZE) - $(CONFIG_CBFS_SIZE) )) ...

So all we need is to change CBFS_SIZE to ROM_SIZE – 0×30 in .config file.

...
CONFIG_CONSOLE_SERIAL8250=y
# CONFIG_USBDEBUG is not set
# CONFIG_K8_REV_F_SUPPORT is not set
CONFIG_CPU_ADDR_BITS=32
CONFIG_BOARD_ROMSIZE_KB_2048=y
# CONFIG_COREBOOT_ROMSIZE_KB_64 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_128 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set
...
CONFIG_CORE_GLIU_500_266=y
CONFIG_PLLMSRhi=0x39c
# CONFIG_NORTHBRIDGE_AMD_AGESA is not set
# CONFIG_AMD_NB_CIMX is not set
# CONFIG_NORTHBRIDGE_AMD_CIMX_RD890 is not set
CONFIG_CBFS_SIZE=0x1FFFD0

#
# Southbridge
#
CONFIG_SOUTHBRIDGE_AMD_CS5536=y
...

This results in the wanted result:

...
coreboot.rom: 2048 kB, bootblocksize 688, romsize 2097152, offset 0x30
alignment: 64 bytes, architecture: x86

Name                           Offset     Type         Size
vsa                            0x30       stage        55124
config                         0xd7c0     raw          2810
(empty)                        0xe300     null         7256
fallback/romstage              0xff80     stage        19339
fallback/coreboot_ram          0x14b80    stage        38852
fallback/payload               0x1e380    payload      21831
(empty)                        0x23900    null         1950728

And here the file based prove:

# hexedit build/coreboot.rom 
00000000   FF FF FF FF  FF FF FF FF  ........
00000008   FF FF FF FF  FF FF FF FF  ........
00000010   FF FF FF FF  FF FF FF FF  ........
00000018   FF FF FF FF  FF FF FF FF  ........
00000020   FF FF FF FF  FF FF FF FF  ........
00000028   FF FF FF FF  FF FF FF FF  ........
00000030   4C 41 52 43  48 49 56 45  LARCHIVE
00000038   00 00 D7 54  00 00 00 10  ...T....
00000040   00 00 00 00  00 00 00 28  .......(
Posted in coreboot | Leave a comment

Detect initramfs under Debian squeeze

I am looking for a way to detect If a initramfs was used during boot. And after some reboots
and reading of init script of initramfs-tools I found this solution.

#!/bin/bash

if [ -e /dev/.initramfs ]; then
        echo YES
else
        echo NO
fi

This may not work under wheezy or any other working distribution. But that’s okay for now :)

Posted in Debian, Linux | Leave a comment