• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoA20 Based pcDuino3/3S/3C/3NanoBSP development for pcDuino3 (V): Enable Dual Core
Previous Next

BSP development for pcDuino3 (V): Enable Dual Core

Posted by: admin , June 29, 2014

From the previous post, we obtain the following kernel boot log:

[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] Architected cp15 timer(s) running at 24.00MHz (virt).
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[    0.000015] Switching to timer-based delay loop
[    0.000283] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[    0.000410] sched_clock: 32 bits at 160MHz, resolution 6ns, wraps every 26843545593ns
[    0.000564] Console: colour dummy device 80x30
[    0.000591] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000605] pid_max: default: 32768 minimum: 301
[    0.000717] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000729] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001275] CPU: Testing write buffer coherency: ok
[    0.001548] /cpus/cpu@0 missing clock-frequency property
[    0.001566] /cpus/cpu@1 missing clock-frequency property
[    0.001577] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.001607] Setting up static identity map for 0x402977b8 - 0x40297810
[    0.002525] CPU1: failed to boot: -38
[    0.002559] Brought up 1 CPUs
[    0.002566] SMP: Total of 1 processors activated.
[    0.002572] CPU: All CPU(s) started in SVC mode.

We can see the following line:

CPU1: failed to boot: -38

Then it shows:

Brought up 1 CPUs

This means that only one core is working. That’s because the PSCI in u-boot is not enabled. What is PSCI?

PSCI is an ARM standard that provides a generic interface that 
 supervisory software can use to manage power in the following 
 situations: 
 - Core idle management 
 - CPU hotplug 
 - big.LITTLE migration models 
 - System shutdown and reset 
 
 It basically allows the kernel to offload these tasks to the firmware, 
 and rely on common kernel side code. 
 
 More importantly, it gives a way to ensure that CPUs enter the kernel 
 at the appropriate exception level (ie HYP mode, to allow the use of 
 the virtualization extensions), even across events like CPUs being 
 powered off/on or suspended. 
 
 The main idea here is to turn some of the existing u-boot code into a 
 separate section that can live in secure RAM (or a reserved page of 
 memory), containing a secure monitor that will implement the PSCI 
 operations. This code will still be alive when u-boot is long gone, 
 hence the need for a piece of memory that will not be touched by the 
 OS. 
 
 This patch series contains 4 parts: 
 - the first four patches are just bug fixes 
 - the next three refactor the HYP/non-secure code to allow relocation 
 in secure memory 
 - the next three contain the generic PSCI code and DT infrastructure 
 - the last three implement the CPU_ON method of the Allwinner A20 (aka sun7i).

The u-boot puhlished by sunxi doesn’t support PSCI. Please download the u-boot from the following github:

$git clone https://github.com/jwrdegoede/u-boot-sunxi.git  -b sunxi-next

Follow the previous post to port the u-boot, and then dd to SD card. Reboot pcDuino3 with this new u-boot, we can find that the error message disappears:

 

U-Boot SPL 2014.04-01537-g257ae94 (Jun 26 2014 - 11:12:14)
Board: Linksprite_pcDuino3
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600
 
 
U-Boot 2014.04-01537-g257ae94 (Jun 26 2014 - 11:12:14) Allwinner Technology
 
CPU:   Allwinner A20 (SUN7I)
Board: Linksprite_pcDuino3
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
 
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
322 bytes read in 16 ms (19.5 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
Speed: 100, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.119
Speed: 100, full duplex
Using dwmac.1c50000 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.119
Filename 'arch/arm/boot/uImage'.
Load address: 0x46000000
Loading: #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################
     196.3 KiB/s
done
Bytes transferred = 8351104 (7f6d80 hex)
Speed: 100, full duplex
Using dwmac.1c50000 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.119
Filename 'arch/arm/boot/dts/sun7i-a20-pcduino3.dtb'.
Load address: 0x49000000
Loading: ##
     158.2 KiB/s
done
Bytes transferred = 21183 (52bf hex)
## Booting kernel from Legacy Image at 46000000 ...
   Image Name:   Linux-3.15.0-rc6-01550-g119918d-
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    8351040 Bytes = 8 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 49000000
   Booting using the fdt blob at 0x49000000
   Loading Kernel Image ... OK
   Using Device Tree in place at 49000000, end 490082be
 
Starting kernel ...
 
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.15.0-rc6-01550-g119918d-dirty (pillar@server) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #24 SMP Thu Jun 26 10:43:34 CST 2014
[    0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: LinkSprite pcDuino V3
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] psci: probing function IDs from device-tree
[    0.000000] PERCPU: Embedded 7 pages/cpu @eefd5000 s6592 r8192 d13888 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait 
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1027336K/1048576K available (4690K kernel code, 193K rwdata, 2116K rodata, 4810K init, 242K bss, 21240K reserved, 270336K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc06adddc   (6808 kB)
[    0.000000]       .init : 0xc06ae000 - 0xc0b609c0   (4811 kB)
[    0.000000]       .data : 0xc0b62000 - 0xc0b926a0   ( 194 kB)
[    0.000000]        .bss : 0xc0b926a8 - 0xc0bcf0b0   ( 243 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] Architected cp15 timer(s) running at 24.00MHz (phys).
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[    0.000015] Switching to timer-based delay loop
[    0.000279] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[    0.000401] sched_clock: 32 bits at 160MHz, resolution 6ns, wraps every 26843545593ns
[    0.000549] Console: colour dummy device 80x30
[    0.000577] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000590] pid_max: default: 32768 minimum: 301
[    0.000696] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000707] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001229] CPU: Testing write buffer coherency: ok
[    0.001484] /cpus/cpu@0 missing clock-frequency property
[    0.001502] /cpus/cpu@1 missing clock-frequency property
[    0.001514] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.001542] Setting up static identity map for 0x404755e0 - 0x40475638
[    0.002634] CPU1: Booted secondary processor
[    0.002677] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.002778] Brought up 2 CPUs
[    0.002796] SMP: Total of 2 processors activated.
[    0.002802] CPU: All CPU(s) started in HYP mode.
[    0.002807] CPU: Virtualization extensions available.
[    0.003357] devtmpfs: initialized
[    0.006972] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[    0.007186] pinctrl core: initialized pinctrl subsystem
[    0.007371] regulator-dummy: no parameters
[    0.011723] NET: Registered protocol family 16
[    0.011986] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.020731] vcc3v0: 3000 mV 
[    0.020888] vcc3v3: 3300 mV 
[    0.021216] pps_core: LinuxPPS API ver. 1 registered
[    0.021224] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.021246] PTP clock support registered
[    0.021923] Switched to clocksource arch_sys_counter
[    0.022192] FS-Cache: Loaded
[    0.022377] CacheFiles: Loaded
[    0.028939] NET: Registered protocol family 2
[    0.029391] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.029470] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.029590] TCP: Hash tables configured (established 8192 bind 8192)
[    0.029662] TCP: reno registered
[    0.029678] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.029730] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.029929] NET: Registered protocol family 1
[    0.030316] RPC: Registered named UNIX socket transport module.
[    0.030330] RPC: Registered udp transport module.
[    0.030336] RPC: Registered tcp transport module.
[    0.030342] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.314857] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.314908] Initialise system trusted keyring
[    0.315351] bounce pool size: 64 pages
[    0.325082] FS-Cache: Netfs 'nfs' registered for caching
[    0.325799] NFS: Registering the id_resolver key type
[    0.325871] Key type id_resolver registered
[    0.325878] Key type id_legacy registered
[    0.325893] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.325900] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.326569] FS-Cache: Netfs 'cifs' registered for caching
[    0.326960] Key type cifs.spnego registered
[    0.327007] Key type cifs.idmap registered
[    0.327169] ntfs: driver 2.1.30 [Flags: R/W].
[    0.327994] FS-Cache: Netfs 'ceph' registered for caching
[    0.328019] ceph: loaded (mds proto 32)
[    0.328945] Key type asymmetric registered
[    0.328958] Asymmetric key parser 'x509' registered
[    0.329220] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.329232] io scheduler noop registered
[    0.329239] io scheduler deadline registered
[    0.329277] io scheduler cfq registered (default)
[    0.331346] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.371293] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.373865] console [ttyS0] disabled
[    0.394022] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[    0.969632] console [ttyS0] enabled
[    0.995007] dw-apb-uart 1c29800.serial: Couldn't set LCR to 0
[    1.001753] dw-apb-uart 1c29800.serial: Couldn't set LCR to 0
[    1.007535] 1c29800.serial: ttyS1 at MMIO 0x1c29800 (irq = 51, base_baud = 1500000) is a U6_16550A
[    1.038400] dw-apb-uart 1c29c00.serial: Couldn't set LCR to 0
[    1.045146] dw-apb-uart 1c29c00.serial: Couldn't set LCR to 0
[    1.050921] 1c29c00.serial: ttyS2 at MMIO 0x1c29c00 (irq = 52, base_baud = 1500000) is a U6_16550A
[    1.061563] stmmaceth 1c50000.ethernet: no regulator found
[    1.067119] stmmaceth 1c50000.ethernet: no reset control found
[    1.072960]  Ring mode enabled
[    1.076012]  No HW DMA feature register supported
[    1.080533]  Normal descriptors
[    1.083862]  TX Checksum insertion supported
[    1.091891] libphy: stmmac: probed
[    1.095329] eth0: PHY ID 02430c54 at 1 IRQ 0 (stmmac-0:01) active
[    1.101748] mousedev: PS/2 mouse device common for all mice
[    1.107597] i2c /dev entries driver
[    1.112985] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.122050] TCP: cubic registered
[    1.125374] NET: Registered protocol family 17
[    1.129962] NET: Registered protocol family 33
[    1.134427] Key type rxrpc registered
[    1.138086] Key type rxrpc_s registered
[    1.143799] sctp: Hash tables configured (established 65536 bind 65536)
[    1.150762] Key type dns_resolver registered
[    1.155056] Key type ceph registered
[    1.158974] libceph: loaded (mon/osd proto 15/24)
[    1.163764] Registering SWP/SWPB emulation handler
[    1.168910] Loading compiled-in X.509 certificates
[    1.181081] Loaded X.509 cert 'Magrathea: Glacier signing key: cc6b77f1515c32d2b4b1365136c9f000545ef48d'
[    1.190586] kAFS: Red Hat AFS client v0.1 registering.
[    1.195802] FS-Cache: Netfs 'afs' registered for caching
[    1.201668] vcc3v3: disabling
[    1.204670] vcc3v0: disabling
[    1.207973] Warning: unable to open an initial console.
[    1.218144] Freeing unused kernel memory: 4808K (c06ae000 - c0b60000)
[    2.592710]  No MAC Management Counters available
 
(none) login:

Now we can check the CPU, and it displays two cores:

 

# cat /proc/cpuinfo 
processor   : 0
model name  : ARMv7 Processor rev 4 (v7l)
Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xc07
CPU revision    : 4
 
processor   : 1
model name  : ARMv7 Processor rev 4 (v7l)
Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xc07
CPU revision    : 4
 
Hardware    : Allwinner sun7i (A20) Family
Revision    : 0000
Serial      : 0000000000000000
# [   62.658321] random: nonblocking pool is initialized
 
#

Tags: A20 Based pcDuino3/3S/3C/3Nano

Share!
Tweet

admin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors