Giter VIP home page Giter VIP logo

bpi-r2-bsp's Introduction

BPI R2 BSP

Overview

This project is for banana-pi R2 board, including U-boot and Linux Kernel 4.4.x.

Getting started

  1. Downloading Ubuntu 16.04 image for R2 board from http://www.banana-pi.org/r2-download.html
  2. Running below command to burn this image to SD card which must be larger than 8GB
		dd if=\<image file\> of=/dev/mmcblk0
  1. Install this SD to R2 board
  2. Press power button a few seconds to activate this board. The default baud rate of serial port is 115200, the default username/password are root/bananapi

How to build both U-boot and Linux kernel

To build this project, the following packages are required:

	gcc-arm-linux-gnueabihf 
	u-boot-tools
  1. Clone this code to a host PC on which the Ubuntu 16.04 is installed
  2. Run script build.sh
	./build.sh
  1. Select 1 to build both uboot and kernel
  2. Both new uboot and kernel will be generated in folder SD when it completes

How to update both u-boot and Linux kernel

If you don't have tools for banana-pi products, please run below commands to install them:

	apt-get install pv
	curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
  1. Install SD card to this host PC, please ensure Ubuntu 16.04 R2 image is installed on this SD card
  2. Enter folder SD which is generated after building
  3. Run below command to update u-boot and Linux kernel
	bpi-update -c bpi-r2.conf
  1. After it completes, move SD to R2 board
  2. Press power button to activate this board

bpi-r2-bsp's People

Contributors

androidbftab1 avatar bpi-sinovoip avatar garywangbpi avatar garywangcn avatar jackzengbpi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpi-r2-bsp's Issues

uart0/1 TX not working

added that to mt7623.dtsi

	uart0: serial@11002000 {
		compatible = "mediatek,mt7623-uart",
			     "mediatek,mt6577-uart";
		reg = <0 0x11002000 0 0x400>;
		interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
		clocks = <&pericfg CLK_PERI_UART0_SEL>,
			 <&pericfg CLK_PERI_UART0>;
		clock-names = "baud", "bus";
		status = "disabled";
	};

	uart1: serial@11003000 {
		compatible = "mediatek,mt7623-uart",
			     "mediatek,mt6577-uart";
		reg = <0 0x11003000 0 0x400>;
		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
		clocks = <&pericfg CLK_PERI_UART1_SEL>,
			 <&pericfg CLK_PERI_UART1>;
		clock-names = "baud", "bus";
		status = "disabled";
	};

and that to mt7623n-bpi-r2.dts

&uart0 {
	status = "okay";
};
&uart1 {
	status = "okay";
};

dts.zip

following devices are detected during boot (pins by schematics):

pin 8/10 = uart1 (tx/rx) = 11003000 = ttyS2
pin 11/13 = uart0 (tx/rx) = 11002000 = ttyS1

now i'm connected an arduino (sends keepalives and sending back "AT-Strings" it receives (tested with RPI)) to uart1 and trying to access:

#!/bin/bash
DEV=/dev/ttyS2
while read line; do
  echo "["$(date "+%Y-%m-%d %H:%M:%S")"] received: "$line
done < <(cat $DEV)

i can see the keepalives, but when i try to send data:
echo "AT" >/dev/ttyS2
nothing happens (arduino send AT back if it receives it), so BPI-R2 does not send it

serial on arduino is configured with
Serial.begin(9600);

on BPI-R2:

stty -F /dev/ttyS2 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

the arduino-code i use:
simpleserial.ino.txt

dkpg error on Linux Kernel version syntax

I'm trying to install wireguard on the Banana PI R2 running Ubuntu 16.04, latest image.

However, on the installation, I'm getting an error that reads:

dpkg: warning: version '*-*' has bad syntax: version number does not start with digit
It is likely that 4.4.70-BPI-R2-Kernel belongs to a chroot's host
Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.

There is an workaround, not Banana PI related, here: openzfs/zfs#1260

However, as the kernels are not provided by default repositories, I can't install this generic kernel.

Any help on this is appreciate. Thanks

Kernel compilation failed (configuration multimedia support on module instead of builded in)

Hi,

I wanted to change a little bit the configuration of the kernel so that i can use a camera with my BPI-R2.

My setup is particular since i use a grabber (the Magewell USB Capture HDMI Gen 2) and a camera plugged in hdmi to this grabber. Finally the camera should be seen as an usb camera device.

The setup is working on my ubuntu 16.04 (kernel 4.13.0-39-generic), i use uvc and v4l and i can display the camera flux using qv4l2 for example.

I tried to configure the kernel so that i have the same modules i use on my desktop version. To do so i had to configure MEDIA_CAMERA_SUPPORT = y, MEDIA_USB_SUPPORT = y and USB_VIDEO_CLASS = m.

The list of module i need :

Module Size Used by
snd_usb_audio 196608 1
snd_usbmidi_lib 32768 1 snd_usb_audio
uvcvideo 90112 0
videobuf2_vmalloc 16384 1 uvcvideo
videobuf2_memops 16384 1 videobuf2_vmalloc
videobuf2_v4l2 24576 1 uvcvideo
videobuf2_core 40960 2 uvcvideo,videobuf2_v4l2

videodev 176128 3 uvcvideo,videobuf2_core,videobuf2_v4l2
media 40960 2 uvcvideo,videodev

The two module i'm missing are media.ko and videodev.ko but when i set MEDIA_SUPPORT = m , i got the following error at the compilation (see attached file). I don't understand this error because i found the definition of the functions marked as undefined references in linux-mt/include/media/cec.h.

I don't know if i'm missing dependencies or if it's a bug because i'm pretty new to that stuff, a little help would be appreciated.

If you need futher information don't hesitate.

Vivien LAURE

Error_log.txt

otg not working

hi

i've tried using otg-port with this kernel, but i only get this

[    6.414494] usb_phy_generic.0.auto supply vcc not found, using dummy regulato
r                                                                               
[    6.421967] musb probe                                                       
[    6.424465] musb probe reg: 0xe3758000 ,0xe375a000 , irq: 42                 
[    6.443552] musb core probe done base 0xe375a000                             
[    7.554552] 1a1c0000.usb supply vbus not found, using dummy regulator

can you please verify iddig-gpio and vbus? maybe you can help me getting it working in my 5.4-otg tree

https://github.com/frank-w/BPI-R2-4.14/blob/5.4-otg/arch/arm/boot/dts/mt7623.dtsi#L1224

https://github.com/frank-w/BPI-R2-4.14/blob/5.4-otg/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts#L514

regards Frank

build.sh does not check for success

...
"mkimage" command not found - U-Boot images will not be built
arch/arm/boot/Makefile:92: die Regel für Ziel „arch/arm/boot/uImage“ scheiterte
make[2]: *** [arch/arm/boot/uImage] Fehler 1
arch/arm/Makefile:329: die Regel für Ziel „uImage“ scheiterte
make[1]: *** [uImage] Fehler 2
make[1]: Verzeichnis „/home/frank/bpi-r2/BPI-R2-bsp/linux-mt“ wird verlassen
Makefile:50: die Regel für Ziel „kernel“ scheiterte
make: *** [kernel] Fehler 2

Build success!

build.sh:
echo -e "\033[31m Build success!\033[0m"

without check for return-codes

USB3.0 (XHCI) Limited Problem

I'm using USB3.0 hub to extend 4 USB3.0 port with R2, but unfortunately, I met this problem:

image

I have tried to disable xhci module and only enable ehci, but ehci could not recognise my usb3.0 devices, so I am still looking for the solution.

[uboot] uenv.txt is not loaded before display bootmenu

i tried to add to add another bootmenu-entry via uEnv.txt:

kernel_4.14=uImage_4.14.33
kernel_4.9=uImage_4.9.92
boot49=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel_4.9}; bootm
boot414=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel_4.14}; bootm

bootmenu_7=8. Boot kernel 4.9.=run boot49
bootmenu_8=9. Boot kernel 4.14.=run boot414

i know i can modify existing kernel=-param to set another name for the uImage…this works, but the corresponding menuentry boot10 goes through some variables and also loads the env after selecting the entry.

the bootentry and my variables seems not to be loaded before displaying the menu…how can i change this?

i also tried with patches from @JackZeng, but it seems that uEnv.txt from sd.card is not load before menu is displayed

also the following commands on uboot-console did not load it:

mmc init

run loadbootenv

BPI-IoT> run loadbootenv
reading bananapi/bpi-r2/linux/uEnv.txt
1146 bytes read in 10 ms (111.3 KiB/s)

printenv => does not show my vars

bootmenu => does not display the menuentries

kernel compilation failed

I just give a plain compilation and getting the below error.

scripts/Makefile.build:258: recipe for target 'drivers/pinctrl/mediatek/pinctrl-mtk-common.o' failed
make[4]: *** [drivers/pinctrl/mediatek/pinctrl-mtk-common.o] Error 1
scripts/Makefile.build:403: recipe for target 'drivers/pinctrl/mediatek' failed
make[3]: *** [drivers/pinctrl/mediatek] Error 2
scripts/Makefile.build:403: recipe for target 'drivers/pinctrl' failed
make[2]: *** [drivers/pinctrl] Error 2
make[2]: *** Waiting for unfinished jobs....

R2 board might hang at uboot

After reseting this board under Ubuntu OS many times, might encounter this issue

Log:

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 10462KB/s, 300000 bytes, 28ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 19
[PLFM] md_type[1] = 0

