Open ndoo opened 8 years ago
Thank you for your attention. In general we focus on a kernel which gets support from chip vendors. If chip vendors release a new kernel usually we will catch up with it otherwise we may not do it.
Thanks for the comment. It would bring about a lot of nice things like having updated device tree support.
+1
@friendlyarm is there any word from the chip vendor (Nexell I believe) about when they are going to release a new version?
Supporting 4.x.y on some of your products would be a enormous win.
We just added 4.6.7 and 4.7.2 for H3 based boards, first one is Nanopi Neo: http://www.armbian.com/nanopi-neo/
This issue is specifically referring to linux-3.4.y boards i.e. Nexell boards.
With Nexell I haven't done much of a research yet but moving from "old android kernel" toward recent is a heavy project even for experienced crews, especially if documentation is poor, if we need to face blobs and (c) issues. How far and what was already done, don't know and can't really comment. Out of all dev boards, what is known to me, good mainline support is on: Rpi, most popular Allwinners, some imx6, ... , rk3188, odroid xu4, ... Even Samsung chips have issues on mainline kernel what prevents usage in productive environment, while you can use first three from the list mostly without any serious problems.
Yup, the request is intended to be addressed to FriendlyArm and Nexell to complete the port as vendors of the boards rather than a request for the larger community to unbreak the codebase and forward port :)
Exactly @ndoo. I have attempted to email the contact noted in arch/arm/boot/cpu.c
at Nexell about any possible updates, but I'm not sure if that will work.
It seems to me that someone at @friendlyarm must have a contact at Nexell who can at least provide a timeline.
Have a look here for the latest news: http://www.friendlyarm.com/Forum/viewtopic.php?f=44&t=204&start=10
Nexell:
There will be a 64-bit based linux kernel on S5P6818 and the kernel version will be 3.18 or up. But when will it be released, we don't know exactly. It's under developing. The schedule is at the end of 2016 the 64-bit kernel will be released.
FriendlyARM:
Once we get this support we will arrange its development but we cannot say it for sure exactly we will be able to release it since it depends on various factors
Oh, it's 2017 No new kernel messages
They have totally gave up this project... never an update... 🙁
Il giorno 08 apr 2017, alle ore 16:50, daiaji notifications@github.com ha scritto:
Oh, it's 2017 No new kernel messages
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@spacecdr A good news! I found SamsungARTIK Artik 710 (S5P6818) has available 4.4 ARM64 kernel Metro94 seems to be working on some NanoPi-M3 bootloader and kernel porting 😄
Dear Metro94, dear jensen, dear hmz007 Dear Friendly-arm community,
I would like to use the kernel from the A710/v4.4 branch of https://github.com/SamsungARTIK/linux-artik on the Nanopi-M3. With gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz toolchain from Linaro, I get :
./arch/arm64/boot/dts/nexell/s5p6818-artik710-raptor-rev01.dtb ./arch/arm64/boot/dts/nexell/s5p6818-artik710-explorer.dtb ./arch/arm64/boot/dts/nexell/s5p6818-drone.dtb ./arch/arm64/boot/dts/nexell/s5p6818-artik710-raptor-rev03.dtb ./arch/arm64/boot/dts/nexell/s5p6818-artik710-raptor-rev00.dtb
and 211 modules. (I will see later for the three modules bcmdhd.ko nx_vpu.ko vr.ko, for now, I just need a reasonable recent kernel able to start an android init service or even just a linux elf binary or bash script)
and a image
arch/arm64/boot/Image
Is it possible to load it ?
-with the nanopi2-lollipop-mr1 branch of https://github.com/friendlyarm/uboot_nanopi2.git ?
if not
-with the A710/v2016.01 branch of https://github.com/SamsungARTIK/u-boot-artik.git or the NanoPi_M3 branch of https://github.com/metro94/NanoPi_M3-U-boot.git ?
if not
-with a mixture of NanoPi_M3 branch of https://github.com/metro94/NanoPi_M3-2ndboot.git + one of the previous mentionned uboot
if not
something even more strange ;) ???
What is the current status of Samsung/Nexell/friendlyarm collaboration on these reasonable recents uboot + 64bits-linux/drivers ???
I mean... come on... guys, it's May 2017, Jonathan Corbet announced yesterday on lwn.net
The 4.11.2, 4.10.17, 4.9.29, 4.4.69, and 3.18.54 stable kernel updates have all been released with the usual set of important fixes. Note that this is the final update for the 4.10 kernel.
and Greg KH announced in September 2016 on lwn.net
the 3.14.y LTS kernel series is now end-of-life ...
Please Friendly-Arm, update the wiki and give us a way to have reasonable recent uboot/linux/{ubuntu/android} software !! and not a 32bits 3.4.* kernel thas has already reached it's Projected EOL (https://www.kernel.org/category/releases.html)
We can help, test, debug, but the bare-metal stuff have to be done by friendly-arm / nexell / samsung ...
Thank you all in advance !
Actually we tried code from https://github.com/SamsungARTIK/boot-firmwares-artik710 and https://github.com/SamsungARTIK/u-boot-artik and made an SD card. Unfortunately that SD card couldn't boot our board. We may have to wait for Nexell to release its latest BSP. We can do development based on u-boot-artik and https://github.com/SamsungARTIK/linux-artik but without a workable boot-firmware we cannot boot our board and test an image.
Have you tried this alternative to 2ndboot.bin ?
https://github.com/metro94/s5p6818_bootloader
it boots ...
compiled in DEBUG=1 mode, one gets :
****************************************
* Bootloader for S5P6818 - Version 1.2 *
* Compiled at 22:39:32, May 22 2017 *
****************************************
---------------------------
| Clock | Frequency |
| PLL0 | 1000000000 |
| PLL1 | 1600000000 |
| PLL2 | 1600000000 |
| PLL3 | 1600000000 |
| CPU0 FCLK | 1000000000 |
| CPU0 HCLK | 250000000 |
| CPU1 FCLK | 1000000000 |
| CPU1 HCLK | 250000000 |
| BCLK | 320000000 |
| PCLK | 160000000 |
| MDCLK | 800000000 |
| MCLK | 800000000 |
| MBCLK | 400000000 |
| MPCLK | 200000000 |
| GR3D BCLK | 320000000 |
| GR3D PCLK | 160000000 |
| MPEG BCLK | 266666666 |
| MPEG PCLK | 133333333 |
| DISP BCLK | 266666666 |
| DISP PCLK | 133333333 |
| HDMI PCLK | 100000000 |
| FAST BCLK | 400000000 |
---------------------------
[INFO]I2C Bus is ready
[INFO]Initializing PMIC
[INFO]Trying to initialize DDR3
[INFO]DDR3 ZQ Calibration starts
[INFO]Direct CMD: cmd = 7, chip = 0, bank = 0, addr = 0000
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 2, addr = 0018
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 3, addr = 0000
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 1, addr = 0046
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 0, addr = 1d70
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 0, addr = 1c70
[INFO]Direct CMD: cmd = a, chip = 0, bank = 0, addr = 0000
[INFO]DDR3 H/W Write Leveling starts
[INFO]Direct CMD: cmd = 1, chip = 0, bank = 0, addr = 0000
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 1, addr = 00c6
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 1, addr = 0046
[INFO]DDR3 Gate Leveling starts
[INFO]Direct CMD: cmd = 1, chip = 0, bank = 0, addr = 0000
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 3, addr = 0004
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 3, addr = 0000
[INFO]DDR3 Read Leveling starts
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 3, addr = 0004
[INFO]Direct CMD: cmd = 0, chip = 0, bank = 3, addr = 0000
[INFO]DDR3 Write Latency Calibration starts
[INFO]DDR3 Write DQ Calibration starts
[INFO]Direct CMD: cmd = 1, chip = 0, bank = 0, addr = 0000
[INFO]DDR3 has been initialized
[INFO]DDR3 base addr = 0x40000000, size = 0x40000000
[INFO]Setting DREX QoS
[INFO]Initializing CCI-400 bus
[INFO]Trying to wake up slave CPU
[INFO]CPU1 is ready
[INFO]CPU1 enters wfi
[INFO]CPU2 is ready
[INFO]CPU2 enters wfi
[INFO]CPU3 is ready
[INFO]CPU3 enters wfi
[INFO]CPU4 is ready
[INFO]CPU4 enters wfi
[INFO]CPU5 is ready
[INFO]CPU5 enters wfi
[INFO]CPU6 is ready
[INFO]CPU7 enters wfi
[INFO]SD Card Information:
[INFO]Transport Speed = 25000000
[INFO]Block Size = 512
[INFO]Capacity = 15931539456
[INFO]First Partition Information:
[INFO]Boot Indicator = 00
[INFO]Starting Head = 0
[INFO]Starting Sector = 1
[INFO]Starting Cylinder = 128
[INFO]System ID = 06
[INFO]Ending Head = 03
[INFO]Ending Sector = 16
[INFO]Ending Cylinder = 380
[INFO]Relative Sectors = 2048
[INFO]Total Sectors = 4096
[INFO]FAT Information:
[INFO]Sector Size = 512
[INFO]Sectors Per Cluster = 4
[INFO]Reserved Sectors = 1
[INFO]FAT Table Count = 2
[INFO]FAT Table Sectors = 4
[INFO]Root Maximum Items = 512
[INFO]Hidden Sectors = 2048
[INFO]Total Sectors = 4096
[INFO]FAT Type = FAT12
[INFO]Total Clusters = 1021
[INFO]FAT Table Starting Sector = 2049
[INFO]Root Starting Sector = 2057
[INFO]Data Starting Sector = 2089
Going to 0x0000000043c00000. Good-bye.
I have compiled the bl1 firmware from sources bl-artik710 with BOARD set to DRONE and it works. I have used NSIH based on drone-sd-64.txt file stored in reference-nsih in this project. Below is the script used by me to embed the compiled bl1 and u-boot in SD card. Note that first partition on the SD card should start at 2048 sector. The script should be updated before use, the environment variables with SD device and location of the bl1 and u-boot sources shall be set appropriately.
#!/bin/dash -e
dev=/dev/sde
bl1_dir=bl1-artik710
uboot_dir=u-boot-artik-A710-v2016.01
# bl1 NSIH header
LANG=C LC_ALL=C awk < "$bl1_dir/reference-nsih/drone-sd-64.txt" '
/^E3822080/ { $1 = "E3822C01" } # change reset vector to 0xFFFF0400
/^[0-9A-F]/ { for(i=7; i>0; i-=2) printf "%c", strtonum("0x" substr($1, i, 2)) }
' | dd of="$dev" seek=1
# bl1 boot loader
dd if="$bl1_dir/out/bl1-drone.bin" of="$dev" seek=2
# u-boot NSIH header
LANG=C LC_ALL=C awk 'BEGIN {
for(i = 0; i < 1024; i += 4) {
switch( i ) {
case 0x50: val=0x60000 # load size
break
case 0x58: val=0x43bffc00 # load address
break
case 0x60: val=0x43c00000 # launch address
break
case 0x1f8: val=0x68180300 # version
break
case 0x1fc: val=0x4849534E # "NSIH"
break
default: val=0
break
}
for(j=0; j < 4; ++j) {
printf "%c", val % 256
val = int(val / 256)
}
}
}' | dd of="$dev" seek=64
dd if="$uboot_dir/u-boot.bin" of="$dev" seek=66
sync
The Linux kernel is much more problematic, but I have managed to boot the linux-artik, branch A710v4.4. To be precise, I have entered shell within initial ramdisk, through serial port:
/ # uname -a
Linux S5P6818 4.4.19+ #184 SMP PREEMPT Wed Jun 14 21:10:51 CEST 2017 aarch64 GNU
I have used defconfig for drone, too. To be honest, I don't remember all the changes that I have made in the configuration. As I remember, I have disabled some drivers because they have compilation errors. At least DS1307 driver I have disabled.
There were also some important changes in Linux source code. First change I have made in file head.S (arch/arm64/kernel/head.S). The two lines below should be added somewhere at startup, e.g. in el2_setup:
mov x0, #3 << 20
msr cpacr_el1, x0 /* Enable FP/SIMD at EL1 */
Second change: in file s5p6818.dtsi (arch/arm64/boot/dts/nexell/s5p6818.dtsi) the "psci" device description I have removed (commented out). Otherwise system panics at smc instruction call. I have also removed all "enable-method=psci" from all processor descriptions.
Third change: a bug in axp228-mfd.c file (drivers/mfd/axp228-mfd.c). Below is the patch. The bug causes memory corruption and kernel panic little later. From unknown reason the driver does not find axp228 chip and returns with error. Before return it releases memory, but bad function is used for that.
diff --git a/drivers/mfd/axp228-mfd.c b/drivers/mfd/axp228-mfd.c
index 1d77092..c712977 100644
--- a/drivers/mfd/axp228-mfd.c
+++ b/drivers/mfd/axp228-mfd.c
@@ -1111,7 +1111,7 @@ out_free_irq:
out_free_chip:
i2c_set_clientdata(client, NULL);
- kfree(axp228);
+ devm_kfree(&client->dev, axp228);
return ret;
}
@@ -1121,7 +1121,7 @@ static int axp_mfd_remove(struct i2c_client *client)
struct axp_mfd_chip *chip = i2c_get_clientdata(client);
axp_mfd_remove_subdevs(chip);
- kfree(chip);
+ devm_kfree(&client->dev, chip);
return 0;
}
I got stuck in CPU configuration - the kernel sees only one processor. In dts file the processor "enable-method" is set to "psci", but I don't know how this might work. The smc instruction is disabled at exception level 3 and not intercepted by exception level 2. Even if it would be enabled, the boot loader lacks of handling code.
The bootloader provided by metro94 has one bug in trustzone configuration, but after fix the bootloader works also. It may be used instead of bl1-artik loader. Below is the needed patch:
diff --git a/src/trustzone.c b/src/trustzone.c
index 3ddc5ab..17d7a58 100644
--- a/src/trustzone.c
+++ b/src/trustzone.c
@@ -32,8 +32,9 @@ void set_trustzone(void)
for (index = 0; index < TZPC_NUMBERS; ++index) {
tzpc[index].r0_size = 0x200; // Sets the entire RAM
for (region = 0; region < 4; ++region) {
- tzpc[index].decode_protection[region].clr = 0x00000000;
- tzpc[index].decode_protection[region].set = 0xFFFFFFFF;
+ unsigned toSet = index == 0 && region == 1 ? 0x7f : 0xff;
+ tzpc[index].decode_protection[region].clr = ~toSet;
+ tzpc[index].decode_protection[region].set = toSet;
}
}
Nice work! If you could create/fork all the code (patched code) and the instructions to build it in github would be awesome and kernel developers could try to help trimming this. Anyway i will follow your progress with interest.
Actually I'm trying to work with vanilla kernel 4.11.6. I have some trouble when all 8 cpu's are enabled. System behaves unstable, but with 4 processors seems to work pretty. At least ethernet, display, usb and serial port are working. I'm writing this post from NanoPi with the 64-bit kernel. Device drivers I have moved from Samsung Artik kernel 4.4. Here is my desktop:
Graphics driver is nice, because screen resolution may be changed on the fly. No need to compile kernel to change resolution.
I can upload prebuilt boot loader and kernel image. But work is in progress.
coooool!
rafaello7 notifications@github.com于2017年7月6日周四 03:51写道:
Actually I'm trying to work with vanilla kernel 4.11.6. I have some trouble when all 8 cpu's are enabled. System behaves unstable, but with 4 processors seems to work pretty. At least ethernet, display, usb and serial port are working. I'm writing this post from NanoPi with the 64-bit kernel. Device drivers I have moved from Samsung Artik kernel 4.4. Here is my desktop:
[image: screenshot_2017-07-05_19-30-56] https://user-images.githubusercontent.com/2477169/27881537-8d87cf0e-61b8-11e7-8ace-22630032e7a3.png
Graphics driver is nice, because screen resolution may be changed on the fly. No need to compile kernel to change resolution.
I can upload prebuilt boot loader and kernel image. But work is in progress.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/friendlyarm/linux-3.4.y/issues/3#issuecomment-313208140, or mute the thread https://github.com/notifications/unsubscribe-auth/AARmIHj31O3HbS1BGiqlc7Odd1sn9V5Hks5sK-lOgaJpZM4JJ7vz .
Nice work rafaello7 !!! The best would be to fork on github : bl-artik710 , u-boot, linux-artik so you can push your progress. In that case, we could follow/test/push-request then.
All my work is on github: bl1-nanopi-m3 u-boot-nanopi-m3 linux-nanopi-m3
Additionally I'm using nanopi-load tool to upload images to device through USB port instead of embedding in SD card. But booting from SD card is also possible.
I provide some instructions soon, how to build and run all together. Maybe in README on bl1-nanopi-m3 project.
@rafaello7 coooooool! Can code work on NanoPC-T3?
Yes.
I have added build instructions on bl1-nanopi-m3 page.
Sorry for ignoring the issue of @rafaello7 for a long time. He has made a great progress on it. Actually my NanoPi has been sold, so I'm afraid not to maintain _s5p6818bootloader and _s5pxx18load from now on.
@metro94 no problem ;)
As of Linux 4.11.6, there are stability problems with this kernel when all 8 CPU's are brought up. Kernel boots correctly, but just after boot I'm performing simple test: I'm starting a few "yes" processes:
yes >/dev/null &
yes >/dev/null &
....
Kernel hangs just after 6th process start. I have no idea how to fix the problem. Kernel 4.4 from Samsung Artik does not have the problem, but I have no idea how to find the change that makes difference.
I will try to prepare the Artik v4.4 kernel for NanoPi. Kernel 4.11 goes aside for now.
I have found the problem reason. In fact, these were two reasons: two long extension cables between USB socket on my PC and micro USB cable connected to NanoPi. I think you can guess the rest. After shortening the distance NanoPi seems to work stable with 8 CPU's.
Excellent - that's exciting news!
so back to 4.11 ?
and btw, you can't imagine how much troubles I had with USB and NanopiM3... now I'm powering the NanopiM3 via GPIO and connecting NanopiM3 micro USB port only to one specific USB port on my laptop where I know there is no problem... so I can do adb (Android)
@rafaello7 do you have some details on the graphic driver? For both 4418 and 6818 it should be some kind of nexell chip, right? Any success with DRI/DRM and so on? I'd like to get DRM running with wayland.
@kulamfm: I've connected a 5V, 3A power supply via GPIO, haven't had any trouble with power.
yep I have done the same and now it's ok (it was just not obvious for me at first that connecting micro USB <-> USB + UART <-> USB was not enough)
and different strange behavior : -> micro USB + UART => no boot with certain SDcard, I/O errors on other SD card, ...
so powering via GPIO solved all the old problems but I can't say that I find this solution very "Friendly"
http://www.friendlyarm.com/Forum/viewtopic.php?f=42&t=514 http://www.friendlyarm.com/Forum/viewtopic.php?f=42&t=577
@kulamfm yes, I'm going back to 4.11. I'm testing now the kernel stability - I'm writing this post on NanoPi with kernel 4.11 and 8 CPU's ;) @erazor83 Kernel 4.4 contains Nexell DRM driver which I have moved to 4.11 kernel. It seems to be fully functional DRM driver with /dev/dri/card0 device, xrandr etc. The s5p6818 chip has also 3D GPU compatible with Mali 400. Mali driver is independent from the DRM driver. I haven't moved the Mali driver for now. I'm not sure whether it is worth to move - OpenGL ES has little use on normal Linux (not Android).
@kulamfm can you upload an sd image somewhere, maybe something simple with an X? That'd be great for testing. Did you have a change to test the LCD interface?
@erazor83 : I use an LVDS LCD screen 10.1 inches (16:10) with
for the kernel
diff --git a/arch/arm/configs/nanopi3_android_defconfig b/arch/arm/configs/nanopi3_android_defconfig
index 8dc9fa2b..df3f438c 100644
--- a/arch/arm/configs/nanopi3_android_defconfig
+++ b/arch/arm/configs/nanopi3_android_defconfig
@@ -2138,7 +2138,8 @@ CONFIG_FB0_NXP_DISPOUT=0
# CONFIG_FB1_NXP is not set
CONFIG_NXP_DISPLAY_LCD=y
CONFIG_NXP_DISPLAY_LCD_IN=0
-# CONFIG_NXP_DISPLAY_LVDS is not set
+CONFIG_NXP_DISPLAY_LVDS=y
+CONFIG_NXP_DISPLAY_LVDS_IN=0
# CONFIG_NXP_DISPLAY_MIPI is not set
# CONFIG_NXP_DISPLAY_TVOUT is not set
# CONFIG_NXP_DISPLAY_HDMI is not set
for the flash script the default one https://github.com/friendlyarm/sd-fuse_s5p6818/blob/master/prebuilt/android_env.conf (uboot configuration => linux kernel parameters) with lcd=HD101
and connected to the LVDS interface
http://wiki.friendlyarm.com/wiki/index.php/File:NanoPC-M3-1512B-IF-001.png
and the LVDS LCD is powered independently of the board
never tried the LCD interface
Ok, so I'll have to rebuild at least the kernel and adapt the command line. I'm using the S430 display (+touch) http://wiki.friendlyarm.com/wiki/index.php/LCD-S430/zh
@rafaello7 Do you have some hints on how to compile uboot in 32bit mode?
Building the bl1 worked for me but now I'm stuck with uboot.
Edit: it's probably cos of the ARM8 stuff... I've changed arch/arm/mach-nexell/Kconfig:
config ARCH_S5P6818
bool "Nexell S5P6818 family"
select NEXELL_ARMV7_COMMON
endchoice
It seems to compile fine but has issues with the linking:
ld.bfd: cannot represent machine `aarch64'
make: *** [Makefile:1193: u-boot] Error 1
I haven't compiled it ever in 32-bit mode. For 32-bit I did use only original u-boot from FriendlyArm
It looks wrong "lds" file is copied to u-boot.lds
the lds contained a lot of 64bit stuff so it seems somehow it tried to do 64bit things anyway... can you supply your u-boot-nsih.bin somewhere, that would save me some time for now.
https://drive.google.com/file/d/0B8m_JgFBfEzwcGxrSjRySl9Pcms/view?usp=sharing
I'm trying to prepare release of all the stuff, please be patient. Currently I'm focused on Debian installer. It will be ready in a few days (I hope).
thanks a lot for your efforts!
Also I share compiled 64-bit kernel. https://drive.google.com/file/d/0B8m_JgFBfEzwajlGNFBQN01zZDQ/view?usp=sharing
The tar contents comes from intermediate build of debian package (deb-pkg target). The debian package may be simply built by invoke dpkg-deb -b <dir> from parent directory. The prebuilt kernel will be also available on github, in releases, but I wanted to prepare debian installer first.
I have found today that Artik u-boot reads environment at ~3 MB offset. Three megabytes are reserved for their firmware. I will fix this, but the u-boot.nsih.bin binary referred by the above link requires first partition at 8192 sector at least.
Please try the debian installer ;)
stopping my movie playback and starting to test right now :-)
Looks like it's not booting.
Why cat and not dd for the copy? (tried both btw.)
I got a FAT partition with 3 files, dtb, kernel and initrd - so maybe something in the bootsector is missing?
linux-3.4.y is quite an old release, and the amount of changed lines from upstream kernel is not too much.
Are there plans to work on a newer kernel version? Also it would be great if support for this SoC is upstreamed.