Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raspberry Pi 3 - 64 Bit Operation
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Sun Apr 03, 2016 9:03 am    Post subject: Reply with quote

schorsch_76,

Simple Framebuffer. That it probably works was speculation on the Raspberry Pi forum.

u-boot drives the framebuffer too. That's key for Simple Framebuffer.
Simple Framebuffer requires that something else does any hardware setup that may be required.
It just draws in the existing framebuffer.

I can reproduce your eth0 crashes. You can use
Code:
ifconfig eth0 ....
as long as the cable is not connected.
I'll try a few USB wifi dongles next but I suspect there may be data rate issues with no DMA on the USB port.

Next up, wpa_supplicant. Its installed but I didn't make it a config file.

--- edit ---

With a RTL8188CU wifi, the Pi doesn't hang, it just goes very very slowly, to the point, where you get a stall message.
I was able to switch VTs but not log in.

Running top in one VT and starting wifi with the RTL8188CU wifi in another, then switching back to top didn't help as top was never updated.
net.wlan0 was there though.

Why does networking need dbus? It doesn't on my main box with static /dev and openrc-0.17
The Pi is ~amd64 everything, including openrc and udev.
--- edit ---

I unpacked your compiler to the SDcard. Watching top in another VT convinced me that building on the SDcard card was a very bad idea.
Most of the CPU time was going on driving the SDcard.

boot in on the SD card - it has to be
Everything except distfiles is on rotating rust and distfiles is on a usbstick, because that makes sneakernet easy.

Your compiler is building away at the remains of @system that would not cross compile.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Mon Apr 04, 2016 6:07 am    Post subject: Reply with quote

Team,

in the Raspberry Forum Electron752 got DMA USB and networking to work! There are two patches needed. Today evening i try to setup a github repo for it.
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NoName1337
n00b
n00b


Joined: 30 Mar 2016
Posts: 5

PostPosted: Mon Apr 04, 2016 1:02 pm    Post subject: Reply with quote

The patches posted by Electron752 did not work for me. Git could not apply them, maybe I did something wrong. Dunno.

So I did what git was unable to do, by hand. If somebody got the same problem, here are my git diffs:
dma.patch:
Code:
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h
index ba437f0..491b59e 100644
--- a/arch/arm64/include/asm/dma-mapping.h
+++ b/arch/arm64/include/asm/dma-mapping.h
@@ -19,7 +19,11 @@
 #ifdef __KERNEL__
 
 #include <linux/types.h>
-#include <linux/vmalloc.h>
+#include <linux/scatterlist.h>
+#include <linux/dma-attrs.h>
+#include <linux/dma-debug.h>
+
+#include <asm/memory.h>
 
 #include <xen/xen.h>
 #include <asm/xen/hypervisor.h>
@@ -56,6 +60,83 @@ void arch_teardown_dma_ops(struct device *dev);
 #define arch_teardown_dma_ops   arch_teardown_dma_ops
 #endif
 
+/*
+ * dma_to_pfn/pfn_to_dma/dma_to_virt/virt_to_dma are architecture private
+ * functions used internally by the DMA-mapping API to provide DMA
+ * addresses. They must not be used by drivers.
+ */
+#ifndef __arch_pfn_to_dma
+static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
+{
+   if (dev)
+      pfn -= dev->dma_pfn_offset;
+   return (dma_addr_t)__pfn_to_bus(pfn);
+}
+
+static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
+{
+   unsigned long pfn = __bus_to_pfn(addr);
+
+   if (dev)
+      pfn += dev->dma_pfn_offset;
+
+   return pfn;
+}
+
+static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
+{
+   if (dev) {
+      unsigned long pfn = dma_to_pfn(dev, addr);
+
+      return phys_to_virt(__pfn_to_phys(pfn));
+   }
+
+   return (void *)__bus_to_virt((unsigned long)addr);
+}
+
+static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
+{
+   if (dev)
+      return pfn_to_dma(dev, virt_to_pfn(addr));
+
+   return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
+}
+
+#else
+static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
+{
+   return __arch_pfn_to_dma(dev, pfn);
+}
+
+static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
+{
+   return __arch_dma_to_pfn(dev, addr);
+}
+
+static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
+{
+   return __arch_dma_to_virt(dev, addr);
+}
+
+static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
+{
+   return __arch_virt_to_dma(dev, addr);
+}
+#endif
+
+/* The ARM override for dma_max_pfn() */
+static inline unsigned long dma_max_pfn(struct device *dev)
+{
+   return PHYS_PFN_OFFSET + dma_to_pfn(dev, *dev->dma_mask);
+}
+#define dma_max_pfn(dev) dma_max_pfn(dev)
+
+#define arch_setup_dma_ops arch_setup_dma_ops
+extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
+                struct iommu_ops *iommu, bool coherent);
+
+
+
 /* do not use this function in a driver */
 static inline bool is_device_dma_coherent(struct device *dev)
 {
@@ -66,25 +147,36 @@ static inline bool is_device_dma_coherent(struct device *dev)
 
 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
 {
-   return (dma_addr_t)paddr;
+   unsigned int offset = paddr & ~PAGE_MASK;
+   return pfn_to_dma(dev, __phys_to_pfn(paddr)) + offset;
 }
 
 static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr)
 {
-   return (phys_addr_t)dev_addr;
+   unsigned int offset = dev_addr & ~PAGE_MASK;
+   return __pfn_to_phys(dma_to_pfn(dev, dev_addr)) + offset;
 }
 
 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 {
+   u64 limit, mask;
+
    if (!dev->dma_mask)
-      return false;
+      return 0;
 
-   return addr + size - 1 <= *dev->dma_mask;
-}
+   mask = *dev->dma_mask;
+   limit = (mask + 1) & ~mask;
+   if (limit && size > limit)
+      return 0;
 
-static inline void dma_mark_clean(void *addr, size_t size)
-{
-}
+   if ((addr | (addr + size - 1)) & ~mask)
+      return 0;
+
+   return 1;
+ }
+
+
+static inline void dma_mark_clean(void *addr, size_t size) { }
 
 #endif   /* __KERNEL__ */
 #endif   /* __ASM_DMA_MAPPING_H */
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index 853953c..63b413b 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -160,6 +160,14 @@ static inline void *phys_to_virt(phys_addr_t x)
 
 #endif
 
+#ifndef __virt_to_bus
+#define __virt_to_bus   __virt_to_phys
+#define __bus_to_virt   __phys_to_virt
+#define __pfn_to_bus(x)   __pfn_to_phys(x)
+#define __bus_to_pfn(x)   __phys_to_pfn(x)
+#endif
+
+
 #include <asm-generic/memory_model.h>
 
 #endif
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index a6e757c..5aec6ec 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -208,8 +208,10 @@ static dma_addr_t __swiotlb_map_page(struct device *dev, struct page *page,
 
    dev_addr = swiotlb_map_page(dev, page, offset, size, dir, attrs);
    if (!is_device_dma_coherent(dev))
+        {
+//                dev_err(dev, "Mapping non coherent DMA %08lx\n", dev_addr );
       __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir);
-
+      }
    return dev_addr;
 }
 
@@ -219,8 +221,11 @@ static void __swiotlb_unmap_page(struct device *dev, dma_addr_t dev_addr,
              struct dma_attrs *attrs)
 {
    if (!is_device_dma_coherent(dev))
+        {
+//                dev_err(dev, "Unmapping coherent DMA %08lx\n", dev_addr );
       __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir);
-   swiotlb_unmap_page(dev, dev_addr, size, dir, attrs);
+         }
+        swiotlb_unmap_page(dev, dev_addr, size, dir, attrs);
 }
 
 static int __swiotlb_map_sg_attrs(struct device *dev, struct scatterlist *sgl,

dwc2.patch:
Code:
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 8847c72..26cbd72 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -870,8 +870,7 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
       chan->xfer_dma = urb->dma + urb->actual_length;
 
       /* For non-dword aligned case */
-      if (hsotg->core_params->dma_desc_enable <= 0 &&
-          (chan->xfer_dma & 0x3))
+   if (chan->xfer_dma & 0x3)
          bufptr = (u8 *)urb->buf + urb->actual_length;
    } else {
       chan->xfer_buf = (u8 *)urb->buf + urb->actual_length;
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Mon Apr 04, 2016 6:04 pm    Post subject: Reply with quote

Here is the repositiory with the patches. A pull request for zeldin/marcus_c was created.

Edit: forgot link ;)
https://github.com/schorsch1976/linux/tree/rpi3
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage


Last edited by schorsch_76 on Mon Apr 04, 2016 6:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Mon Apr 04, 2016 6:32 pm    Post subject: Reply with quote

NoName1337,

I had to apply those patches by hand mostly.
Once they are in, they work here.

I'm in the process of testing distcc.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Mon Apr 04, 2016 7:21 pm    Post subject: Reply with quote

Can you use the internal wifi? I copied the firmware to the SD and loaded the module but i cant get the internal wifi to work ...
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Mon Apr 04, 2016 7:46 pm    Post subject: Reply with quote

schorsch_76,

The internal WiFi is connected to the SDCard bus, so I expect its more complex than loading the module and crossing your fingers.
The module needs to know how to find the card.

The two devices have to be multiplexed onto the bus somehow.

I'll try it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NoName1337
n00b
n00b


Joined: 30 Mar 2016
Posts: 5

PostPosted: Mon Apr 04, 2016 8:56 pm    Post subject: Reply with quote

I am not an expert in device tree but to me it looks like wifi & bt are not working because they are not enabled in the device tree.
compare https://github.com/schorsch1976/linux/blob/a0268c31bae854110598fe59022a1d60ef137bcc/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
to https://github.com/raspberrypi/linux/blob/rpi-4.1.y/arch/arm/boot/dts/bcm2710-rpi-3-b.dts

I think zeldin just wanted to create a minimal raspberry pi config to start with. I think once you enable them the kernel will happily enumerate them.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Mon Apr 04, 2016 9:51 pm    Post subject: Reply with quote

NoName1337,

I've come to the same conclusion - that they are not in the device tree.
I'm not sure I share your optimism that they will just work though.
You need to compare the entire tree, thats the .dti files included in the dts files too.

Its too late to test tonight, if it doesn't just work, I will be here all night.
... just one more try.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Tue Apr 05, 2016 6:46 am    Post subject: Reply with quote

swarren on the raspi forum seems to got everything working.
https://www.raspberrypi.org/forums/viewtopic.php?p=945811#p945811
8)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Wed Apr 06, 2016 2:45 pm    Post subject: Reply with quote

Just a note on building the aarch64 gcc with c++ support using the crossdev gcc:

The comand "aarch64-unknown-linux-gnu-emerge -uavDN gcc" succeeds, if you remove both -march and -mtune from your CFLAGS in "/usr/aarch64-unknown-linux-gnu/etc/portage/make.conf".

I have installed it with these USE flags:
Code:
 # cat var/db/pkg/sys-devel/gcc-5.3.0/USE
arm64 cxx elibc_glibc fortran kernel_linux multilib nls nptl openmp sanitize userland_GNU


The only package from @system that I could not emerge was python-3.4, so everything is python-2.7 only right now.

Has anybody succeeded in emerging a python:3 version using gcc-5.3 for arm64?
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Wed Apr 06, 2016 4:17 pm    Post subject: Reply with quote

Yamakuzure,

I got both pythons to cross compile here. I was using the desktop profile with USE=-cxx at the time.

Some C++ things failed for me without CXX defined in make.conf.
Further, CXX needed to paint to the real location, not a symlink to it.

Code:
$ ls /usr/aarch64-unknown-linux-gnu/packages/dev-lang/
python-2.7.11-r2.tbz2  python-exec-2.4.3.tbz2
python-3.4.3-r7.tbz2   spidermonkey-1.8.5-r5.tbz2


Oh, USE=cxx ncurses fails for me to, both cross compile and native.
I'm trying to get all four cores up before I do much more building though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Wed Apr 06, 2016 7:52 pm    Post subject: Reply with quote

I have all four cores going in 64 bit mode with a hybrid of Electron752s boot partition and my own stuff.

I was able to build the stub and u-boot.bin but catting them together always got me the pretty Pi reset screen.
I'm using the borrowed /boot with my kernel Image and my uboot.env.

I'll work out which bit is broken and why later. Meanwhile, the Pi can build Xorg and I'll catch up on some sleep.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Thu Apr 07, 2016 6:38 am    Post subject: Reply with quote

NeddySeagoon wrote:
I have all four cores going in 64 bit mode with a hybrid of Electron752s boot partition and my own stuff.

I was able to build the stub and u-boot.bin but catting them together always got me the pretty Pi reset screen.
I'm using the borrowed /boot with my kernel Image and my uboot.env.

I'll work out which bit is broken and why later. Meanwhile, the Pi can build Xorg and I'll catch up on some sleep.
Does that mean we do not have to build U-Boot on our own, then?
Just replace the kernel (and bcm2837-rpi-3-b.dtb) ?

btw: You have to add "avoid_warnings=2" to config.txt if you activated VC4 in the kernel .config.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Thu Apr 07, 2016 7:53 am    Post subject: Reply with quote

Hmmm... All that I get is an immediate autoboot (uEnv.txt is not heeded) and U-Boot displays rows of dots. ctrl-C is recognized, but it does not stop.

Where is my thinking error? How can I disable autoboot? I tried with the Electron752 boot partition, but renamed boot.scr.uimg to boot.scr.uimg.bak.

Update 1 : The moment the screen comes online the autoboot counter is at zero (should have at least 2 seconds) and the "dot parade" starts.

Update 2 : I tried to use the image from Electrons fork (recompiled from his tree) and the swarren U-Boot, but, no matter with or without the stub, I only get a colourful screen. Is that the "pretty Pi reset screen" you mentioned, Neddy?

Update 3 : When I use the Electron boot partition without *any* changes, it works.

Update 4 : Hmmm... removing the framebuffers to use VC4 only does not work... Although it comes with KMS. But the Simple Framebuffer garbles the display.

Update 5 : No, it was CONFIG_FB_BCM2708 that had to be disabled. But at some point when booting, the display just shuts off. (and both /var/log/dmesg and /var/log/messages are empty. :-( so I do not know exactly where and when...)
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Thu Apr 07, 2016 4:49 pm    Post subject: Reply with quote

Yamakuzure,

I use the Electron752 boot partition with my udev.env and my kernel.

The Electron752 boot partition works here but gives me a screen resolution I can't use on a 27" display.
There is probably a bootargs to fix that but I want to understand what I'm doing wrong.

The colourful reset screen is the ARM part of the Pi doing nothing. The GPU has started, attempted to hand off to the ARM and something has not worked.
My expanded /boot contains

Code:
Image                   2016-04-07 16:17  7.9M 
My Simple Framebuffer kernel.
Code:
bcm2837-rpi-3-b.dtb
from Electron752s /boot image.
Code:
u-boot-stubbed.bin
from Electron752s /boot image.
Code:
config.txt
read by the GPU boot code to know how to set up tho ARM side. Mine doesn't work ... even when it contains the idenical active content to that file. That's from Electron752s /boot.
Code:
uboot.env
My uboot setup. It puts root on /dev/sda1.
While you can see the whole boot sequence on the console, my uboot.env only listens for input on the serial port.
You can see the wait but not stop the auto boot without a working serial port.

Renaming uboot.env, so its not found will stop the auto boot. Its CRC protected, so you can't edit it, except from within uboot.

-- edit --

There is some junk there from flashing the ROM in an HP Microserver and fixing the idle3 timeout on some WD Greens.
I tried to remove it but I may have missed a few odds and ends.
As far as I know, that's all the user adjustable files in /boot.

Hmm
Code:
boot.scr.uimg
is a binary file that contains some visible u-boot commands. I don't know what that does.
I'm not using it anyway as my SDCard has no root filesystem and id appears to put root on the SDcard.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Thu Apr 07, 2016 6:38 pm    Post subject: Reply with quote

I try to rebuild that all too. I dislike not being able to build it ;)
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://github.com/schorsch1976/portage
git clone https://github.com/schorsch1976/portage
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Fri Apr 08, 2016 6:51 am    Post subject: Reply with quote

