LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   Install on a Lemaker Banana Pro (https://www.linuxquestions.org/questions/slackware-arm-108/install-on-a-lemaker-banana-pro-4175545226/)

justwantin 06-13-2015 12:13 AM

Install on a Lemaker Banana Pro
 
I have purchased a Banana Pro.
Code:

U-Boot SPL 2014.10+dfsg1-5 (Apr 07 2015 - 22:00:53)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2


U-Boot 2014.10+dfsg1-5 (Apr 07 2015 - 22:00:53) Allwinner Technology

CPU:  Allwinner A20 (SUN7I)
I2C:  ready
DRAM:  1 GiB
MMC:  SUNXI SD/MMC: 0
In:    serial
Out:  serial
Err:  serial
SCSI:  SUNXI SCSI INIT
Target spinup took 0 ms.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:  dwmac.1c50000
Hit any key to stop autoboot:  0
sun7i#

Having only ever installed Slack on B'Pis from images I am at a bit of a loss as to how to sort out an installation to this board. I have followed the direction provided in the document INSTALL_BANANAPI.TXT but fall over on the final command that boots the installer
Code:

sun7i# bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr} ; reset
Kernel image @ 0x47000000 [ 0x000000 - 0x37eaa8 ]
## Flattened Device Tree blob at 43000000
  Booting using the fdt blob at 0x43000000
  Loading Ramdisk to 4da71000, end 4ffff507 ... OK
  Loading Device Tree to 4da2e000, end 4da70fff ... OK

Starting kernel ...

It hangs on Starting the Kernel. I've re-downloaded everything that goes into /tftpboot/slackware-current. I have gone through the installation proceedure 5 times with the same outcome. U-Boot downlads the dtb blob and zImage fine.
Code:

sun7i# tftp ${fdt_addr} slackwarearm-current/dtb/sun7i-a20-bananapi.dtb ; fdt addr ${fdt_addr} 0x40000
dwmac.1c50000 Waiting for PHY auto negotiation to complete.... done
Speed: 100, full duplex
Using dwmac.1c50000 device
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'slackwarearm-current/dtb/sun7i-a20-bananapi.dtb'.
Load address: 0x43000000
Loading: #####
        3 MiB/s
done
Bytes transferred = 25385 (6329 hex)
sun7i#

Code:

sun7i# tftp ${kernel_addr_r} slackwarearm-current/zImage-armv7
dwmac.1c50000 Waiting for PHY auto negotiation to complete.... done
Speed: 100, full duplex
Using dwmac.1c50000 device
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'slackwarearm-current/zImage-armv7'.
Load address: 0x47000000
Loading: #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #
        3.2 MiB/s
done
Bytes transferred = 3664552 (37eaa8 hex)
sun7i#

However,the initrd-armv7.img download often looks a bit odd.
Code:

        <snipped>
        ################################################################ T#
        <snipped>
        #################################################################
        #######################################################################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################
        2.3 MiB/s
done
Bytes transferred = 39380231 (258e507 hex)
sun7i#

The space and uppercase "T" occur earlier in the output. I have pasted it in above for brevity. The etended line is always in the same place.

Perhaps someone can give me a heads up. With my limited understanding I've run out of ideas to plug into a search engine.

drmozes 06-13-2015 03:13 AM

Quote:

Originally Posted by justwantin (Post 5376443)
I have purchased a Banana Pro.


The Banana Pi and Banana Pi Pro are different machines.
The installation document refers only to the Banana Pi. I've updated it now to make that clear.

Firstly I'd download the latest U-Boot for the Banana Pi Pro and put that on to the SD card.
http://d-i.debian.org/daily-images/a....sdcard.img.gz

Code:

Filename 'slackwarearm-current/dtb/sun7i-a20-bananapi.dtb'.
This would be slackwarearm-current/dtb/sun7i-a20-bananapro.dtb for the Pro.

I've updated the INSTALL_BANANAPI.TXT today to adjust a few bits of U-Boot config to allow the Linux console to be output over the HDMI port. Refresh your -current tree and start again but with the Pro version of U-Boot and using that DTB.
You'll need to adjust all references to sun7i-a20-bananapi.dtb in the installation document but I'm not sure if anything else would need to be adjusted.

Let me know if that works!

justwantin 06-13-2015 03:36 AM

Thank you very much Stuart! :^) I'll have a go at it this evening.

justwantin 06-13-2015 07:14 PM

Quote:

You'll need to adjust all references to sun7i-a20-bananapi.dtb
This is all I would expect to be different in order to boot the installer on the Banana Pro
Code:

sun7i#  tftp ${fdt_addr} slackwarearm-current/dtb/sun7i-a20-bananapro.dtb ; fdt addr ${fdt_addr} 0x40000
However, a try last night and this AM still leaves me hanging
Code:

done
Bytes transferred = 39986976 (2622720 hex)
sunxi# setenv bootargs "${bootcmd_generic} console=ttyS0,115200n8 TERM=screen-256color nodhcp root=/dev/ram rw"
sunxi# bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr} ; reset
Kernel image @ 0x47000000 [ 0x000000 - 0x37ede0 ]
## Flattened Device Tree blob at 43000000
  Booting using the fdt blob at 0x43000000
  Loading Ramdisk to 4d9dd000, end 4ffff720 ... OK
  Loading Device Tree to 4d99a000, end 4d9dcfff ... OK

Starting kernel ...

I hope to find some more time today to work at this.

drmozes 06-14-2015 02:58 AM

Quote:

Originally Posted by justwantin (Post 5376802)
This is all I would expect to be different in order to boot the installer on the Banana Pro
Code:

sun7i#  tftp ${fdt_addr} slackwarearm-current/dtb/sun7i-a20-bananapro.dtb ; fdt addr ${fdt_addr} 0x40000
However, a try last night and this AM still leaves me hanging
Code:

done
Bytes transferred = 39986976 (2622720 hex)
sunxi# setenv bootargs "${bootcmd_generic} console=ttyS0,115200n8 TERM=screen-256color nodhcp root=/dev/ram rw"
sunxi# bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr} ; reset
Kernel image @ 0x47000000 [ 0x000000 - 0x37ede0 ]
## Flattened Device Tree blob at 43000000
  Booting using the fdt blob at 0x43000000
  Loading Ramdisk to 4d9dd000, end 4ffff720 ... OK
  Loading Device Tree to 4d99a000, end 4d9dcfff ... OK

Starting kernel ...

I hope to find some more time today to work at this.

See if you can follow the Debian instructions.
https://wiki.debian.org/InstallingDebianOn/Allwinner

The memory locations are different in the Slackware docs than to the Debian ones, since the Slackware installer is huge. I don't know if those memory locations work for the Pro, but the original and Pro are both A20 so the chances are that they'll work.
You could try using the memory locations from the Debian doc and just boot the Slackware kernel without specifying an initrd. If the kernel at least boots with some output, that's the first piece achieved.

It also could be just because your environment variables have something in them
You could try resetting them to the default and re-configuring following the INSTALL_BANANAPI.TXT. I've just done it and it works on mine:
Code:

env default -a

justwantin 06-14-2015 04:32 AM

I was just going through that Debian page with the intention of doing something like what you are suggesting and I have also downloaded their banana pro installer image to have a look around.
Code:

env default -a
Ah.... so that's it I had been trying to find a command that would delete a single environmental variable. I have been re-writing the SD card instead, silly me!

I have tried several times today with a fresh u-boot each time but it hangs each time. This last time I used dhcp instead of static IP with the same result. After it hung I ran nmap on my "server" and the Pro's assigned IP 192.168.1.15 never came up, tried ping, nada. However, after a reset I could ping the server from the Pro but not the other way around
Code:

sunxi# ping 192.168.1.2                       
Speed: 100, full duplex
Using dwmac.1c50000 device
host 192.168.1.2 is alive
sunxi#


bash-4.3# ping 192.168.1.15
PING 192.168.1.15 (192.168.1.15) 56(84) bytes of data.
From 192.168.1.2 icmp_seq=1 Destination Host Unreachable
<snipped>
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
^C

I'll just keep working at this. I know the card is OK as I have been able to boot a Debian Wheezy Pi/Pro install image. Looks like I'm getting the education I never had. Thanks for your interest and advice

drmozes 06-14-2015 04:39 AM

Quote:

Originally Posted by justwantin (Post 5376923)

Using dwmac.1c50000 device
host 192.168.1.2 is alive
sunxi#

Don't be fooled by this. I spent *ages* looking at the network stuff when I couldn't get it to load the Kernel via tftp. I even swapped out network switches and stuff and started faffing around hard coding the speed of the network port in U-Boot. It seems that when you need to do something from U-boot, it brings up the network stack then tears it down again once it's finished. I don't know if that is what it does, but it seems like it.
Anyway, this has nothing to do with the Kernel not outputting anything.
This issue is usually either due to memory locations, the wrong DTB (shouldn't be that), incorrect console settings or just that it's crashed.
Not having output is a common issue on ARM with which I have many hours of familiarity.
Have you plugged a monitor in to the HDMI port? It should not output anything there but you never know.

Can you paste the output of:

Code:

printenv
Actually it *could* be the DTB. You could try using Debian's kernel and their DTB for the Pro.
When I was getting support working for the Banana Pi, there was a stage where the DTB built with the kernel.org Kernel was incorrect and I had to use another one from elsewhere.
That was fixed a while ago for the Banana Pi but I don't know about the Pro.

justwantin 06-14-2015 04:49 AM

Here we go:
Code:

sunxi# printenv
autoload=no
baudrate=115200
boot_a_script=load ${devtype} ${devnum}:${bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 scsi0 usb0 pxe dhcp
bootcmd=setenv usb_need_init; setenv scsi_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
bootcmd_dhcp=run usb_init; if dhcp ${scriptaddr} boot.scr.uimg; then source ${scriptaddr}; fi
bootcmd_generic=debug earlyprintk sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run usb_init; dhcp; if pxe get; then pxe boot; fi
bootcmd_scsi0=setenv devnum 0; run scsi_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
bootm_size=0x10000000
bootpart=1
console=ttyS0,115200
devnum=0
devtype=scsi
dnsip=192.168.1.1
ethact=dwmac.1c50000
ethaddr=02:c5:04:01:c5:1f
fdt_addr=0x43000000
fdt_addr_r=0x43000000
fdtfile=sun7i-a20-bananapi.dtb
gatewayip=192.168.1.1
ipaddr=192.168.1.15
kernel_addr_r=0x47000000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot; fi
netmask=255.255.255.0
pxefile_addr_r=0x43200000
ramdisk_addr_r=0x48000000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x43100000
scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot; fi
scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi scan; fi
scsi_need_init=false
scsidevs=1
serverip=192.168.1.2
serveripip=192.168.1.2
slkconsole=console=ttyS0,115200n8
stderr=serial
stdin=serial
stdout=serial
usb_boot=run usb_init; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot; fi
usb_init=if ${usb_need_init}; then setenv usb_need_init false; usb start 0; fi
usb_need_init=false

Environment size: 2570/131068 bytes
sunxi# <INTERRUPT>
sunxi#


drmozes 06-14-2015 04:50 AM

Also try removing all of the extra stuff from the boot args. I don't think it's needed at all:

Code:

setenv bootcmd_generic 'debug earlyprintk'
saveenv ; reset


justwantin 06-14-2015 05:00 AM

I just had a go with the DTB from the Wheezy image that booted. No go. I'll go back to default env keep the Wheezy DTB and remove those boot args after I take the bowser for his walk.

Edit:Arghhhhhhhhh... I should have used the kernel too. I'll do it again.

justwantin 06-14-2015 06:51 AM

OK, I did it again this time with both the DTB and kernel from the Wheezy install image /boot directory:
Code:

tftp ${kernel_addr_r} slackwarearm-current/vmlinuz-4.0.5-bananapi
This worked... almost
Code:

sunxi# bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr} ; reset
Kernel image @ 0x47000000 [ 0x000000 - 0x4d5560 ]
## Flattened Device Tree blob at 43000000
  Booting using the fdt blob at 0x43000000
  Loading Ramdisk to 4fb2a000, end 4ffff560 ... OK
  Loading Device Tree to 4fae7000, end 4fb29fff ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

I do not have a monitor hooked up and I'm not sure I should expect much else, I believe the boot process on the install image would also require access to /boot/bin/bananapro.bin

drmozes 06-14-2015 11:06 AM

Quote:

Originally Posted by justwantin (Post 5376952)
[/CODE]
I do not have a monitor hooked up and I'm not sure I should expect much else, I believe the boot process on the install image would also require access to /boot/bin/bananapro.bin

The Kernel does a whole lot more before it gets anywhere near switching in to the root file system, so you'd expect to see the normal boot output and then see it fail when trying to execute init.

If you follow one of the installation documents and install another distribution, do you get any of the Kernel output?

justwantin 06-14-2015 12:52 PM

Yes, I had a monitor hooked up and kernel output with that Wheezy install image but I didn't bother going into the installation proper. I'll get into it again this evening.

Cheers

justwantin 06-19-2015 04:28 AM

I have no trouble at all setting up and using a debian install image that is known to work as per Installing from an SD card image.

I thought I might understand this a little better by trying to create a new image based on the one that works. The original vfat /boot partition was only 54mb which was too small for the original debian sun7i-a20-bananapro.dtb, vImage-armv7 and initrd-armv7.img so I created a larger vfat /boot partition to fit. I modified the original debian boot.scr (as below) and put it back into /boot.

No joy in Mudville, The kernel still does not start, however, u-boot reads the vImage, initrd, and dtb OK (see output below). I haven't quite gotten a handle on how this all goes together. Perhaps the flash-kernel address is (now) incorrect. In any case before I go any further I think I should have a go this weekend at doing up a u-boot, kernel and image from scratch. The only way I ever learn anything is by getting my hands dirty.

boot.scr as modified in plain text:
Code:

# Bootscript using the new unified bootcmd handling
# introduced with u-boot v2014.10

if test -n "${boot_targets}"; then
  echo "Mainline u-boot / new-style environment detected."
else
  echo "Non-mainline u-boot or old-style mainline u-boot detected."
  echo "This boot script uses the unified bootcmd handling of mainline"
  echo "u-boot >=v2014.10, which is not available on your system."
  echo "Please boot the installer manually."
  exit 0
fi

if test -z "${fdtfile}"; then
  echo 'fdtfile environment variable not set. Aborting boot process.'
  exit 0
fi

if test ! -e ${devtype} ${devnum}:${bootpart} dtbs/${fdtfile}; then
  echo "This installer medium does not contain a suitable device-tree file for"
  echo "this system (${fdtfile}). Aborting boot process."
  exit 0
fi

# Some i.MX6-based systems do not encode the baudrate in the console variable
if test "${console}" = "ttymxc0" && test -n "${baudrate}"; then
  setenv console "${console},${baudrate}"
fi

if test -n "${console}"; then
  setenv bootargs "${bootargs} console=${console}"
fi

load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} vImage-armv7 \
&& load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} dtbs/${fdtfile} \
&& load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} initrd-armv7.img \
&& echo "Booting the Debian installer..." \
&& bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}

U-boot output on reset:
Code:

U-Boot 2014.10+dfsg1-5 (Apr 07 2015 - 22:02:59) Allwinner Technology

CPU:  Allwinner A20 (SUN7I)
I2C:  ready
DRAM:  1 GiB
MMC:  SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:  serial
Err:  serial
SCSI:  SUNXI SCSI INIT
Target spinup took 0 ms.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:  dwmac.1c50000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0...
Found U-Boot script /boot.scr
reading /boot.scr
1463 bytes read in 22 ms (64.5 KiB/s)
## Executing script at 43100000
Mainline u-boot / new-style environment detected.
reading zImage-armv7
3665376 bytes read in 193 ms (18.1 MiB/s)
reading dtbs/sun7i-a20-bananapro.dtb
23332 bytes read in 39 ms (584 KiB/s)
reading initrd-armv7.img
39986976 bytes read in 1862 ms (20.5 MiB/s)
Booting the Debian installer...

Kernel image @ 0x42000000 [ 0x000000 - 0x37ede0 ]
## Flattened Device Tree blob at 43000000
  Booting using the fdt blob at 0x43000000
  Loading Ramdisk to 4d9dd000, end 4ffff720 ... OK
  Loading Device Tree to 4d9d4000, end 4d9dcb23 ... OK

Starting kernel ...


drmozes 06-23-2015 08:47 AM

Hi

I had a look through and established that the installation docs work on the original Banana Pi -- they do.
Without having a Pro myself I don't think I can help much more. Normally I play around with a number of things to work out what's wrong, but there's no particular formula that I can describe.


All times are GMT -5. The time now is 03:22 PM.