Re: Banana Pi R1 - Fedora 22 Kernel, image and tools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 21-08-15 11:09, mo.ucina wrote:
Thanks for that Gerhard,

Speaking of u-boot , I had sent an email a few days ago to Igor Pecovnik , who
is the Debian ARM developer . He has been patching the Debian source for the
BananaPi R1 for a while now , and maintains the R1 patches and scripts and dts .
My question was if he could submit those (lamobo R1)  BananaPi R1 patches for
the dts back to Denx . That way they would be in the mainline and the benefit is
that all Distros would have access to them not just Debian . Also it would be
less work for him maintaining the patches with every release of u-boot . He and
Tomas Kaiser went through the exercise of fine tuning the GMAC_TX_DELAY
specifically for the R1 to improve the Ethernet throughput .This parameter is
there to compensate for the physical board layout , length of tracks etc. . They
arrived at the setting of 4 compared with generic bananapi setting of 3 .

Upstream u-boot sunxi / allwinner support maintainer here. I would love to
see BPI R1 defconfig + dts get submitted upstream officially, I will
happily merge them in u-boot and I'm sure the kernel devs will take the
dts too, assuming it passes review.

But it seems lots of people are working on the BPI R1, but no-one is
submitting patches upstream :|

Regards,

Hans




Best Regards
Milorad


On 21/08/15 04:38, Gerhard Wiesinger wrote:
Hello Milorad,

Had to adapt the command line a little bit but works now, see below. I also
think you missed a ; after make in the line below.
Updated the script also for cleanup and multiple invocations and output
versioning (see below).

dnf install git gcc

CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE" LDFLAGS="-L
$SRCDIR/libnl-tiny/src" make cli.o swlib.o; cc -L $SRCDIR/libnl-tiny/src -o
swconfig cli.o swlib.o -lnl-tiny -ldl

Also installed the LED service, but it is only for one CPU (e.g. cpu0, cpu1 is
not handled)...
I'm currently not physically at the Banana so I can't verify it now ...

Uboot is currently compiling ...
There are also newer versions available:
ftp://ftp.denx.de/pub/u-boot/

Ciao,
Gerhard

#!/bin/bash
# This script is used to compile 'swconfig' for the BPI-R1 based on the
OpenWrt sources.
# Big thanks to mattrix and x4711 from the LeMaker forum who discovered this
procedure.

# Requires : lua-devel cmake lua git
# Requires2: dnf install git gcc
git clone https://github.com/Bananian/openwrt.git
pushd .
cd openwrt
git pull
popd

# cp openwrt/target/linux/generic/files/include/uapi/linux/switch.h
/usr/include/linux/switch.h
\cp -f openwrt/target/linux/generic/files/include/uapi/linux/switch.h
/usr/include/linux/switch.h

chmod 644 /usr/include/linux/switch.h

rm -f swconfig
rm -f libnl-tiny
ln -s openwrt/package/network/config/swconfig/src swconfig
ln -s openwrt/package/libs/libnl-tiny libnl-tiny
SRCDIR=`pwd`

cd $SRCDIR/libnl-tiny/src
#rm libnl-tiny.so
rm -f *.o libnl-tiny.so libnl-tiny.a
make
ar rcs libnl-tiny.a nl.o handlers.o msg.o attr.o cache.o cache_mngt.o object.o
socket.o error.o genl.o genl_family.o genl_ctrl.o genl_mngt.o unl.o

cp -f libnl-tiny.so /lib
cp -f libnl-tiny.so $SRCDIR/libnl-tiny.so.`date +%Y.%m.%d.%H.%M.%S`

cd $SRCDIR/swconfig
rm -f *.o swconfig
#CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE" LDFLAGS="-L
$SRCDIR/libnl-tiny/src" make cc -L $SRCDIR/libnl-tiny/src -o swconfig cli.o
swlib.o -lnl-tiny -ldl
CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE" LDFLAGS="-L
$SRCDIR/libnl-tiny/src" make cli.o swlib.o; cc -L $SRCDIR/libnl-tiny/src -o
swconfig cli.o swlib.o -lnl-tiny -ldl

cp -f swconfig /usr/local/bin
cp -f swconfig $SRCDIR/swconfig.`date +%Y.%m.%d.%H.%M.%S`


On 17.08.2015 15:29, OM Ugarcina wrote:
Not really , it is that I just got all the services and apps configured and
working : Avahi, cups, radius, Apache, squid, firewall, dhcp, DNS, PPPoE.
Would want to see if the fc22 versions were really that much newer . Also
would hate to brake something . But have been thinking about doing a yum
upgrade . F2fs is really developed for sdcards and flash storage . It works
well with different internal geometries used with flash devices and their
block sizes . It is being developed by Samsung . Check this article which
looks into how to get the best out of a sdcard  :

https://blogofterje.wordpress.com/2012/01/14/optimizing-fs-on-sd-card/

And the reason for f2fs is to do this optimized approach automatically.

Best Regards

O&M Ugarcina

On 17 Aug 2015, at 11:03 pm, Gerhard Wiesinger <gerhard@xxxxxxxxxxxxx> wrote:

Hello Milorad,

Thanx. Any reason not to update to fc22?

Any advantage from f2fs over xfs (which is the default fedora image I used)?

All my x64 systems and also banana work well with fc22.

Ciaom
Gerhard


On 17.08.2015 15:00, OM Ugarcina wrote:
Hello Gerhard,

My system is mostly fc21 but with latest fc22 kernel and fc23 uboot and
using f2fs file system . The system will probably stay mostly like that ,
but I will keep updating important packages if security warrants or if
there is a great feature . Hans is :

https://github.com/jwr*degoede*
*
*
*
*

Best Regards

Milorad

On 17 Aug 2015, at 9:40 pm, Gerhard Wiesinger <gerhard@xxxxxxxxxxxxx> wrote:

BTW: are you already on FC22?

Ciao,
Gerhard

On 17.08.2015 13:01, mo.ucina wrote:
Sounds Good,

Here is the kernel src rpm :

*http://tinyurl.com/pwnctea*


that error looks like a missing dependency , you will need to install an
equivalent of glibc-headers for arm on the machine . Technically the
switch is an 8 port device , and WAN port is wired internally to port 3 .
I would have thought that all ports would behave similarly . But anyway
it is purely  a cosmetic thing .

Not much activity on the R1 with the Fedora users at the moment . There
is a bit of work being done by sunxi with the u-boot people , and there
have been patches submitted for a separate Lamobo R1 (that is probably
going to be the official name for our router) but they have not made it
in yet . I think probably due to maintenance ownership , no one wanted to
sign up for it . So Hans is probably sitting on the patches and not
putting them in .

I have installed the latest u-boot 2015-07 with the latest code additions .
You can see it here :

https://lists.fedoraproject.org/pipermail/arm/2015-June/009582.html

On 17/08/15 19:50, Gerhard Wiesinger wrote:
Hello Milorad,

Thank you for the information.

I had to define the cross compile flags as I compiled on a x64 machine
because I had no network connectivity at the beginning.
# Yours/mine:
rpmbuild -ba --target armv7hl --without=perf --without=debuginfo
--without=pae --define="_arch arm" --define="_build_arch arm" kernel.spec
rpmbuild -ba --target armv7hl --without=perf --without=debuginfo
--without=pae --define="_arch arm" --define="_build_arch arm"
--define="_with_cross 1" --define="_without_tools 1" kernel.spec

I had the following compile errors without the "_without_tools" defines:
+ make CROSS_COMPILE=arm-linux-gnu-
arm-linux-gnu-gcc -O1 -Wall -Wshadow -W -Wformat
-Wimplicit-function-declaration -Wimplicit-int -fstack-protector -D
VERSION=\"1.0\"   -c -o tmon.o tmon.c
tmon.c:19:20: fatal error: getopt.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'tmon.o' failed
make: *** [tmon.o] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.SJeffm (%build)

So I decided to to disable the tools. Will try to compile also directly
on the Banana. But at that time I had no network connectivity and
therefore it was really annoying to work directly there. But now Banana
is in production and I will try in the future to compile.

OK, you are having the same issue on the LED. I guess it can be software
controlled, too (it works well as it toggles on startup).

Information from the chinese seller:
dear Gerhard,
the R1 is a router, this port is the ADSL port,
it is different from the other 4 ports,
the status is common, it is not a quality problem, dear friend!

I think we should stay in contact and share information as we find
something new regarding Banana and Fedora.

Any active community around Fedora on Banana (Forum/mailing lists)?

BTW: any information of the sources of the Allwinner A20 uboot?
BTW2: Do you know a source of the schematic of the Banana Pi-R (I only
found other versions).

Thank you.

Ciao,
Gerhard


On 17.08.2015 11:25, mo.ucina wrote:
Hello Gerhard,

I use the banana hardware to compile the kernel , it is slow but works
always 100% . I used to get funny issues when trying to cross compile .
SO now I just kick off a compile before going to bed , and in the
morning it is done . My compile line is :

rpmbuild -ba --target armv7hl --without=perf --without=debuginfo
--without=pae --define="_arch arm" --define="_build_arch arm" kernel.spec

My swconfig comes from this script :

#!/bin/bash
# This script is used to compile 'swconfig' for the BPI-R1 based on the
OpenWrt sources.
# Big thanks to mattrix and x4711 from the LeMaker forum who discovered
this procedure.

# Requires : lua-devel cmake lua git
git clone https://github.com/Bananian/openwrt.git

cp openwrt/target/linux/generic/files/include/uapi/linux/switch.h
/usr/include/linux/switch.h
chmod 644 /usr/include/linux/switch.h

ln -s openwrt/package/network/config/swconfig/src swconfig
ln -s openwrt/package/libs/libnl-tiny libnl-tiny
SRCDIR=`pwd`

cd $SRCDIR/libnl-tiny/src
make
rm libnl-tiny.so
ar rcs libnl-tiny.a nl.o handlers.o msg.o attr.o cache.o cache_mngt.o
object.o socket.o error.o genl.o genl_family.o genl_ctrl.o genl_mngt.o
unl.o

cd $SRCDIR/swconfig
CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE" LDFLAGS="-L
$SRCDIR/libnl-tiny/src" make cc -L $SRCDIR/libnl-tiny/src -o swconfig
cli.o swlib.o -lnl-tiny -ldl


The led on the WAN port is always on - for some reason , even with
drivers , irrespective of the cable being in or out . I am not using
the hdmi , my board is acting purely as a wired router . I have defined
two interfaces with different subnets , one for in , the other for out
. Because the board has just one NIC , the interfaces need to be done
with vlans . And I connect to it via ssh . One interesting thing that I
have borrowed form the ubuntu people is using the green LED indicator
for indicating activity , in my case CPU activity , but can be used
instead for others as well . I have set it up as a service :

cat /etc/systemd/system/led.service
[Unit]
Description=Assign LED Function

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 'cpu0' >
/sys/class/leds/bananapi\:green\:usr/trigger"

[Install]
WantedBy=multi-user.target


I will send you the link to the src rpm with switch drivers .


Best Regards

Milorad

Melbourne/AUstralia



On 17/08/15 16:05, Gerhard Wiesinger wrote:
Hello Milorad,

Great, thank you for the answers. Some comments and questions below.

1.) Ad kernel
In the meantime I got a working kernel, you can find it on
https://www.wiesinger.com/opensource/fedora/kernel/BananaPi-R1/
I integrated 2 patches, the dmesg spamming patch and the switch patch.
Can you also post the SRPM on a cloud service like Google
Drive/Dropbox, etc.

BTW: What's your command line compiling the kernel?
I had to disable the tools to get compile done.
rpmbuild -ba --target armv7hl --without=perf --without=debuginfo
--without=pae --define="_arch arm" --define="_build_arch arm"
--define="_with_cross 1" --define="_without_tools 1" kernel.spec

2.) swconfig
Where did you find the instructions for compiling swconfig? (The
Ubuntu version works well).

3.) LEDs
Can you try the following: No connection at the uplink port. Is one
the LED always on like in the picture from my previous email?
It already is on when the uboot comes up.

Except the uplink port LEDs look ok to me

4.) Regarding Display & console:
Does full HD work for you?
Currently I boot into normal console login only.

I don't see any service startup messages at the screen but maybe they
go into the serial console. Any hint?

Thank you.

BTW: I'm from Austria/Vienna, where are you from?

Ciao,
Gerhard


On 17.08.2015 07:49, OM Ugarcina wrote:
Hello Gerhard,

The kernel that comes from the fedora image will not have the switch
driver in it , so it is normal that the networking does not work out
of the box . That is also the reason why the swconfig utility is not
seeing anything yet . I compiled the swconfig utility from sources
using the ubuntu-bananian instructions . The one you copied from
ubuntu should work just as well . Once you  have the switch drivers
the LEDs will start blinking when data is going , but I am still not
sure if they are working perfectly 100 % . The LED colours when it
comes to link speed look odd to me .

If your are in a position to compile the kernel I have a src rpm for
you . It is a bit big , about 80 Mb , if you have an FTP server I can
uploaded for you .

The kernel devs at Fedora are still not including the drivers for the
switch because of a few issues to do with missing APIs which need to
be agreed on . The driver that I use comes from open-wrt and uses
their approach which works very well .

Best Regards
Milorad


On Thu, Aug 13, 2015 at 7:16 PM, Gerhard Wiesinger
<gerhard@xxxxxxxxxxxxx> wrote:

    Hello Milorad,

    Got my Banana Pi R1 yesterday but it doesn't work out of the box :-(
    fedora-arm-image-installer
    --image=Fedora-Server-armhfp-22-3-sda.raw.xz --target=Bananapi
    --media=/dev/sdi --selinux=OFF --norootpass -y
    It boots well but as you wrote the BCM53125 is not found.
    https://lists.fedoraproject.org/pipermail/arm/2015-June/009544.html
    Do you also have a version for Fedora 22 available (or a complete
    source RPM package).

    Any hints for a better working Fedora image or a maintained
    kernel repository?

    BTW: Where did you get the swconfig utility? Currently I'm using
    a copy of the Ubuntu version which works well but no switch is found.

    BTW2: This patch is also important:
    http://forum.armbian.com/index.php/topic/111-dmesg-spmmed-by-clocksource-hstimer-mask-0xffffffff-max-cycles-0xffffffff-max-idle-ns-238907555784-ns/
    http://permalink.gmane.org/gmane.comp.hardware.netbook.arm.sunxi/17500
    https://git.kernel.org/cgit/linux/kernel/git/arm/arm-soc.git/commit/?h=next/dt&id=2186df37831a8bb259bbf2ae07356747a03d0b8d

    BTW3: Is it normal that the LED is always on the uplink port, see
    image attached?

    Thank you.

    Ciao,
    Gerhard












_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm

_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM (Vger)]     [Linux ARM]     [ARM Kernel]     [Fedora User Discussion]     [Older Fedora Users Discussion]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Maintainers]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [Linux Apps]     [KDE Users]     [Fedora Tools]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

Powered by Linux