merged below
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.


Last edited by Yamakuzure on Fri Apr 08, 2016 10:47 am; edited 1 time in total
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Fri Apr 08, 2016 7:55 am    Post subject: Reply with quote

merged below
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.


Last edited by Yamakuzure on Fri Apr 08, 2016 10:47 am; edited 1 time in total
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Fri Apr 08, 2016 10:17 am    Post subject: Reply with quote

(merge and edit of my latest three posts)


Update : It seems that Electron752 has gone ahead of Zeldin, and that the copy of the bcm2837-rpi-3-b.dts file is no longer needed!

Update : Eric Anholt wrote here, that SDHOST would give better MMC performance than SDHCI, so I switched from dtoverlay=mmc to dtoverlay=sdhost.


To make use of VC4 and have a native resolution on my monitor, I did the following: (No X, yet, just the console to start with, and that is on Simple Framebuffer!)

  • Clone Electron boot partition and use it:
    Code:
     # git clone --depth 1 https://github.com/Electron752/boot64-rpi3.git
     # cp -ruf boot64-rpi3/ /usr/aarch64-unknown-linux-gnu/boot/
  • Clone Electron sources (git clone --depth 1 -b rpi-4.5.y+rpi364 https://github.com/Electron752/linux linux-electron)
  • (no longer needed (?))clone rpi3 branch of the zeldin sources ([i]git clone --depth 1 -b rpi3 https://github.com/zeldin/linux.git linux-zeldin)[/i]
  • (no longer needed (?))copy over arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts from latest zeldin rpi3 branch into the electron sources to add the spinning table feature
  • ln -s linux-electron linux && cd linux
  • Create the default config and edit it:
    Code:
     # make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- bcmrpi3_defconfig
     # make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- menuconfig
    Adapt as you see fit. The important parts are:
    Code:
    Device Drivers --->
      Graphics Support --->
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
          [*]   Enable legacy fbdev support for your modesetting driver
        <*> Broadcom VC4 Graphics
        Frame buffer Devices  --->
          < > BCM2708 framebuffer support
          [*] Simple framebuffer support
    I have posted my full diff at pastebin.
  • Compile and copy the kernel and modules like this: (I have 8 cores, adapt the -j 17 if you have less or more)
    Code:
     # make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- INSTALL_MOD_PATH=/usr/aarch64-unknown-linux-gnu -j17 all
     # make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- INSTALL_MOD_PATH=/usr/aarch64-unknown-linux-gnu -j17 modules_install
     # make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- INSTALL_MOD_PATH=/usr/aarch64-unknown-linux-gnu -j17 firmware_install
     # cp -uv arch/arm64/boot/Image /usr/aarch64-unknown-linux-gnu/boot/
     # cp -uv arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dtb /usr/aarch64-unknown-linux-gnu/boot/
  • My cmdLine.txt is this:
    Code:
     # cat /usr/aarch64-unknown-linux-gnu/boot/cmdline.txt
    console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes cma=256M@512M rootwait
  • config.txt needs some adaptions:
    Code:
    # cat /usr/aarch64-unknown-linux-gnu/boot/config.txt
    enable_uart=1
    arm_control=0x200
    kernel_old=1
    kernel=u-boot-stubbed.bin
    disable_commandline_tags=1

    # Device Tree (dt) Parameters with VC4
    dtparam=watchdog=on,i2c=on,i2c_vc=on,act_led_trigger=mmc

    # Use the BCM2835 SDHOST MMC driver
    dtoverlay=sdhost

    # VC4 parts:
    mask_gpu_interrupt0=0x400   # VPU shouldn't handle V3D interrupts
    avoid_warnings=2            # VPU shouldn't smash our display setup.
    dtoverlay=vc4-kms-v3d       # Enable Eric Anholt's DRM VC4 HDMI/HVS/V3D driver.
    Well, actually the dtoverlay=mmc is not needed, but it seems to improve speed. And the important part in the dtparam line, as far as I understood it, is to activate i2c_vc.
    You can read about the parameters in /boot/overlays/README.
  • The U-Boot config is just like Neddy posted, but with console=tty0 and without the cma part. The bcm2837-rpi-3-b.dtb image is still neede for the framebuffer to work, apart from other things.
  • Comment the serial console in /etc/inittab, or you will never see a login prompt.

_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.


Last edited by Yamakuzure on Wed Apr 13, 2016 1:46 pm; edited 3 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Sun Apr 10, 2016 10:01 am    Post subject: Reply with quote

I'm not around much this weekend so I thought I would leave the Pi3 doing something.

emerge firefox fails as one of the dependencies wants windows.h

emerge libreoffice looks promising. There is lots of stuff to keyword but it all just build up to libreoffice itself.
That's only just started.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Mon Apr 11, 2016 10:06 am    Post subject: Reply with quote

I let "emerge --emptytree @system" run through the weekend.
Some stuff failed abysmally like binutils, m4, gettext...
The reason: I was too enthusiastic and cleaned /usr/aarch64-unknown-linux-gnu prematurely. :roll:

After restoring the symlinks in there the builds go through just fine. I have a true native gcc (including g++) now. :-D

btw: I did the whole thing with the RPi2 already, and both firefox and libreoffice built fine on it using distcc.

Edith wants to "AAAArrghhh!": It is very idiotic to _not_ check your make.conf before doing anything from within the PI. I still had ROOT set to /usr/$CHOST ... :roll:
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47142
Location: 56N 3W

PostPosted: Tue Apr 12, 2016 6:03 pm    Post subject: Reply with quote

In the end, libre-office broke.

It started off well with distcc working away. Then remote builds began to fail and were repeated successfully locally.
Eventually it stopped even trying to distribute, then it locked up with nothing useful in the logs.

The build log was 1.7G. On AMD64, it complete at just over 2.0G.

I suspect an issue with the network and root filesystem both being on USB, rather than libre-office itself.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Wed Apr 13, 2016 8:30 am    Post subject: Reply with quote

You can try to continue the build with something like
Code:
ebuild /usr/portage/app-office/libreoffice/libreoffice-5.1.2.2.ebuild merge
several times until only the real problem is left over.

If you had problems with distcc and/or the network, it might be the case that something was not finished that was needed by another part; which would fail then.

On my machine a deep update of @world just finished. 'eix' reports that 348 packages are now installed.
I'll be searching for how to enable the VC4 gallium driver next.

And now to something completely different:
I am very happy to confirm that CONFIG_CLEANCACHE, CONFIG_FRONTSWAP, CONFIG_ZBUD, CONFIG_ZSMALLOC and ZRAM (with ZRAM_LZ4_COMPRESS) all work well. I have a zram swap with 1.5GB, set up with the help from sys-block/zram-init-3.6 and it works like a charm!
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2277
Location: Bardowick, Germany

PostPosted: Wed Apr 13, 2016 2:36 pm    Post subject: Reply with quote

I have added media-libs/mesa-9999 to my overlay (seden) which includes VIDEO_CARDS="vc4" support.
(I have reopened "Bug 559144 - media-libs/mesa - Add vc4 to VIDEO_CARDS for Broadcom and Raspberry Pi ARM processors" for possible official support in the portage tree.)

Once my current kernel build is finished (current Electron752 sources have many updates!) I'll see whether I can make it work.

Update: My mesa-9999 ebuild went through just fine with enabled vc4 gallium driver.
; However, even the oldest stable media-libs/mesa-10.3.7-r1 has the vc4 gallium driver available.
So maybe we do not *have* to use a live ebuild after all.

And further: from inside the RPi3 sys-fs/eudev built just fine!

Update: Switching from dtoverlay=mmc to dtoverlay=sdhost in /boot/config.txt did wonders!
While emerging something I can now switch to another console and the keyboard works without delay. It was impossible to do anything with the MMC SDHCI driver.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.


Last edited by Yamakuzure on Thu Apr 14, 2016 7:43 am; edited 6 times in total
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 3 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum