Example DSDT for FVP Base Model

As a follow-on from yesterdays post, for development work like the rest of the arm64 community we had to spend a long time working with the models as hardware was not available. So here is a example DSDT for FVP Base Model.

DefinitionBlock (
 "dsdt.aml", // output filename
 "DSDT", // table signature
 2, // DSDT compliance revision
 "LINARO", // OEM ID
 "RTSMVEV8", // table ID
 0x00000004) // OEM revision
{
 Scope (\_SB)
 {
 Method (_OSC, 4, NotSerialized)
 {
 /* Platform-Wide OSPM Capabilities */
 If(LEqual(Arg0,ToUUID("0811B06E-4A27-44F9-8D60-3CBBC22E7B48")))
 {
 /* APEI support unconditionally */
 Return (Arg3)
 } Else {
 CreateDWordField (Arg3, Zero, CDW1)
 /* Set invalid UUID error bit */
 Or (CDW1, 0x04, CDW1)
 Return (Arg3)
 }
 }

 //
 // Two Emulated aarch64 CPUs each with 4 cores
 //
 Device(CPU0) { // Cluster 0, Cpu 0
 Name(_HID, "ACPI0007")
 Name(_UID, 0)
 }
 Device(CPU1) { // Cluster 0, Cpu 1
 Name(_HID, "ACPI0007")
 Name(_UID, 1)
 }
 Device(CPU2) { // Cluster 0, Cpu 2
 Name(_HID, "ACPI0007")
 Name(_UID, 2)
 }
 Device(CPU3) { // Cluster 0, Cpu 3
 Name(_HID, "ACPI0007")
 Name(_UID, 3)
 }
 Device(CPU4) { // Cluster 1, Cpu 0
 Name(_HID, "ACPI0007")
 Name(_UID, 4)
 }
 Device(CPU5) { // Cluster 1, Cpu 1
 Name(_HID, "ACPI0007")
 Name(_UID, 5)
 }
 Device(CPU6) { // Cluster 1, Cpu 2
 Name(_HID, "ACPI0007")
 Name(_UID, 6)
 }
 Device(CPU7) { // Cluster 1, Cpu 3
 Name(_HID, "ACPI0007")
 Name(_UID, 7)
 }

 // SMC91X
 Device (NET0) {
 Name (_HID, "LNRO0003")
 Name (_UID, 0)

 Name (_CRS, ResourceTemplate () {
 Memory32Fixed (ReadWrite, 0x1a000000, 0x00010000)
 Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, , , ) {0x2F}
 })
 }

 // SYSREG
 Device (SREG) {
 Name (_HID, "LNRO0009")
 Name (_UID, 0)

 Method (_CRS, 0x0, Serialized) {
 Name (RBUF, ResourceTemplate() {
 Memory32Fixed (ReadWrite, 0x1c010000, 0x1000)
 })
 Return (RBUF)
 }
 }

 // VIRTIO
 Device (VIRT) {
 Name (_HID, "LNRO0005")
 Name (_UID, 0)

 Name (_CRS, ResourceTemplate() {
 Memory32Fixed (ReadWrite, 0x1c130000, 0x1000)
 Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {0x4A}
 })
 }

 // UART PL011
 Device(COM0) {
 Name(_HID, "ARMH0011")
 Name(_CID, "PL011")
 Name(_UID, Zero)

 Name(_CRS, ResourceTemplate() {
 Memory32Fixed(ReadWrite, 0x1c090000, 0x1000)
 Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x25 }
 })
 }
 }
}

Juno booting from ACPI tables.

So my work at Linaro for the last year and a half has been on bring ACPI to arm64. The first actual hardware platform that this work can be booted on is the Juno development board.

Using the ACPI tables devloped for MS Windows and published by ARM https://github.com/ARM-software/edk2/tree/juno-acpi.

And the kernel based on the series of patches published by Linaro on LKML http://git.linaro.org/leg/acpi/acpi.git/shortlog/refs/heads/acpi-topic-juno-fvp.

It is now possible to boot the Juno to userspace (using root on NFS as the USB support is not in mainline yet).

Here is dmesg of successful boot.

Initializing cgroup subsys cpu
Linux version 3.17.0-rc2+ (graeme@xora-haswell) (gcc version 4.8.3 20140401 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04) ) #168 SMP PREEMPT Fri Aug 29 17:11:37 BST 2014
CPU: AArch64 Processor [410fd030] revision 0
Detected VIPT I-cache on CPU0
Early serial console at I/O port 0x0 (options '')
bootconsole [uart0] enabled
efi: Getting EFI parameters from FDT:
EFI v2.40 by ARM Juno EFI Aug 7 2014 10:38:36
efi: ACPI=0xf9b80000 ACPI 2.0=0xf9b80014 
ACPI: Early table checksum verification disabled
ACPI: RSDP 0x00000000F9B80014 000024 (v02 ARMLTD)
ACPI: XSDT 0x00000000F9B7F0E8 00003C (v01 ARMLTD ARM-JUNO 20140727 01000013)
ACPI: FACP 0x00000000F9B42000 00010C (v05 ARMLTD ARM-JUNO 20140727 ARM 00000099)
ACPI: DSDT 0x00000000F9B3F000 000317 (v01 ARMLTD ARM-JUNO 20140727 INTL 20140424)
ACPI: GTDT 0x00000000F9B41000 000060 (v01 ARMLTD ARM-JUNO 20140727 ARM 00000099)
ACPI: APIC 0x00000000F9B40000 00020C (v01 ARMLTD ARM-JUNO 20140727 ARM 00000099)
On node 0 totalpages: 519952
 DMA zone: 7112 pages used for memmap
 DMA zone: 0 pages reserved
 DMA zone: 519952 pages, LIFO batch:31
ACPI: GICC (acpi_id[0x0002] address[000000002c02f000] MPDIR[0x100] enabled)
ACPI: GICC (acpi_id[0x0003] address[000000002c02f000] MPDIR[0x101] enabled)
ACPI: GICC (acpi_id[0x0004] address[000000002c02f000] MPDIR[0x102] enabled)
ACPI: GICC (acpi_id[0x0005] address[000000002c02f000] MPDIR[0x103] enabled)
ACPI: GICC (acpi_id[0x0000] address[000000002c02f000] MPDIR[0x0] enabled)
ACPI: GICC (acpi_id[0x0001] address[000000002c02f000] MPDIR[0x1] enabled)
ACPI: 6 CPUs enabled, 6 CPUs total
psci: probing for conduit method from ACPI.
psci: Using standard PSCI v0.2 function IDs
PERCPU: Embedded 11 pages/cpu @ffffffc07ea28000 s13760 r8192 d23104 u45056
pcpu-alloc: s13760 r8192 d23104 u45056 alloc=11*4096
pcpu-alloc: [0] 0 [0] 1 
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 512840
Kernel command line: console=ttySBSA0 earlycon=pl011,0x7ff80000 root=/dev/nfs nfsroot=192.168.0.10:/srv/nfs/juno ip=dhcp
PID hash table entries: 4096 (order: 3, 32768 bytes)
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Memory: 2015420K/2079808K available (4039K kernel code, 256K rwdata, 1484K rodata, 221K init, 185K bss, 64388K reserved)
Virtual kernel memory layout:
 vmalloc : 0xffffff8000000000 - 0xffffffbdffff0000 ( 247 GB)
 vmemmap : 0xffffffbe00000000 - 0xffffffbfc0000000 ( 7 GB maximum)
 0xffffffbe01c00000 - 0xffffffbe037c8000 ( 27 MB actual)
 PCI I/O : 0xffffffbffa000000 - 0xffffffbffb000000 ( 16 MB)
 fixed : 0xffffffbffbdfe000 - 0xffffffbffbdff000 ( 4 KB)
 modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB)
 memory : 0xffffffc000000000 - 0xffffffc07f000000 ( 2032 MB)
 .init : 0xffffffc0005e6000 - 0xffffffc00061d5c0 ( 222 KB)
 .text : 0xffffffc000080000 - 0xffffffc0005e5dd4 ( 5528 KB)
 .data : 0xffffffc00061e000 - 0xffffffc00065e1e0 ( 257 KB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Preemptible hierarchical RCU implementation.
 RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:64 nr_irqs:64 0
clocksource_of_init: no matching clocksources found
Architected cp15 timer(s) running at 50.00MHz (phys).
sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 2748779069440ns
Console: colour dummy device 80x25
Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=500000)
pid_max: default: 32768 minimum: 301
ACPI: Core revision 20140724
ACPI: All ACPI Tables successfully acquired
Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
No CPU information found in DT
hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 7 counters available
Remapping and enabling EFI services.
Freed 0x18cb000 bytes of EFI boot services memory
CPU1: Booted secondary processor
Detected PIPT I-cache on CPU1
Brought up 2 CPUs
SMP: Total of 2 processors activated.
devtmpfs: initialized
atomic64_test: passed
regulator-dummy: no parameters
NET: Registered protocol family 16
cpuidle: using governor ladder
cpuidle: using governor menu
vdso: 2 pages (1 code @ ffffffc000625000, 1 data @ ffffffc000624000)
hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
software IO TLB [mem 0xfe400000-0xfe800000] (4MB) mapped at [ffffffc07e400000-ffffffc07e7fffff]
Serial: AMBA PL011 UART driver
ACPI: Added _OSI(Module Device)
ACPI: Added _OSI(Processor Device)
ACPI: Added _OSI(3.0 _SCP Extensions)
ACPI: Added _OSI(Processor Aggregator Device)
ACPI: Interpreter enabled
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20140724/hwxface-580)
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20140724/hwxface-580)
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20140724/hwxface-580)
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S5_] (20140724/hwxface-580)
ACPI: (supports S0)
ACPI: Using GIC for interrupt routing
SCSI subsystem initialized
Switched to clocksource arch_sys_counter
pnp: PnP ACPI init
pnp: PnP ACPI: found 0 devices
NET: Registered protocol family 2
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP: reno registered
UDP hash table entries: 1024 (order: 3, 32768 bytes)
UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
futex hash table entries: 512 (order: 3, 32768 bytes)
fuse init (API version 7.23)
msgmni has been set to 3985
io scheduler noop registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
console [ttySBSA0] enabled
bootconsole [uart0] disabled
ARMH9118:00 supply vdd33a not found, using dummy regulator
ARMH9118:00 supply vddvario not found, using dummy regulator
libphy: smsc911x-mdio: probed
smsc911x ARMH9118:00 eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ARMH9118:00-ffff:01, irq=-1)
smsc911x ARMH9118:00 eth0: MAC Address: 00:02:f7:00:58:7b
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
smsc911x ARMH9118:00 eth0: SMSC911x/921x identified at 0xffffff8000008000, IRQ: 192
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 192.168.0.254, my address is 192.168.0.115
IP-Config: Complete:
 device=eth0, hwaddr=00:02:f7:00:58:7b, ipaddr=192.168.0.115, mask=255.255.255.0, gw=192.168.0.254
 host=192.168.0.115, domain=xora.org.uk, nis-domain=(none)
 bootserver=0.0.0.0, rootserver=192.168.0.10, rootpath=
 nameserver0=8.8.8.8, nameserver1=8.8.4.4
VFS: Mounted root (nfs filesystem) readonly on device 0:13.
Freeing unused kernel memory: 220K (ffffffc0005e6000 - ffffffc00061d000)

Sinclair QL

So recently I have been playing with one of my retro toys the Sinclair QL. This is the strange beasty Sinclair built after the ZX Spectrum, 68008 CPU which is familiar(ish) to Amiga/ST owners.

So far I have a SuperHermes replacement serial/keyboard board fitted. To one machine that allows the use of PC keyboards.

Another machine has the most excellent QL-SD fitted.

Like other Retro platforms there are also new hardware manufacturers appearing like Sandy where one of the first products announced in the new SupraRAM! Waiting for my SupraRAM to use with the QL-SD!

Sandy are for a short time also offering a 40% off their replacement microdrive pads (essential as they tend to turn to dust after 30 years) with the code CRAZY40!

 

CPC 6128 External Drive A Mod

So as a follow on from the last post it turns out the same issue is present on the 6128 classic drive port as well. Another wire link from Pin 4 of internal connector to Pin 25 of external can be made.

Here is a picture of this mod as well.

CPC6128DriveAMod

CPC 6128+ External Drive A Mod

For some reason Amstrad did not route NDSEL0 to the external drive connector so external drive accont be drive A. For me that was an issue as the internal drive on my 6128+ is broken. The fix is relatively easy and is just one wire link. You need to link the internal drive connector Pin 4 to the external drive connector Pin 9.

Here is a photo of the link which shows it in place.

NDSEL0Link

Acorn Electron ROM Cart to Sideways RAM part 2

So I had a rethink about the Sideways RAM and I came to the conclusion that possibly there were some timing issues causing the instability. According to this post on stardot someone had managed to piggy back a SRAM on the internal ROM without the issues I was seeing.

With this information and due to the fact I was using a 62256 (32k x 8) I figured I could actually make the cartridge without the 74HCT139 as ROMQA (Edge-A16) could be connected directly to A14 of the ram chip. /OE (Edge-A2) could be connected to /OE and /CE of the ram chip. R/W (Edge A4) could be connected directly to /WE pin of the ram chip.

The easiest way to to this was to cut the 74HCT139 completely off the board so we can use its VIAS to make the connections. I had to restore the track I had cut on Edge-A4 (Edge-A11 is still not needed). I had to make a couple of new cuts to disconnect the A14 on the ram chip from be wired to Vcc.

Anyway this is the front of the PCB from the new version.

Care PCB Front2

And this is the back of the PCB where the real work with the wire links and cuts occurs.

Care PCB Back2

And just to show this is all working, *ROMS command issued just after switch on.

Care ROMS Blank

*ROMS command issued after loading 2 roms from disk.

Care ROMS Loaded

New welcome screen after break is pressed to initialise the new roms.

Care ROMS Break

And just to check roms are executing code the *HELP +1 command that Pres rom adds.

Care ROMS Pres Help

Im pretty happy with this project now. My only regret is that Edge-B10 is not populated on the cart (as no unused pads are). If so I would have wired it to the spare socket to provide ROM 13 and not wasted a socket.

Acorn Electron ROM Cart to Sideways RAM

Finally I got round to taking some decent photos of my conversion of a CARE Rom Cartridge to Acorn Electron sideways RAM. This is required because for some reason Acorn decided to move the R/W pin around on the cartridge interface.

So here is the front of the PCB + mods

Care PCB Front

You can see the original PIN A11 trace has been cut to allow PIN 4 to be wire linked with it. This wire link is on the back. The wire link you see here connects what used to be pin A4 input to decoding logic to +5V to pull it always high. This used to be the master CS pin which is not present on Electron.

And here is the back of the PCB + mods.

Care PCB Back

Here you can see the pin A4 to where A11 used to enter decoding logic wire link. You can also see the trace cut that used to be the original pin A4 trace.

With these mods the Electron recognises the cartridge as sideways RAM and the Slogger *rload commands work to load roms into these slots. There is however an issue with the images getting corrupted during load. I do not know what causes this. But it has been reported as happening on other sideways RAM projects using Plus 1 cartridge slots.

Chromebook Ubuntu 13.04 Touchpad Fix

This one is nice and simple, to fix the sensitivity of the touchpad back to what you were used to under ChromeOS.

xinput set-prop 7 "Synaptics Finger" 5 5 256

If I could work out where xfce4 keeps its autostart files then I could get this to run at startup.

Chromebook

I blame ‘hrw’ for showing off his Chromebook at Connect, but when I returned to the UK I obtained one.

Running chrome itself is of little interest to me, much more interested in using it as a laptop. So first of all I used ChrUbuntu to get a 12.04 on it. Then I followed hrw’s instructions how to upgrade to 13.04. I messed it up a couple of times but eventually succeeded.

I will say two tips before rebooting, make sure you have ssh server running, and make sure you have a /etc/X11/xorg.conf working. Also if you are doing internal its really helpful to already have a valid install on external SD card you can boot in emergency.

It seems at the moment armsoc Xorg driver prevents suspend by crashing on VT change and then forcing a VT change when it restarts. So if you actually want to use the device you might need to switch to fbdev driver for now!

Very nice little device, I hope more of this sort of low power laptop appear to replace the now killed netbook market.

 

Synaptic Touchpad Configuration LXDE

This is probably not the cleanest or the neatest way to do this but until LXDE gets a synaptic applet of its own its one way to configure your touchpad on login so it functions how you want it.

First create a file $HOME/bin/touchpad.sh with you configuration set using synclient.

#! /bin/sh

synclient TapButton1=1
synclient TapButton2=3
synclient TapButton3=2

And make it executable chmod 755 $HOME/bin/touchpad.sh

Now create a file to autostart this on login $HOME/.config/autostart/touchpad.desktop.

[Desktop Entry]
Name=Touchpad
GenericName=Touchpad Config
Comment=Personal Touchpad Settings
Exec=/home/someone/bin/touchpad.sh
Terminal=false
Type=Application
Icon=xterm
Categories=X11;
StartupNotify=false

This is probably not standards compliant ;-).

Now if you logout and login your touchpad should be configured correctly. If you copied my setting one finger tap for left button, two finger tap for right button, three finger tap for middle button.