Jump to content

Migrating BananaPI to mainline kernel


destroyedlolo

Recommended Posts

Hi all,

 

Despite I'm not using Armbian but Gentoo on my BananaPI, I hope I'll found some help on this forum as other BananaPI's related forum are sleeping and as many of my previous contact on LeMaker forum are now here :)

 

I'm migrating my BananaPIes from Sunxi's 3.4.103 to mainline kernel, 4.1.00, and I have several questions mostly related to DTS.

 

The 1st one :

* on 3.4, I used J12's IO-8, linked to A20's PH03 to blink a Led, w/o any issue

* on 4.11, the system doesn't allow me to acquire this GPIO-227 as it said it is already owned ... which is true

cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-287, parent: platform/1c20800.pinctrl, 1c20800.pinctrl:
 gpio-41  (                    |usb0-vbus           ) out lo    
 gpio-227 (                    |usb2-vbus           ) out hi    
 gpio-228 (                    |usb0_id_det         ) in  hi IRQ
 gpio-230 (                    |usb1-vbus           ) out hi    
 gpio-234 (                    |cd                  ) in  lo IRQ
 gpio-247 (                    |gmac-3v3            ) out hi    
 gpio-248 (                    |bananapi:green:usr  ) out lo    

Looking inside 3.4's FEX, this PH03 is defined in various places :

[gpio_para]
...
gpio_pin_13 = port:PH03<1><default><default><default>
...

[usbc2]
usb_used = 1
usb_port_type = 1
usb_detect_type = 0
usb_drv_vbus_gpio = port:PH03<1><0><default><0>
usb_restrict_gpio =
usb_host_init_state = 1
usb_restric_flag = 0

Questions :

* what is this usbc2 used for ?

* how the same PIN can be used for both usage w/o interferences ? I mean, I used PH03 for this LED control as per LeMaker documentation and it never created issue. I can activate/desactivate, enable/disable this GPIO w/o trashing anything else in the system. So ... Is this usb_drv_vbus_gpio really used ?

* last but not least, how can I free this GPIO for my own usage ?

 

Thanks

 

Laurent

Link to comment
Share on other sites

Looks like it's "used" by mistake. It is claimed in "sunxi-common-regulators.dtsi", for USB2 VBUS (basically to allow shutting down USB power), but it's not implemented according to Banana Pi M1 schematic.

You should probably contact the maintainer for the Banana Pi DT to fix if it's really an issue and not a difference between different Banana Pi revisions.

 

30 minutes ago, destroyedlolo said:

* last but not least, how can I free this GPIO for my own usage ?

 

Patch the DT to disable usb2-vbus regulator node.

Link to comment
Share on other sites

1 minute ago, zador.blood.stained said:

Looks like it's "used" by mistake

 

And my potential explanation as follows:

Quote

Checked with both Banana Pi and Banana Pro: The USB voltage pin mappings in the fex files are plain BS and do not work (obviously 'copy&paste gone wrong' when they copied all of CubieTech's work in the beginning)

 

Link to comment
Share on other sites

Thanks, I comment out

&reg_usb2_vbus {
        status = "okay";
};

and

usbphy {
        pinctrl-names = "default";
        pinctrl-0 = <&usb0_id_detect_pin>;
        usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
        usb0_vbus_power-supply = <&usb_power_supply>;
        usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
/*      usb2_vbus-supply = <&reg_usb2_vbus>; */
        status = "okay";
};

And now it's working :)

 

Now, I'll fight with the LCD screen.

 

Thanks again

Link to comment
Share on other sites

So, have also a LeMaker 3.5' LCD connected.

I read the thread  initiated by Martin (I duno if it's better to keep in this thread or to pollute Martin's ones ; let me know).

 

I successfully light on my screen by activating &pwm in my DT file ... but only on Linux side : despite I modified ./arch/arm/dts/sun7i-a20-bananapi.dts in u-boot tree.

Using menuconfig, I modified LCD parameters as bellow :

 [*] Enable graphical uboot console on HDMI, LCD or VGA
 [*]   HDMI output support  
 [ ]   VGA output support
 [ ]   Composite video output support
  (x:320,y:240,depth:24,pclk_khz:7000,le:38,ri:20,up:15,lo:4,hs:30,vs:3,sync:3,vmode:0) LCD panel timing d
  (1)   LCD panel display clock phase
  (PH12) LCD panel power enable pin
  ()    LCD panel reset pin
  (PH8) LCD panel backlight enable pin
  (PB2) LCD panel backlight pwm pin
  [*]   LCD panel backlight pwm is inverted
  [ ]   LCD panel needs to be configured via
  LCD panel support (Generic lvds interface LCD panel)  

Well, I missed something ... but I duno what :(

 

Link to comment
Share on other sites

Hello,

 

Another day, another try :)

I think it doesn't took my settings in account because on the serial console, I can see :

CPU:   Allwinner A20 (SUN7I)
Model: LeMaker Banana Pi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment                                
                                                                                
Setting up a 320x240 lcd console (overscan 0x0)                                 
In:    serial                                                                   
Out:   vga                                                                      
Err:   vga                                                                      
SCSI:  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                      

Why VGA when I explicitly disabled VGA ???

I'll restart from the beginning and modify Bananapi_defconfig has Martin did.

Link to comment
Share on other sites

Well well well ... unfortunately, it's a failure.

* Despite I followed Martin's notes adapted to my 3.5 screen, this screen remain definitively ... black.

* More, the 4.11 kernel (or something in the DTB, I duno) is creating a mess within my network : the ethernet MAC is always changing ... but even without that, the broadcast message doesn't hit my DHCP server so my Banana got an IP about 1/3 of the time.

 

Tomorrow, back to work : I switched back to 3.4.103. Even if it is nearly unsupported by SunXI, even if LeMaker's FEX contains lots of unused stuffs ... at least it works.

 

Later, I will have another try : but not, I'll focus on productive stuffs.

 

Bye

Link to comment
Share on other sites

Arg :(

But not only the MAC : if I logon on the console, being able to start the network manually ... I got a very erratic connection : sometime, the stream froze w/o any particular reason.

At the begining, I thought my bPI died ... but I'm not encounter any trouble under 3.4.

 

Anyway ...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines