Jump to content

Armbian BPI_M64 1- Wire kernel 4.19.53-sunxi64.


shaddow501

Recommended Posts

Hello

 

There seems to be a problem with the latest kernel 4.19.53-sunxi64.

I cannot configure the 1-wire support.


 

In ArmbianEnv it is configured as:

overlays= w1-gpio 
param_w1_pin=PD4
param_w1_pin_int_pullup=1

 

Than in /etc/modules-load.d/modules.conf

I have:

w1-gpio
w1-therm
 

with the dmesg | grep w1 I get:

 

root@bananapim64:~ # dmesg | grep w1                                            
[    4.452698] w1-gpio onewire@0: gpio_request (pin) failed
[    4.452724] w1-gpio: probe of onewire@0 failed with error -22
 

root@bananapim64:~ # cat /sys/kernel/debug/gpio                                 
gpiochip1: GPIOs 0-255, parent: platform/1c20800.pinctrl, 1c20800.pinctrl:
 gpio-120 (                    |bananapi-m64:red:pwr) out hi    
 gpio-142 (                    |bananapi-m64:green:u) out lo    
 gpio-143 (                    |bananapi-m64:blue:us) out hi    
 gpio-166 (                    |cd                  ) in  hi    
 gpio-233 (                    |usb0_id_det         ) in  hi IRQ
 gpio-234 (                    |ads7846_pendown     ) in  lo IRQ

 

What could be the problem??

Link to comment
Share on other sites

4 minutes ago, martinayotte said:

When using W1 overlay, you should not place any W1 modules in modules.conf, the overlay will take care of loading them.

Ok removed it from the /etc/modules-load.d/modules.conf

but it didnt change anything..

 

root@bananapim64:~ # dmesg |  grep w1
[    5.336416] w1-gpio onewire@0: gpio_request (pin) failed
[    5.336438] w1-gpio: probe of onewire@0 failed with error -22

 

Link to comment
Share on other sites

30 minutes ago, martinayotte said:

mmmm ? ... Do you see something wrong while u-boot is loading overlay and trying to apply fixup script ?

 Everything looks good, here have a look

 

U-Boot 2019.04-armbian (May 03 2019 - 17:44:31 +0200) Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: BananaPi-M64
DRAM:  2 GiB
MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from EXT4... MMC: no card present
In:    serial
Out:   serial
Err:   serial
Allwinner mUSB OTG (Peripheral)
Net:   phy interface7
eth0: ethernet@1c30000
Warning: usb_ether using MAC address from ROM
, eth1: usb_ether
MMC: no card present
MMC: no card present
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 2 USB Device(s) found
scanning bus 3 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Autoboot in 1 seconds, press <Space> to stop
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
3042 bytes read in 1 ms (2.9 MiB/s)
## Executing script at 4fc00000
U-boot loaded from eMMC or secondary SD
Boot script loaded from mmc
694 bytes read in 1 ms (677.7 KiB/s)
MMC: no card present
33861 bytes read in 4 ms (8.1 MiB/s)
794 bytes read in 2 ms (387.7 KiB/s)
Applying kernel provided DT overlay sun50i-a64-i2c0.dtbo
496 bytes read in 2 ms (242.2 KiB/s)
Applying kernel provided DT overlay sun50i-a64-i2c1.dtbo
1039 bytes read in 2 ms (506.8 KiB/s)
Applying kernel provided DT overlay sun50i-a64-spi-add-cs1.dtbo
784 bytes read in 2 ms (382.8 KiB/s)
Applying kernel provided DT overlay sun50i-a64-spi-spidev.dtbo
777 bytes read in 2 ms (378.9 KiB/s)
Applying kernel provided DT overlay sun50i-a64-w1-gpio.dtbo
3795 bytes read in 2 ms (1.8 MiB/s)
Applying kernel provided DT fixup script (sun50i-a64-fixup.scr)
## Executing script at 44000000
tmp_bank=D
tmp_pin=4
5416592 bytes read in 265 ms (19.5 MiB/s)
14311432 bytes read in 698 ms (19.6 MiB/s)
## Loading init Ramdisk from Legacy Image at 4fe00000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    5416528 Bytes = 5.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
   Loading Ramdisk to 49ad5000, end 49fff650 ... OK
   Loading Device Tree to 0000000049a64000, end 0000000049ad4fff ... OK

