0
asxalex

ap6212a does not work on H3

Recommended Posts

Hi all!

 

I make a board base on H3 CPU,  I got a 8G EMMC under mmc2, and a ap6212a chip under mmc1. It boots successfully with the "armbian orange-pi-pc-plus", the emmc works fine while the wifi does not work, so, i changed the dts's mmc1 section based on the file 'sun8i-h3-orangepi-pc-plus.dts' in 'arch/arm/boot/dts/' directory, the mmc1 is changed to as follows:

 

&mmc1 {
	vmmc-supply = <&reg_vcc3v3>;
    vqmmc-supply = <&reg_vcc3v3>;
    mmc-pwrseq = <&wifi_pwrseq>;
	bus-width = <4>;
	non-removable;
	status = "okay";

	/*
	 * Explicitly define the sdio device, so that we can add an ethernet
	 * alias for it (which e.g. makes u-boot set a mac-address).
	 */
    sdio_wifi: sdio_wifi@1 {
		reg = <1>;
        compatible = "brcm,bcm4329-fmac";
        interrupt-parent = <&pio>;
        interrupts = <6 10 IRQ_TYPE_LEVEL_HIGH>; /* PG10 / EINT10 */
        interrupt-names = "host-wake";
	};
    wifi_pwrseq: wifi_pwrseq {
         compatible = "mmc-pwrseq-simple";
         pinctrl-names = "default";
         reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>;
         post-power-on-delay-ms = <200>;
     };
};

I refered to the dts file of orangepi-zero-plus2 whose mmc1 got a ap6212 chip too.

 

After i changed it, I compile the new image and burned to the sd card and boot, but the wifi does not work at all.

 

while i got the brcmfmac.ko loaded:

 

# modprobe -a brcmfmac

it succeed with no output, but i got nothing when i ran the command "dmesg | grep brcmfmac"

 

Did I write the dts file wrong? or something else?

 

Any advice is much appreciated, Thank you!

Share this post


Link to post
Share on other sites
1 hour ago, asxalex said:

Did I write the dts file wrong? or something else?

Do you have any schematic how you wired the ap6212 ?

Where did you connect WL_REG_ON, is it on PL7 ?

What do you have by doing "dmesg | grep -i mmc" and "dmesg | grep -i sdio" ?

 

Share this post


Link to post
Share on other sites
24 minutes ago, martinayotte said:

Do you have any schematic how you wired the ap6212 ?

Where did you connect WL_REG_ON, is it on PL7 ?

What do you have by doing "dmesg | grep -i mmc" and "dmesg | grep -i sdio" ?

 

 yes, i wired WL_REG_ON of ap6212a chip to PL7 of H3. 

 

I got the following content while running "dmesg | grep -i mmc"

[    0.000000] Kernel command line: root=UUID=f63dff6a-7de3-4946-b0b0-45be11430249 rootwait rootfstype=ext4 console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=7502a43b-01 ubootsource=mmc usb-storage.quirks=   sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1
[    2.766162] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.2
[    2.767046] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    2.792658] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    2.793489] sunxi-mmc 1c10000.mmc: Linked as a consumer to regulator.2
[    2.795769] sunxi-mmc 1c11000.mmc: Linked as a consumer to regulator.2
[    2.821547] sunxi-mmc 1c11000.mmc: initialized, max. request size: 16384 KB
[    2.829297] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.831268] mmc0: Problem switching card into high-speed mode!
[    2.831508] mmc0: new SDHC card at address 0001
[    2.834257] mmcblk0: mmc0:0001 00000 7.45 GiB
[    2.837102]  mmcblk0: p1
[    2.945548] mmc1: new DDR MMC card at address 0001
[    2.948113] mmcblk1: mmc1:0001 8GND3R 7.28 GiB
[    2.950114] mmcblk1boot0: mmc1:0001 8GND3R partition 1 4.00 MiB
[    2.951981] mmcblk1boot1: mmc1:0001 8GND3R partition 2 4.00 MiB
[    2.953990]  mmcblk1: p1
[    5.806869] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    8.214922] EXT4-fs (mmcblk0p1): re-mounted. Opts: commit=600,errors=remount-ro
[   16.329986] EXT4-fs (mmcblk0p1): resizing filesystem from 277504 to 1911684 blocks
[   16.478819] EXT4-fs (mmcblk0p1): resized filesystem to 1911684

 

and i got nothing while running "dmesg | grep -i sdio", the attachment dmesg.log contains the whole output.

 

And finally, the schematic.png illustrates the connection between H3 and ap6212a.

 

Thank you for your help!

dmesg.log

schematic.png

Share this post


Link to post
Share on other sites
7 minutes ago, asxalex said:

[ 2.945548] mmc1: new DDR MMC card at address 0001

[ 2.948113] mmcblk1: mmc1:0001 8GND3R 7.28 GiB

[ 2.950114] mmcblk1boot0: mmc1:0001 8GND3R partition 1 4.00 MiB

[ 2.951981] mmcblk1boot1: mmc1:0001 8GND3R partition 2 4.00 MiB

[ 2.953990] mmcblk1: p1

This part of the log tell us that your eMMC is connected to mm1 instead of mmc2, so there is a conflict here in your DT.

 

On my OPiZeroPlus2, doing a "dmesg | grep mmc" give me :

[    3.492583] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.2
[    3.499728] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    3.529695] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[    3.539012] sunxi-mmc 1c10000.mmc: Linked as a consumer to regulator.2
[    3.546140] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[    3.781565] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[    3.800892] sunxi-mmc 1c11000.mmc: Linked as a consumer to regulator.2
[    3.833150] sunxi-mmc 1c11000.mmc: initialized, max. request size: 2048 KB
[    3.835336] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    3.848489] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.859629] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.877480] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    4.057093] mmc2: new high speed MMC card at address 0001
[    4.068030] mmcblk2: mmc2:0001 8WPD3R 7.28 GiB 
[    4.074078] mmcblk2boot0: mmc2:0001 8WPD3R partition 1 4.00 MiB
[    4.081969] mmcblk2boot1: mmc2:0001 8WPD3R partition 2 4.00 MiB
[    4.089458]  mmcblk2: p1
[    4.147442] mmc1: new high speed SDIO card at address 0001

 

Share this post


Link to post
Share on other sites
13 hours ago, martinayotte said:

This part of the log tell us that your eMMC is connected to mm1 instead of mmc2, so there is a conflict here in your DT.

 

 

But, I did wire eMMC on MMC2 and ap6212a on MMC1, as the schematic shown below, and the eMMC works fine right now, but the ap6212a is not detected by armbian.

 image.png.bf52df7fdea39339f0379ef598a60dd4.png1.png 

 

image.png.21f4fde40aabb224060ce4000245acb0.png2.png

Share this post


Link to post
Share on other sites
9 hours ago, asxalex said:

eMMC works fine right now, but the ap6212a is not detected by armbian.

As I said earlier, I'm questioning why your eMMC is seen as mmc1 in your log.

Please, provide the part of your DTS which describe mmc0/mmc1/mmc2 to make sure nothing is wrong there.

23 hours ago, asxalex said:

[ 2.945548] mmc1: new DDR MMC card at address 0001

[ 2.948113] mmcblk1: mmc1:0001 8GND3R 7.28 GiB

[ 2.950114] mmcblk1boot0: mmc1:0001 8GND3R partition 1 4.00 MiB

[ 2.951981] mmcblk1boot1: mmc1:0001 8GND3R partition 2 4.00 MiB

[ 2.953990] mmcblk1: p1

 

Share this post


Link to post
Share on other sites
3 hours ago, martinayotte said:

As I said earlier, I'm questioning why your eMMC is seen as mmc1 in your log.

Please, provide the part of your DTS which describe mmc0/mmc1/mmc2 to make sure nothing is wrong there.

 

 

That‘s what i wrote about MMCs in the dts file under arch/arm/boot/dts:

 

#include "sun8i-h3-orangepi-pc.dts"

/ {
	model = "Xunlong Orange Pi PC Plus";
	compatible = "xunlong,orangepi-pc-plus", "allwinner,sun8i-h3";

	aliases {
		/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
	};
};

&emac {
	/* LEDs changed to active high on the plus */
	/delete-property/ allwinner,leds-active-low;
};

&mmc1 {
	vmmc-supply = <&reg_vcc3v3>;
    vqmmc-supply = <&reg_vcc3v3>;
    mmc-pwrseq = <&wifi_pwrseq>;
	bus-width = <4>;
	non-removable;
	status = "okay";

	/*
	 * Explicitly define the sdio device, so that we can add an ethernet
	 * alias for it (which e.g. makes u-boot set a mac-address).
	 */
    sdio_wifi: sdio_wifi@1 {
		reg = <1>;
        compatible = "brcm,bcm4329-fmac";
        interrupt-parent = <&pio>;
        interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
        interrupt-names = "host-wake";
	};
    wifi_pwrseq: wifi_pwrseq {
         compatible = "mmc-pwrseq-simple";
         pinctrl-names = "default";
         reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
         post-power-on-delay-ms = <200>;
     };
};

&mmc2 {
	pinctrl-names = "default";
	pinctrl-0 = <&mmc2_8bit_pins>;
	vmmc-supply = <&reg_vcc3v3>;
	bus-width = <8>;
	non-removable;
	cap-mmc-hw-reset;
	status = "okay";
};