[PLFM] boot reason: 4
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 2029ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014

U-Boot (Aug 01 2017 - 09:59:52)

================== Iverson debug. ===========================
g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM: 2 GiB

MT7623 preloader source code

Please release the source code for the preloader binary included with this package.
Filename of the compiled file: "BPI-R2-bsp/mt-pack/mtk/bpi-r2/bin/preloader_iotg7623Np1_emmc.bin"

Bug in init of ethernet driver?

Hello,

I'm not the big kernel developer, but I saw in
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/mediatek/mtk_eth_soc.c
the following code:

static int __init mtk_init(struct net_device *dev)
{
	struct mtk_mac *mac = netdev_priv(dev);
	struct mtk_eth *eth = mac->hw;
	const char *mac_addr;

	mac_addr = of_get_mac_address(mac->of_node);
	if (mac_addr)
		ether_addr_copy(dev->dev_addr, mac_addr);

	/* If the mac address is invalid, use random mac address  */
	if (!is_valid_ether_addr(dev->dev_addr)) {
		eth_hw_addr_random(dev);
		dev_err(eth->dev, "generated random MAC address %pM\n",
			dev->dev_addr);
	}

	return mtk_phy_connect(dev);
}

and I wonder, the function ether_addr_copy wants to copy the content from dev->dev_addr to mac_addr. Is this the plan? I have the feeling, that the parameters should be changed?

Kind regards, Andreas

powerdown not working

I don't know its a kernel issue,but commands powerdown,shutdown -P now and init 0 do only halt. Board stays on (green led is lighting)

tried including some kernel-options but currently without luck

Preloader's uboot load size

U-Boot partition size is 0x80000, but preloader copy only 300000 (0x0493e0).
So modern U-Boot (2019-07) can't be used with additional options.

Displayed correct:
[PART]partition name UBOOT
[PART]partition start block 0x200
[PART]partition size 0x80000
[PART]partition blks 0x400

Please change preloaders copy size to whole part size (0x80000).

u-boot build failing to build (with error) but 'Build success!' on 32 bit hosts

I am getting the following on Debian 9.1 32 bit :-

  ...
  LD      u-boot
  OBJCOPY u-boot.srec
  OBJCOPY u-boot.bin
/bin/sh: 1: ./mkimage: Exec format error
Makefile:814: recipe for target 'u-boot-mtk.bin' failed
make[1]: *** [u-boot-mtk.bin] Error 2
make[1]: Leaving directory '/home/aaron/BPI-R2-bsp/u-boot-mt'
Makefile:40: recipe for target 'u-boot' failed
make: *** [u-boot] Error 2

 Build success!

And the following on Ubuntu 16.04.3 32 bit :-

  LD      u-boot
  OBJCOPY u-boot.srec
  OBJCOPY u-boot.bin
./mkimage: 1: ./mkimage: Syntax error: "(" unexpected
Makefile:814: recipe for target 'u-boot-mtk.bin' failed
make[1]: *** [u-boot-mtk.bin] Error 2
make[1]: Leaving directory '/home/aaron/GitHub/BPI-R2-bsp/u-boot-mt'
Makefile:40: recipe for target 'u-boot' failed
make: *** [u-boot] Error 2

 Build success!

Linux kernel 4.4.70 can't boot successfully

The Linux kerne 4.4.70 can't boot successfully, it may hang after initializing mmc1, like below picture
_20170822213310

This issue occurs when we enabled the mmc0 controller which is for EMMC, we will debug it.

GPIO not working

root@bpi-iot-ros-ai:~# echo "dir 12 1" >/sys/devices/platform/1000b000.pinctrl/mt_gpio
root@bpi-iot-ros-ai:~# echo "out 12 1">/sys/devices/platform/1000b000.pinctrl/mt_gpio
root@bpi-iot-ros-ai:~# cat /sys/devices/platform/1000b000.pinctrl/mt_gpio
gpio base is 233, total num is 279
PIN: [MODE] [DIR] [DOUT] [DIN] [PULL_EN] [PULL_SEL] [IES] [SMT] [DRIVE] ( [R1] [R0] )
...
  12: 1 0 1 1-1-1-1-1 0
...

dir will not be written

Somtimes HDMI doesn't work fine

Sometimes, we get lots of below log, and HDMI isn't working.

[ 781.067379] mediatek-cec 10012000.cec: no cec phys addr found
[ 781.067402] mediatek-drm-hdmi 14015000.hdmi: get cec physical address fail
[ 781.067411] mediatek-drm-hdmi 14015000.hdmi: Get physical address fail
[ 788.510611] mediatek-cec 10012000.cec: no cec phys addr found
[ 788.510632] mediatek-drm-hdmi 14015000.hdmi: get cec physical address fail
[ 788.510641] mediatek-drm-hdmi 14015000.hdmi: Get physical address fail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.