Starting kernel ...

 

Link to comment
Share on other sites

7 minutes ago, shaddow501 said:

Applying kernel provided DT overlay sun50i-a64-w1-gpio.dtbo

3795 bytes read in 2 ms (1.8 MiB/s)

Applying kernel provided DT fixup script (sun50i-a64-fixup.scr)

## Executing script at 44000000

tmp_bank=D

tmp_pin=4

So, everything seems OK there !

I'm running out of ideas ...

 

EDIT: maybe try using DEV 5.1.y ?

Link to comment
Share on other sites

1 minute ago, martinayotte said:

So, everything seems OK there !

I'm running out of ideas ...

Lol at least you have some ideas, I have none 

I had a similar issue with the touch panel "pendown" that it didnt accept the GPIO number "64" and I had to work around and set it to gpio "234"

 

You can see what I did with this post: https://forum.armbian.com/topic/10610-bpi_m64-with-5-hdmi-lcd-touchscreen-how-to/

but I dont know what to do with the W1-GPIO

 

 

Link to comment
Share on other sites

5 minutes ago, shaddow501 said:

but I dont know what to do with the W1-GPIO

Maybe try compiling the following custom overlay :

// Definitions for w1-gpio module (without external pullup)
/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun50i-a64";

	fragment@0 {
		target-path = "/";
		__overlay__ {

			w1: onewire@0 {
				compatible = "w1-gpio";
				pinctrl-names = "default";
				pinctrl-0 = <&w1_pins>;
				gpios = <&pio 3 4 0>; // PD4 
				status = "okay";
			};
		};
	};

	fragment@1 {
		target = <&pio>;
		__overlay__ {
			w1_pins: w1_pins {
				allwinner,pins = "PD4";
				allwinner,function = "gpio_in"; // in (initially)
				allwinner,pull = <0>; // off
			};
		};
	};

	__overrides__ {
		gpiopin =       <&w1>,"gpios:4",
				<&w1_pins>,"allwinner,pins:0";
	};
};

Then, load it dynamically with those bash commands :

mkdir /sys/kernel/config/device-tree/overlays/w1
cat /root/w1-gpio-overlay.dtbo > /sys/kernel/config/device-tree/overlays/w1/dtbo

 

Link to comment
Share on other sites

11 minutes ago, martinayotte said:

Maybe try compiling the following custom overlay :


// Definitions for w1-gpio module (without external pullup)
/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun50i-a64";

	fragment@0 {
		target-path = "/";
		__overlay__ {

			w1: onewire@0 {
				compatible = "w1-gpio";
				pinctrl-names = "default";
				pinctrl-0 = <&w1_pins>;
				gpios = <&pio 3 4 0>; // PD4 
				status = "okay";
			};
		};
	};

	fragment@1 {
		target = <&pio>;
		__overlay__ {
			w1_pins: w1_pins {
				allwinner,pins = "PD4";
				allwinner,function = "gpio_in"; // in (initially)
				allwinner,pull = <0>; // off
			};
		};
	};

	__overrides__ {
		gpiopin =       <&w1>,"gpios:4",
				<&w1_pins>,"allwinner,pins:0";
	};
};

Then, load it dynamically with those bash commands :


mkdir /sys/kernel/config/device-tree/overlays/w1
cat /root/w1-gpio-overlay.dtbo > /sys/kernel/config/device-tree/overlays/w1/dtbo

 

Done it

 

dtc -O dtb -o w1-gpio-overlay.dtbo -b 0 -@ w1-gpio-overlay.dts 
w1-gpio-overlay.dtbo: Warning (unit_address_vs_reg): /fragment@0/__overlay__/onewire@0: node has a unit name, but no reg property

 

than

mkdir /sys/kernel/config/device-tree/overlays/w1

cat /root/w1-gpio-overlay.dtbo > /sys/kernel/config/device-tree/overlays/w1/dtbo 

 

cd /sys/kernel/config/device-tree/overlays
root@bananapim64:device-tree/overlays # ls
w1
root@bananapim64:device-tree/overlays # cd w1
root@bananapim64:overlays/w1 # ls
dtbo  path  status

 

but it didnt change anything...

 

oot@bananapim64:~ # dmesg | grep w1
[    5.222841] w1-gpio onewire@0: gpio_request (pin) failed
[    5.222862] w1-gpio: probe of onewire@0 failed with error -22

 

 

By the way I am now with updated Kernel version  - 4.19.57-sunxi64 #5.90

 

Link to comment
Share on other sites

1 minute ago, martinayotte said:

I've no issue with W1 on my Pine64 (which is also a A64 SoC based) ...

Clearly something is different.

 

About your pine64 did you able to get support for AC/battery Power?

Since I didnt find anything that could fix that on my BPI_M64 with Armbian kernel.

 

When I do 

root@bananapim64:/sys/kernel # dmesg | grep axp
[    1.800114] axp20x-rsb sunxi-rsb-3a3: AXP20x variant AXP803 found
[    1.803353] input: axp20x-pek as /devices/platform/soc/1f03400.rsb/sunxi-rsb-3a3/axp221-pek/input/input0
[    1.809240] axp20x-rsb sunxi-rsb-3a3: AXP20X driver loaded
[    3.022651] axp20x-gpio axp20x-gpio: DMA mask not set
[    3.023118] axp20x-gpio axp20x-gpio: AXP209 pinctrl and GPIO driver loaded
[    5.478240] axp20x-battery-power-supply axp20x-battery-power-supply: DMA mask not set
[    5.478682] axp20x-adc axp813-adc: DMA mask not set
[    5.483612] axp20x-ac-power-supply axp20x-ac-power-supply: DMA mask not set

 

And there is no support for battery.

root@bananapim64:/sys/kernel # ls /sys/class/power_supply 
root@bananapim64:/sys/kernel #  (nothing) - > should be ac , battery folders...

 

With BPI_M64 image based on kernel 4.4.89 I do have those features but I cannot get my 5" display working properly, and have no idea how to add the 1-wire + spidev support.

it seems that with every image there are issues....

 

Link to comment
Share on other sites

In the pine 64 at 0001-add-pine64-DT-files.patch

 

there is:


+        onewire_device@0 {
+            compatible = "w1-gpio";
+            gpios = <0x30 0x2 0x8 0x0 0x0 0x0 0x0>;
+            pinctrl-names = "default";
+            pinctrl-0 = <0xba>;
+            status = "okay";

(in two places)

 

+        onewire_device@0 {
+            compatible = "w1-gpio";
+            gpios = <0x30 0x2 0x8 0x0 0x0 0x0 0x0>;
+            pinctrl-names = "default";
+            pinctrl-0 = <0xba>;
+            status = "okay";

 

I dont know if it is relevant or not..

 

also in pine 64.dts

onewire_device@0 {
            compatible = "w1-gpio";
            gpios = <0x30 0x2 0x8 0x0 0x0 0x0 0x0>;
            pinctrl-names = "default";
            pinctrl-0 = <0xba>;
            status = "okay";
        };

 

in the sun50i-a64-bananapi-m64.dts there is nothing that relate to onewire.

also none onewire at bananapim64.dts

 

could it be related to the issue?

 

 

 

Link to comment
Share on other sites

12 minutes ago, shaddow501 said:

In the pine 64 at 0001-add-pine64-DT-files.patch

Where are you seeing this patch ?

I don't see it at all in Armbian tree ...

12 minutes ago, shaddow501 said:

could it be related to the issue?

I don't think so, since my Pine64 Main DT doesn't have anything about W1, only the overlay has it ...

 

I think you should really give a try with 5.1.y !

Link to comment
Share on other sites

3 minutes ago, martinayotte said:

Where are you seeing this patch ?

I don't see it at all in Armbian tree ...

I don't think so, since my Pine64 Main DT doesn't have anything about W1, only the overlay has it ...

 

I think you should really give a try with 5.1.y !

 

Cool I really would like to  but when I do build (Armbian build  => sudo complie.sh)  it only let me have the latest bananaPI kernel which is the 4.19.57-sunxi64 #5.90, how can I get the newer one??

 

and the file 0001-add-pine64-DT-files.patch is located at /armbian/build/patch/kernel/pine64-default

Link to comment
Share on other sites

4 minutes ago, shaddow501 said:

how can I get the newer one?? 

You need to do :

sudo ./compile.sh EXPERT=yes

 

5 minutes ago, shaddow501 said:

file 0001-add-pine64-DT-files.patch is located at /armbian/build/patch/kernel/pine64-default

Ok ! This doesn't exist in DEV or NEXT builds ...

Link to comment
Share on other sites

5 minutes ago, martinayotte said:

You need to do :


sudo ./compile.sh EXPERT=yes

 

Ok ! This doesn't exist in DEV or NEXT builds ...

When i go with sudo ./compile.sh EXPERT=yes

then it loads the screen that i can select kernel + u-boot or full image

 

than I select bananapiM64 and=>

 

It still goes to => Checking git sources [ linux-mainline orange-pi-4.19 ] 

 

 

Link to comment
Share on other sites

I've tried before telling you that, and after choosing "bananapim64", another menu appears with "next" or "dev" choices ...

 

please, check the file config/boards/bananapim64.conf , you should have the following :


# A64 quad core 2GB SoC GBE WiFi eMMC
BOARD_NAME="Banana Pi M64"
BOARDFAMILY="sun50iw1"
BOOTCONFIG_DEFAULT="sun50iw1p1_config"
BOOTCONFIG="bananapi_m64_defconfig"
#
MODULES="bcmdhd"
MODULES_NEXT=""
CPUMIN="408000"
CPUMAX="1296000"
#
KERNEL_TARGET="next,dev"
CLI_TARGET="buster:next"
DESKTOP_TARGET="bionic:next"
#
CLI_BETA_TARGET=""
DESKTOP_BETA_TARGET=""
 

Link to comment
Share on other sites

Ill check and update, I know that I have the default settings as eas downloaded from git. But do you think that this 5.1 kernel will solve the battry and w1 issue ?

 

in your pine 64 do you have ac and bsttery under sys/class/powersupply ?

Link to comment
Share on other sites

7 minutes ago, shaddow501 said:

in your pine 64 do you have ac and bsttery under sys/class/powersupply ?

Here is what I have on my Pine64 :

ls /sys/class/power_supply/*
/sys/class/power_supply/axp20x-battery:
capacity  constant_charge_current  constant_charge_current_max	current_now  device  health  online  power  present  status  subsystem	type  uevent  voltage_max_design  voltage_min_design  voltage_now

/sys/class/power_supply/axp813-ac:
device	health	input_current_limit  online  power  present  subsystem	type  uevent  voltage_min

 

Link to comment
Share on other sites

21 minutes ago, shaddow501 said:

I know that I have the default settings as eas downloaded from git.

Looking here, https://github.com/armbian/build/blob/master/config/boards/bananapim64.conf , both "next" and "dev" are there since the beginning ...

 

EDIT : Oh ! "next" and "dev" choice are only with "kernel+u-boot only", not with "full image" !

EDIT2: If you wish "full image", change DESKTOP_TARGET="bionic:next" to DESKTOP_TARGET="bionic:next,dev"

EDIT3: I was wrong, even in "full image", menu still there for me ...

Link to comment
Share on other sites

59 minutes ago, martinayotte said:

Looking here, https://github.com/armbian/build/blob/master/config/boards/bananapim64.conf , both "next" and "dev" are there since the beginning ...

 

EDIT : Oh ! "next" and "dev" choice are only with "kernel+u-boot only", not with "full image" !

EDIT2: If you wish "full image", change DESKTOP_TARGET="bionic:next" to DESKTOP_TARGET="bionic:next,dev"

EDIT3: I was wrong, even in "full image", menu still there for me ...

I am interested only in u-boot and kernel

but I dont have those menus that you have, the bananapim64.conf file is the same as yours.

look, when I select the bananapim64 it start working... I dont get menu for choosing next or dev.

 

here are the menus that I have.

sorry it got mixed the selection of the u-boot and kernel is before the selection of the board, but I cant seem to change the order here...

 

 

 

4.thumb.png.c0f9ebc1c60c641acd32e8a07408bbf8.png2.png

 

Link to comment
Share on other sites

37 minutes ago, shaddow501 said:

I am interested only in u-boot and kernel

but I dont have those menus that you have, the bananapim64.conf file is the same as yours.

look, when I select the bananapim64 it start working... I dont get menu for choosing next or dev.

 

here are the menus that I have.

sorry it got mixed the selection of the u-boot and kernel is before the selection of the board, but I cant seem to change the order here...

Could it be that you have special developer rights that you do get this menu? I dont know, I just dont get it here!!

 

Quote

 

 

 

4.thumb.png.c0f9ebc1c60c641acd32e8a07408bbf8.png2.png

 

 

Link to comment
Share on other sites

6 hours ago, martinayotte said:

Looking here, https://github.com/armbian/build/blob/master/config/boards/bananapim64.conf , both "next" and "dev" are there since the beginning ...

 

EDIT : Oh ! "next" and "dev" choice are only with "kernel+u-boot only", not with "full image" !

EDIT2: If you wish "full image", change DESKTOP_TARGET="bionic:next" to DESKTOP_TARGET="bionic:next,dev"

EDIT3: I was wrong, even in "full image", menu still there for me ...

 

Ok finally created a new image with a new Kernel and started the process of installing all the hardware, so now yes I see that I have battery support & onewire is shown under GPIO.

And now started to install the touch panel as like that I have done with the previous kernel.

first install Linux headers dpkg -i and the Linux headers, ok installed!

 

not quite... 

 

need to go inside the Linux headers and "make modules" 

in order that I will able to compile the kernel module...

 

and this is what I get:

 

root@bananapim64:/usr/src/linux-headers-5.1.15-sunxi64# make modules 
  UPD     include/config/kernel.release
  UPD     include/generated/utsrelease.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
make[1]: *** No rule to make target 'arch/arm64/kernel/vdso/vdso.lds', needed by 'arch/arm64/kernel/vdso/vdso.so.dbg'.  Stop.
arch/arm64/Makefile:166: recipe for target 'vdso_prepare' failed
make: *** [vdso_prepare] Error 2

ok, dont know what it is but lets see if I can go on,

next to that I need to run the command "make scripts"

this command finish without any issues.

 

go back to the driver make  succeed, I dont see any errors, make install, again no errors cool.... than depmod, again no errors.

when trying call the driver by modprobe ads7846_device

I get FATAL: Module ads7846_device not found in directory /lib/modules/5.1.15-sunxi64

apparently it created a folder 5.1.15 and installed there the "extra" folder with the drivers inside.

OK.. moved that extra folder into the 5.1.15-sunxi64 folder..

and deleted the 5.1.15 folder.

 

Now try again...:

running depmod again and again there is a folder name 5.1.15 with the extra inside..

created link:

sudo ln -s /lib/modules/5.1.15/extra/ads7846_device.ko /lib/modules/5.1.15-sunxi64/

 

depmod -a 

 

next:

modprobe: FATAL: Module ads7846_device.ko not found in directory /lib/modules/5.1.15-sunxi64

 

but it is there!!!

 

ok different approach 

edited the MakeFile

 

obj-m := ads7846.o 
KDIR := /lib/modules/5.1.15-sunxi64/build    
PWD := $(shell pwd) 
all:
        $(MAKE) -C $(KDIR) M=$(PWD) modules 
clean:
        $(MAKE) -C $(KDIR) M=$(PWD) clean 
install:
        $(MAKE) -C $(KDIR) M=$(PWD) modules_install

than finally  when I try to run i get another present.

 

ERROR: could not insert 'ads7846_device': Exec format error

 

dmesg says:

 

ads7846_device: version magic '5.1.15 SMP mod_unload aarch64' should be '5.1.15-sunxi64 SMP mod_unload aarch64'

 

 

I think when people curse you "Go to hell" they mean that you start to work with Linux!

 

why depmod dosnt enter the files to the right location?

WHY???

 

Well, I think I know why, it is because of the Linux headers that didnt complete the make...

 

But how to fix it?

 

 

 

 

 

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