&mmc2_8bit_pins {
	/* Increase drive strength for DDR modes */
	drive-strength = <40>;
	/* eMMC is missing pull-ups */
	bias-pull-up;
};

the included file "sun8i-h3-orangepi-pc.dts" under arch/arm/boot/dts has not been changed,

and, after being compiled, the output of dtb decompiled to dts can be found in the attachment.

 

Any advice on the dts file? Thank you for your patience!

 

 

opipcplus.dts

Share this post


Link to post
Share on other sites
1 hour ago, asxalex said:

Any advice on the dts file?

Try to move the "wifi_pwrseq" node outside the mmc1 node, normally it should be located nearby the "vcc5v0" node at the same level of indentation.

Then report back with "dmesg | grep mmc" ...

Share this post


Link to post
Share on other sites
18 hours ago, martinayotte said:

Then report back with "dmesg | grep mmc" 

 

I changed the wifi_pwrseq outside, and the "dmesg | grep mmc" changed a bit:

 

[    0.000000] Kernel command line: root=UUID=aee206b3-d10b-44e7-af35-710d9422045d rootwait rootfstype=ext4 console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=e3d022de-01 ubootsource=mmc usb-storage.quirks=   sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1
[    2.766391] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.2
[    2.767303] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    2.792927] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    2.793785] sunxi-mmc 1c10000.mmc: Linked as a consumer to regulator.2
[    2.796379] sunxi-mmc 1c11000.mmc: Linked as a consumer to regulator.2
[    2.821823] sunxi-mmc 1c11000.mmc: initialized, max. request size: 16384 KB
[    2.829776] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.831765] mmc0: Problem switching card into high-speed mode!
[    2.832007] mmc0: new SDHC card at address 0001
[    2.834762] mmcblk0: mmc0:0001 00000 7.45 GiB
[    2.854128]  mmcblk0: p1
[    2.921841] mmc1: new DDR MMC card at address 0001
[    2.924439] mmcblk1: mmc1:0001 8GND3R 7.28 GiB
[    2.926419] mmcblk1boot0: mmc1:0001 8GND3R partition 1 4.00 MiB
[    2.928280] mmcblk1boot1: mmc1:0001 8GND3R partition 2 4.00 MiB
[    2.930201]  mmcblk1: p1
[    4.325992] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[    4.349817] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    5.827870] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    8.151766] EXT4-fs (mmcblk0p1): re-mounted. Opts: commit=600,errors=remount-ro
[   16.469981] EXT4-fs (mmcblk0p1): resizing filesystem from 276480 to 1911684 blocks
[   16.628910] EXT4-fs (mmcblk0p1): resized filesystem to 1911684

as shown above, "sunxi-mmc 1c10000.mmc"  allocated mmc-pwrseq, and is initialized. but there's no any output if i ran the command "dmesg | grep -i sdio", still no "high speed sdio card" recognized.

By the way, the boot information show those lines:

U-Boot 2019.04-armbian (Apr 13 2019 - 14:24:38 +0800) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi PC Plus
DRAM:  1 GiB
MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1

 

the mmc@1c11000, which connected a eMMC, is recognized as 1 while mmc@1c10000, which connected to a ap6212a chip,  is recognized as 2

Share this post


Link to post
Share on other sites
1 hour ago, asxalex said:

while mmc@1c10000, which connected to a ap6212a chip,  is recognized as 2

I don't see it recognized as 2 according to your "dmesg" log, but only by u-boot ...

Maybe you can try to take the OPiZeroPlus2-H3 DTB and overwrite it to see if it more recognized ?

BTW, since it is you own hardware design, did you provide a 26MHz crystal between AP_XI and AP_XO ?

 

Share this post


Link to post
Share on other sites
On 4/13/2019 at 9:19 PM, martinayotte said:

I don't see it recognized as 2 according to your "dmesg" log, but only by u-boot ...

Maybe you can try to take the OPiZeroPlus2-H3 DTB and overwrite it to see if it more recognized ?

BTW, since it is you own hardware design, did you provide a 26MHz crystal between AP_XI and AP_XO ?

 

 

Aha, it turns out to be my hardware failure: I connected a triode and an LED on the wl_reg_on, trying to use which to indicate the wl_reg_on is on. But at the same time, the triode and LED makes the wl_reg_on is always low. I solder them off, and ap6212 works fine now.

 

By the way, my sdio wifi is still recognized as mmc2. I bought a orangepi zero plus 2 a few days ago, and it recognized sdio wifi as mmc2 too.

 

Much sorry for my hardware mistake and much thanks for your patience and help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0