PandaBoard-ES with upstream u-boot + kernel (take 1)

Hi
A friend of mine asked me whether I could buy for him a pandaboard from the factory in Shenzhen directly and set it up with a Linux for him. Here are the steps I went through to get it running.

Insert the SD card for the boot media (we assume it’s /dev/sdX) and then do the following.
Zero the beginning of the SD card:

dd if=/dev/zero of=/dev/sdX bs=1M count=8

Start fdisk to partition the SD card:

fdisk /dev/sdX

At the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Now type n, then p for primary, 1 for the first partition on the drive, 2048 for the first sector, and then press ENTER to accept the default last sector.
Write the partition table and exit by typing w.

Create and mount the ext4 filesystem:

mkfs.ext4 /dev/sdX1
mount /dev/sdX1 /mnt

Download and extract the root filesystem:

wget http://archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
bsdtar -xpf ArchLinuxARM-armv7-latest.tar.gz -C /mnt
sync

If you don’t have yet installed a cross compiler for ARM, you should do so, for instance with

zypper in cross-arm-linux-gnueabi-gcc

then clone and compile your u(nified)-boot(loader):

git clone git://git.denx.de/u-boot.git
cd u-boot
export CROSS_COMPILE=arm-linux-gnueabi-
make omap4_panda_config
make

Then write your boot loader to the SD card:

dd if=MLO of=/dev/sdX count=1 seek=1 conv=notrunc bs=128k
dd if=u-boot.img of=/dev/sdX count=2 seek=1 conv=notrunc bs=384k

 

Dragoncore/Loongson/龙芯 (step one)

Hi folks
I’m now living in China.
Here are some pictures of my first run of the 龙芯芯片.
Although the lab is still a total mess/battle zone is started working on the FOSS tablet project already.
As you can see the board I got from 龙芯 does power up and loads the PROM.
Next step is to compile a vmlinux for 2H in order to test the system.
IMG_20151108_014651 IMG_20151108_014641 IMG_20151108_014350 IMG_20151108_014342 IMG_20151108_004149

“Money printer”

Hi
I’m working on a python script which uses a cascaded triangular arbitrash in order to multiply money.
But so far the calculations seem to be all unsatisfying.
screeny17
What I’m doing so far is fetching and filtering and interpolating the values in order to estimate the trade development:

#!/usr/bin/python
import sys
import os
import copy
import math

# delays:
from time import sleep

# web api
from Cryptsy import Api

#plotting the stuff
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.pyplot import plot
from matplotlib.pyplot import figure
from matplotlib.pyplot import close
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from IPython import display

#numpy stuff:
from numpy import delete
from numpy import array
from numpy import linspace
from numpy import polyfit
from numpy import poly1d
from numpy import newaxis
from numpy import ones

#scipy stuff
from scipy.signal import wiener
from scipy.optimize import curve_fit
from scipy.ndimage.filters import convolve1d
from scipy.interpolate import interp1d
from scipy.interpolate import InterpolatedUnivariateSpline
from scipy.signal import wiener
from scipy.signal import gaussian
from scipy.signal import savgol_filter

#sklearn
from sklearn.gaussian_process import GaussianProcess
from sklearn.linear_model import LinearRegression
from sklearn.isotonic import IsotonicRegression
from sklearn.cross_validation import cross_val_predict
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import Pipeline
from sklearn.utils import check_random_state

#pyqt fit
from pyqt_fit import npr_methods
import pyqt_fit.nonparam_regression as smooth

	x = linspace(1, len(price_array), len(price_array))
	y = array(price_array)
	filtered_y = savgol_filter(y, window_length, savgol_filter_polyorder)

	k0 = smooth.NonParamRegression(x, filtered_y, method=npr_methods.LocalPolynomialKernel(q=gauss_poly_deg))
	k0.fit()
	z = k0(x)

	avg_diff_number=len(x)/4

	new_x=x[len(x)-avg_diff_number-1:]
	new_z=z[len(z)-avg_diff_number-1:]
	clf = LinearRegression()
	clf.fit(new_x[:,newaxis],new_z)
	tangent=clf.predict(new_x[:,newaxis])

	num_different=(tangent[-1]-tangent[0])/(new_x[-1]-new_x[0])

If someone has a better idea: Please say so!

Two grakas, three displays… and X.org >.<'

Hi folks
This one looks easy… X.org should just detect it, right?

dizzy-6:/home/leviathan # lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GT200b [GeForce GTX 275] (rev a1)
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450]

Well… It didn’t. It had to tinker a whole day until I got the right xorg.conf
I figured I share it with you:

dizzy-6:/home/leviathan # cat /etc/X11/xorg.conf
Section "Device"
        Identifier "radeon"
        Driver "radeon"
        BusID "PCI:2:0:0"
#       Option "ZaphodHeads" "HDMI-0"
        Screen 1 
EndSection

Section "Device"
        Identifier "nvidia-1"
        Driver "nouveau"
        BusID "PCI:1:0:0"
        Option "ZaphodHeads" "DVI-I-1"
        Screen 0
EndSection

Section "Device"
        Identifier "nvidia-2"
        Driver "nouveau"
        BusID "PCI:1:0:0"
        Option "ZaphodHeads" "DVI-I-2"
        Screen 0
EndSection

Section "Monitor"
        Identifier "DVI-I-1"
        Option  "RightOf" "DVI-I-2"
EndSection

Section "Monitor"
        Identifier "DVI-I-2"
EndSection

Section "Monitor"
        Identifier "HDMI-0"
EndSection

Section "Screen"
        Identifier "left_screen"
        Device "nvidia-1"
        Monitor "DVI-I-1"
        DefaultDepth 24 
#       SubSection "Display"
#               Virtual 1600 1200
#       EndSubSection
EndSection

Section "Screen"
        Identifier "middle_screen"
        Device "nvidia-2"
        Monitor "DVI-I-2"
        DefaultDepth 24
EndSection

Section "Screen"
        Identifier "hdmi_screen"
        Device "radeon"
        Monitor "HDMI-0"
        DefaultDepth 24
EndSection

Section "ServerLayout"
        Identifier "My Layout"
#       Option "Xinerama"
        Screen "middle_screen" 0 0
        Screen "left_screen" leftof "middle_screen"
        Screen "hdmi_screen" rightof "middle_screen"
EndSection

My new PC

screeny14

leviathan@dizzy-6:~/Pictures> cat /proc/cpuinfo                                                                                                                                                                                              
processor       : 0                                                                                                                                                                                                                          
vendor_id       : AuthenticAMD                                                                                                                                                                                                               
cpu family      : 21                                                                                                                                                                                                                         
model           : 2                                                                                                                                                                                                                          
model name      : AMD FX(tm)-8350 Eight-Core Processor                                                                                                                                                                                       
stepping        : 0                                                                                                                                                                                                                          
microcode       : 0x6000822                                                                                                                                                                                                                  
cpu MHz         : 1400.000                                                                                                                                                                                                                   
cache size      : 2048 KB                                                                                                                                                                                                                    
physical id     : 0                                                                                                                                                                                                                          
siblings        : 8                                                                                                                                                                                                                          
core id         : 0                                                                                                                                                                                                                          
cpu cores       : 4                                                                                                                                                                                                                          
apicid          : 16                                                                                                                                                                                                                         
initial apicid  : 0                                                                                                                                                                                                                          
fpu             : yes                                                                                                                                                                                                                        
fpu_exception   : yes                                                                                                                                                                                                                        
cpuid level     : 13                                                                                                                                                                                                                         
wp              : yes                                                                                                                                                                                                                        
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1                                                                                                                            
bogomips        : 8027.43                                                                                                                                                                                                                    
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 17
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 18
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 19
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 4
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 4
cpu cores       : 4
apicid          : 20
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 5
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 5
cpu cores       : 4
apicid          : 21
initial apicid  : 5
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 6
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 6
cpu cores       : 4
apicid          : 22
initial apicid  : 6
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 7
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 7
cpu cores       : 4
apicid          : 23
initial apicid  : 7
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

u-boot mainline from denx

Git clone:

git clone git://git.denx.de/u-boot.git

Configure:

cd u-boot
CROSS_COMPILE=arm-linux-gnueabi- make clean
CROSS_COMPILE=arm-linux-gnueabi- make Cubieboard2_defconfig

Compile:

CROSS_COMPILE=arm-linux-gnueabi- make -j6

Installation:

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8

Where /dev/sdX is the device file for your SD card. (Hint: use dmesg to find it out)

Using gamma ray as energy source?

A friend asked me a question on how feasible it would be to use gamma rays as an energy source. So let’s crunch some numbers: The wavelength of gamma rays is
\[\lambda=\frac{c}{f}=0.005 nm\]
Since the optimum length l for an antenna is
\[l=\frac{\lambda}{4}=0.00125 nm=1.25 pm\]
We are a bit in trouble here since the radius of the atom Sodium for instance is approximately 160 pm.
Physically it’s just not possible to build such a small antenna.

My trip to China (Chapter 4)

Today… Let’s just say: I’ve found the StarBucks.
It’s exactly as the StarBucks in Switzerland. I mean exactly the same.
Only that an Americano middle sized cup (for take away) is only 3.50 CHFr and not 5.00 CHFr.! ^_^

Agricultural paradise

Well… I didn’t find it in time… Also as far as I could see… It’s not really as interesting as some travelling blogs have described it.

20150204_170612

20150204_170624

20150204_170641

Lovers road

Well. I didn’t go straight there either because I was stuck at the bubble tea and steamed bread corner where I’ve found fresh Manju (with red bean stuffing! *_*) as you can find a recipe for on my blog.
Also I’ve found Banh Bao… After this dinner I was so stuffed that I decided to roll back home.
Ahh! I talked Chinese a lot more today ^_^

20150204_185722

20150204_191321

Mein potentielles schlechte Laune Ablassventil