Jump to content

Armbian customization


chradev

Recommended Posts

Hi to All,

 

Unfortunately, following tkaise's advises do not help me for now.

 

The problem comes from starting RPI Monitor service and this advise do not help me to avoid it as well.

I try to add proposed scrip in both host and chrooted rootfs but none of them do work.

 

Debian debootstrap is doing that by magic but there is no no way to take advantage from it without modifying Armbian.

 

On the other hand my idea to do that in firstrun script is also barren because partition is stripped and probably thirdrun script will help.

 

Any better ideas?

 

Best regards

Chris

Link to comment
Share on other sites

Hi to All,

 

I have just received from Olimex 2 boards A20-OLinuXino-LIME2-eMMC with new HW rev. E.

The main differences in new HW rev D and E are:

  • Completely re-routed the Ethernet and the EEPROM in order to reduce noise
  • Added eMMC option (can be used instead of NAND). By default everything is set to NAND

I have started a new thread on Olimex forum about A20-OLinuXino-LIME2-eMMC with new HW rev. E.

 

In brief the good news are that GB Ethernet is working and PMU is much cooler but NAND driver fails and there is some discrepancy in HW info data.

 

Unfortunately, there is no information on how to switch from default NAND to eMMC option which is important to me so any help is welcome.

 

Best regards

Chris

Link to comment
Share on other sites

Hi Igor,

 

You will (probably) need to patch u-boot, see this example for some other A20 boards with second MMC.

 

http://lists.denx.de/pipermail/u-boot/2015-March/209464.html

 

or Cubieboard second SD card addon:

 

https://github.com/igorpecovnik/lib/blob/second/patch/u-boot/second_sd_card_cubieboard2.patch

 

I have also read carefully Add support for CB2-2Card (Cubieboard 2 with two cards).

 

Unfortunately, there are a few differences with normal mmc2:

  • There is no card detect pin
  • Data are 8 bit wide instead of 4
  • eMM chip used (MTFC4GACAANA-4M_IT) has a negative RST input connected to PC16/NWP/SDC2_RST

As I understand from chip datasheet unsupported reset input may not be an issue.

About using 8 bit data I see suspicion it is not supported by SoC.

 

My tries to modify fex/bin files in customised by me Armbian with legacy kernel 3.4.111 did not succeed.

The best result is with 4/8 bit buswidth and manual detmode (4):

[mmc2_para]
sdc_used = 1
sdc_detmode = 4
sdc_buswidth = 8
sdc_cmd = port:PC06<3><1><2><default>
sdc_clk = port:PC07<3><1><2><default>
sdc_d0 = port:PC08<3><1><2><default>
sdc_d1 = port:PC09<3><1><2><default>
sdc_d2 = port:PC10<3><1><2><default>
sdc_d3 = port:PC11<3><1><2><default>
sdc_d4 = port:PC12<3><1><2><default>
sdc_d5 = port:PC13<3><1><2><default>
sdc_d6 = port:PC14<3><1><2><default>
sdc_d7 = port:PC15<3><1><2><default>
sdc_det =
sdc_use_wp = 0
sdc_wp =
sdc_isio = 0
sdc_regulator = "none"

NAND disabled and card2_boot_para modifies accordingly. Boot messages about mmc2 are:

[    1.850415] [mmc-msg] sdc2 set round clock 400000, src 24000000
[    1.858631] [mmc-msg] sdc2 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.866832] [mmc-msg] sdc2 Probe: base:0xf05f6000 irq:66 sg_cpu:f05f8000(4fc01000) ret 0.
[    1.871443] [mmc_pm]: failed to fetch sdio card configuration!
[    1.989028] [mmc_pm]: No sdio card, please check your config !!

In a Fex guide I see that detmode 4 means "manually (via the proc file system node)".

Is there a need something to be added and where?

 

I have also make a brief test with Armbian_4.5_Lime2_Debian_jessie_4.2.3 from Armbian site but there is no a message about mmc2 at boot.

 

I do not use patched U-Boot for now but expect as a beginning the kernel to recognize eMMC connected as MMC2 on A20-Olinuxino-Lime2-eMMC (HW rev. E).

 

Later on I expect to boot from it as fail over of MMC0, USB or SATA when the user pushes a button while resetting or powering on the board.

Is it a must to migrate to the mainline Kernel and latest U-Boot for achieving such a requirement?

 

As a new Olimex board revision it will need additional support so any help is welcome.

 

Best regards

Chris

Link to comment
Share on other sites

Hi to All,

 

I have just made a small step ahead using Armbian_4.5_Lime2_Debian_jessie_4.2.3 from Armbian repository and changing  /boot/dtb/sun7i-a20-olinuxino-lime2.dtb as follows:

 

 

*** lime2-orig.dts      2016-04-04 19:35:59.983029253 +0200
--- lime2-mmc2.dts      2016-04-04 20:13:35.302411119 +0200
***************
*** 622,630 ****
                        clocks = <0x3 0xa 0x1d 0x0 0x1d 0x1 0x1d 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "disabled";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                };

                mmc@01c12000 {
--- 622,638 ----
                        clocks = <0x3 0xa 0x1d 0x0 0x1d 0x1 0x1d 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       #status = "disabled";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
+
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc2_pins_a>;
+                       vmmc-supply = <0x1a>;
+                       bus-width = <4>;
+                       non-removable;
+                       status = "okay";
+
                };

                mmc@01c12000 {
***************
*** 971,977 ****
                                phandle = <0x19>;
                        };

!                       mmc2@0 {
                                allwinner,pins = "PC6", "PC7", "PC8", "PC9", "PC10", "PC11";
                                allwinner,function = "mmc2";
                                allwinner,drive = <0x2>;
--- 979,985 ----
                                phandle = <0x19>;
                        };

!                       mmc2_pins_a: ***@0 {
                                allwinner,pins = "PC6", "PC7", "PC8", "PC9", "PC10", "PC11";
                                allwinner,function = "mmc2";
                                allwinner,drive = <0x2>;

 

 

The result is:

 

 

[    1.901487] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[    1.901933] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    1.936963] sunxi-mmc 1c0f000.mmc: base:0xf054e000 irq:26
[    1.937360] sunxi-mmc 1c11000.mmc: No vqmmc regulator found
[    1.973960] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.976674] mmc0: new high speed SDHC card at address 0007
[    1.976762] sunxi-mmc 1c11000.mmc: base:0xf0552000 irq:27
[    1.977332] mmcblk0: mmc0:0007 SD04G 3.70 GiB
[    1.978716]  mmcblk0: p1
[    1.994828] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 8, RTO !!
[    1.998984] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    1.999838] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    2.000688] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    2.001544] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    2.030611] mmc1: MAN_BKOPS_EN bit is not set
[    2.038167] mmc1: new high speed MMC card at address 0001
[    2.038692] mmcblk1: mmc1:0001 P1XXXX 3.60 GiB
[    2.038871] mmcblk1boot0: mmc1:0001 P1XXXX partition 1 16.0 MiB
[    2.039012] mmcblk1boot1: mmc1:0001 P1XXXX partition 2 16.0 MiB
[    2.039983] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    2.040038] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    2.040052] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    2.040111] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    2.040129] blk_update_request: I/O error, dev mmcblk1, sector 0
[    2.040143] Buffer I/O error on dev mmcblk1, logical block 0, async page read
[    2.040534] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    2.040558] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    2.040569] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    2.040609] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    2.040619] blk_update_request: I/O error, dev mmcblk1, sector 0
[    2.040629] Buffer I/O error on dev mmcblk1, logical block 0, async page read
[    2.040650]  mmcblk1: unable to read partition table
[    2.434805] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    3.883368] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.883459] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    3.883475] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.883897] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    3.883923] blk_update_request: I/O error, dev mmcblk1, sector 7552896
[    3.886782] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.886853] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    3.886868] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.886948] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    3.886968] blk_update_request: I/O error, dev mmcblk1, sector 7552896
[    3.886983] Buffer I/O error on dev mmcblk1, logical block 944112, async page read
[    3.900753] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.900827] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    3.900856] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.900947] mmcblk1boot1: timed out sending r/w cmd command, card status 0x900
[    3.900973] blk_update_request: I/O error, dev mmcblk1boot1, sector 32640
[    3.903145] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.903219] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    3.903234] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.903335] mmcblk1boot1: timed out sending r/w cmd command, card status 0x900
[    3.903356] blk_update_request: I/O error, dev mmcblk1boot1, sector 32640
[    3.903372] Buffer I/O error on dev mmcblk1boot1, logical block 4080, async page read
[    3.920042] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.920135] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    3.920149] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.920261] mmcblk1boot0: timed out sending r/w cmd command, card status 0x900
[    3.920285] blk_update_request: I/O error, dev mmcblk1boot0, sector 32640
[    3.921084] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.921158] sunxi-mmc 1c11000.mmc: no request for cmd53 busy
[    3.921172] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.923541] mmcblk1boot0: timed out sending r/w cmd command, card status 0x900
[    3.923573] blk_update_request: I/O error, dev mmcblk1boot0, sector 32640
[    3.923589] Buffer I/O error on dev mmcblk1boot0, logical block 4080, async page read
[    6.772227] EXT4-fs (mmcblk0p1): re-mounted. Opts: data=writeback,commit=600,errors=remount-ro

 

 

where mmcblk1: mmc1:0001 P1XXXX 3.60 GiB is right because of eMMC is 4GB.

 

There are registered following devices:

brw-rw---- 1 root disk 179,  0 Apr  4 20:19 /dev/mmcblk0
brw-rw---- 1 root disk 179,  1 Apr  4 20:19 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,  8 Apr  4 20:19 /dev/mmcblk1
brw-rw---- 1 root disk 179, 16 Apr  4 20:19 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 24 Apr  4 20:19 /dev/mmcblk1boot1

lsblk command prints:

NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0   16M  1 disk
mmcblk1boot1 179:24   0   16M  1 disk
mmcblk0      179:0    0  3.7G  0 disk
└─mmcblk0p1  179:1    0  3.7G  0 part /
mmcblk1      179:8    0  3.6G  0 disk

where lines with mmcblk1boot* are definitely wrong.

 

Trying to run 'fdisk /dev/mmcblk1' command prints:

fdisk: cannot open /dev/mmcblk1: Input/output error

Any ides how to fix the problem?

 

Best regards

Chris

Link to comment
Share on other sites

The usage of 8-bit data for mmc2 is definitely unsupported:

[    1.937052] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC12
[    1.937073] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC13
[    1.937089] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC14
[    1.937105] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC15

which also discussed here.

 

BTW: errors like printed while booting lime2-emmc:

sunxi-mmc 1c11000.mmc: smc 1 err, cmd 8, RTO !!

also present in the above thread.

Link to comment
Share on other sites

Use our tools, set kernel building only

KERNEL_ONLY="yes" 

in call script and use DEV branch, when prompted, instead of DEFAULT (3.4.x) / NEXT (4.4.6). Peek the (build) documentation in case of troubles.

 

Since you are switching to development area, various problems could come up, not all our patches are adjusted to this version and are not present yet. I built a DEV kernel yesterday without a problem ...

Link to comment
Share on other sites

Thanks Igor,

 

I will try it and back with the results but eMMC chip is supporting both 4 and 8 bit data transfer so the problem is other.

 

BTW provoking from this post I test set up with kernel 3.4 and fex config detmode = 1 (GPIO) and sdc_det = PC16 ... (which is connected to eMMC chip RST_N and has pull-up). Unfortunately, the result is the same:

[    1.848815] [mmc-msg] sdc2 set round clock 400000, src 24000000
[    1.857026] [mmc-msg] sdc2 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.865199] [mmc-msg] sdc2 Probe: base:0xf05f6000 irq:66 sg_cpu:f05f8000(4fc01000) ret 0.
[    1.869767] [mmc_pm]: failed to fetch sdio card configuration!
[    1.987106] [mmc_pm]: No sdio card, please check your config !!

Best regards

Chris

 

Link to comment
Share on other sites

I try to build and boot development Armbian as recommended by Igor.

 

First boot is unsuccessful. U-Boot is resetting continuously:

 

 

U-Boot SPL 2016.03-armbian (Apr 06 2016 - 20:36:06)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1


U-Boot 2016.03-armbian (Apr 06 2016 - 20:36:06 +0300) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: Olimex A20-OLinuXino-LIME2
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment

In:    serial
Out:   serial
Err:   serial
SCSI:  SATA link 0 timeout.
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:   eth0: ethernet@01c50000
starting USB...
USB0:   undefined instruction
pc : [<0000602c>]          lr : [<ce81ffff>]
reloc pc : [<cb0ac02c>]    lr : [<998c5fff>]
sp : 7af317e0  ip : 00000000     fp : 7af3b9f8
r10: 7af3bc88  r9 : 7af39ee0     r8 : 01c14000
r7 : 00000000  r6 : 00000000     r5 : 00000000  r4 : 7af3bac0
r3 : 00006000  r2 : 0143a51d     r1 : 01c20000  r0 : 7af3bac0
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

 

 

Will try with U-Boot v2015-10

 

EDIT:

  • in file userpatches/lib.config 'BOOTBRANCH=v2015.10' has to be added
  • for building image with bew U-Boot file output/debs/linux-u-boot-dev-lime2_5.07_armhf.deb has to be deleted.

Successfully boot.

Link to comment
Share on other sites

Unfortunately, the result about eMMC connected to mmc2 is the same like at Armbian next with kernel 4.2.3.

 

 

[    3.377551] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    3.408339] sunxi-mmc 1c0f000.mmc: base:0xf0d78000 irq:26
[    3.445296] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.448008] mmc0: new high speed SDHC card at address 0007
[    3.448144] sunxi-mmc 1c11000.mmc: base:0xf0d7c000 irq:27
[    3.448924] mmcblk0: mmc0:0007 SD04G 3.71 GiB
[    3.450490]  mmcblk0: p1
[    3.457615] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 8, RTO !!
[    3.461779] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.462625] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.463473] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.464322] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.528805] mmc1: new DDR MMC card at address 0001
[    3.529718] mmcblk1: mmc1:0001 P1XXXX 3.60 GiB
[    3.530235] mmcblk1boot0: mmc1:0001 P1XXXX partition 1 16.0 MiB
[    3.530685] mmcblk1boot1: mmc1:0001 P1XXXX partition 2 16.0 MiB
[    3.531996] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.532043] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.532110] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    3.532129] blk_update_request: I/O error, dev mmcblk1, sector 0
[    3.532145] Buffer I/O error on dev mmcblk1, logical block 0, async page read
[    3.532476] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.532502] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.532548] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    3.532560] blk_update_request: I/O error, dev mmcblk1, sector 0
[    3.532569] Buffer I/O error on dev mmcblk1, logical block 0, async page read
[    3.532601]  mmcblk1: unable to read partition table
[    3.863393] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    5.724692] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.724810] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.724915] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    5.724936] blk_update_request: I/O error, dev mmcblk1, sector 7552896
[    5.726099] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.726192] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.726316] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    5.726341] blk_update_request: I/O error, dev mmcblk1, sector 7552896
[    5.726360] Buffer I/O error on dev mmcblk1, logical block 944112, async page read
[    5.747284] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.747352] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.747459] mmcblk1boot0: timed out sending r/w cmd command, card status 0x900
[    5.747480] blk_update_request: I/O error, dev mmcblk1boot0, sector 32640
[    5.748683] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.748742] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.748829] mmcblk1boot1: timed out sending r/w cmd command, card status 0x900
[    5.748850] blk_update_request: I/O error, dev mmcblk1boot1, sector 32640
[    5.749216] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.749288] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.749361] mmcblk1boot1: timed out sending r/w cmd command, card status 0x900
[    5.749378] blk_update_request: I/O error, dev mmcblk1boot1, sector 32640
[    5.749393] Buffer I/O error on dev mmcblk1boot1, logical block 4080, async page read
[    5.757629] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.757700] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.757787] mmcblk1boot0: timed out sending r/w cmd command, card status 0x900
[    5.757807] blk_update_request: I/O error, dev mmcblk1boot0, sector 32640
[    5.757824] Buffer I/O error on dev mmcblk1boot0, logical block 4080, async page read
[    5.972328] EXT4-fs (mmcblk0p1): re-mounted. Opts: data=writeback,commit=600,errors=remount-ro

 

 

Will try 8-bit data bus.

Link to comment
Share on other sites

Following changes was made:

 

 

*** lime2-orig.dts      2016-04-06 22:43:26.913995144 +0300
--- lime2-emmc.dts      2016-04-06 23:21:58.124471570 +0300
***************
*** 679,687 ****
                        clocks = <0x3 0xa 0x20 0x0 0x20 0x1 0x20 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "disabled";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                };

                mmc@01c12000 {
--- 679,694 ----
                        clocks = <0x3 0xa 0x20 0x0 0x20 0x1 0x20 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "okay";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
+
+                         pinctrl-names = "default";
+                         pinctrl-0 = <&mmc2_pins_a>;
+                         vmmc-supply = <0x1d>;
+                         bus-width = <0x8>;
+                         non-removable;
+
                };

                mmc@01c12000 {
***************
*** 1054,1061 ****
                                phandle = <0x1c>;
                        };

!                       mmc2@0 {
!                               allwinner,pins = "PC6", "PC7", "PC8", "PC9", "PC10", "PC11";
                                allwinner,function = "mmc2";
                                allwinner,drive = <0x2>;
                                allwinner,pull = <0x1>;
--- 1061,1068 ----
                                phandle = <0x1c>;
                        };

!                       mmc2_pins_a: ***@0 {
!                               allwinner,pins = "PC6", "PC7", "PC8", "PC9", "PC10", "PC11, "PC12", "PC13", "PC14", "PC15";
                                allwinner,function = "mmc2";
                                allwinner,drive = <0x2>;
                                allwinner,pull = <0x1>;

 

 

Unfortunately, adding 4 more pins and changing  bus-width from 4 to 8 cause syntax error on the line:

 allwinner,pins = "PC6", "PC7", "PC8", "PC9", "PC10", "PC11, "PC12", "PC13", "PC14", "PC15";

Probably 8-bit data bus is not supported like in kernel 4.2 but device tree is more precisely checked.

Link to comment
Share on other sites

Back to 4-bit data bus and errors at boot. Following changes were made:

 

 

*** lime2-orig.dts      2016-04-06 22:43:26.913995144 +0300
--- lime2-emmc.dts      2016-04-06 23:41:36.644639226 +0300
***************
*** 679,687 ****
                        clocks = <0x3 0xa 0x20 0x0 0x20 0x1 0x20 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "disabled";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                };

                mmc@01c12000 {
--- 679,694 ----
                        clocks = <0x3 0xa 0x20 0x0 0x20 0x1 0x20 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "okay";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
+
+                         pinctrl-names = "default";
+                         pinctrl-0 = <0x44>;
+                         vmmc-supply = <0x1d>;
+                         bus-width = <0x4>;
+                         non-removable;
+
                };

                mmc@01c12000 {
***************
*** 1059,1064 ****
--- 1066,1073 ----
                                allwinner,function = "mmc2";
                                allwinner,drive = <0x2>;
                                allwinner,pull = <0x1>;
+                               linux,phandle = <0x44>;
+                               phandle = <0x44>;
                        };

                        mmc3@0 {

 

 

and following messages around MMC were printed at boot:

 

 

root@lime2:~# dmesg | grep mmc
[    0.000000] Kernel command line: console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=7
[    3.379042] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    3.419057] sunxi-mmc 1c0f000.mmc: base:0xf0d78000 irq:26
[    3.455996] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.458740] mmc0: new high speed SDHC card at address 0007
[    3.458849] sunxi-mmc 1c11000.mmc: base:0xf0d7c000 irq:27
[    3.459674] mmcblk0: mmc0:0007 SD04G 3.71 GiB
[    3.461310]  mmcblk0: p1
[    3.469202] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 8, RTO !!
[    3.478046] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.478936] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.479789] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.480633] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.519522] mmc1: new DDR MMC card at address 0001
[    3.520319] mmcblk1: mmc1:0001 P1XXXX 3.60 GiB
[    3.520716] mmcblk1boot0: mmc1:0001 P1XXXX partition 1 16.0 MiB
[    3.521073] mmcblk1boot1: mmc1:0001 P1XXXX partition 2 16.0 MiB
[    3.522105] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.522178] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.522258] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    3.522291] blk_update_request: I/O error, dev mmcblk1, sector 0
[    3.522321] Buffer I/O error on dev mmcblk1, logical block 0, async page read
[    3.522677] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    3.522721] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    3.522785] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    3.522812] blk_update_request: I/O error, dev mmcblk1, sector 0
[    3.522835] Buffer I/O error on dev mmcblk1, logical block 0, async page read
[    3.522881]  mmcblk1: unable to read partition table
[    3.873261] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    5.767754] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.767877] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.767983] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    5.768018] blk_update_request: I/O error, dev mmcblk1, sector 7552896
[    5.769149] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.769250] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.771603] mmcblk1: timed out sending r/w cmd command, card status 0x900
[    5.771656] blk_update_request: I/O error, dev mmcblk1, sector 7552896
[    5.771685] Buffer I/O error on dev mmcblk1, logical block 944112, async page read
[    5.789405] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.789526] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.791786] mmcblk1boot1: timed out sending r/w cmd command, card status 0x900
[    5.791855] blk_update_request: I/O error, dev mmcblk1boot1, sector 32640
[    5.794884] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.795005] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.795124] mmcblk1boot0: timed out sending r/w cmd command, card status 0x900
[    5.795171] blk_update_request: I/O error, dev mmcblk1boot0, sector 32640
[    5.796339] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.796431] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.796531] mmcblk1boot1: timed out sending r/w cmd command, card status 0x900
[    5.796573] blk_update_request: I/O error, dev mmcblk1boot1, sector 32640
[    5.796603] Buffer I/O error on dev mmcblk1boot1, logical block 4080, async page read
[    5.797891] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 18, RD RTO !!
[    5.798037] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    5.798147] mmcblk1boot0: timed out sending r/w cmd command, card status 0x900
[    5.798192] blk_update_request: I/O error, dev mmcblk1boot0, sector 32640
[    5.798224] Buffer I/O error on dev mmcblk1boot0, logical block 4080, async page read
[    5.945461] EXT4-fs (mmcblk0p1): re-mounted. Opts: data=writeback,commit=600,errors=remount-ro

 

 

and ls and lsblk commands:

root@lime2:~# ls -la /dev/mmc*
brw-rw---- 1 root disk 179,  0 Apr  6 23:59 /dev/mmcblk0
brw-rw---- 1 root disk 179,  1 Apr  6 23:59 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,  8 Apr  6 23:58 /dev/mmcblk1
brw-rw---- 1 root disk 179, 16 Apr  6 23:58 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 24 Apr  6 23:58 /dev/mmcblk1boot1
root@lime2:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0   16M  1 disk
mmcblk1boot1 179:24   0   16M  1 disk
mmcblk0      179:0    0  3.7G  0 disk
└─mmcblk0p1  179:1    0  3.5G  0 part /
mmcblk1      179:8    0  3.6G  0 disk

Any ideas where I am wrong or what is missing?

Link to comment
Share on other sites

Fortunately, I find the syntax error in case of 8-bit data bus.

Unfortunately, messages for MMC2 at boot are:

 

 

[    3.379523] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    3.419193] sunxi-mmc 1c0f000.mmc: base:0xf0d78000 irq:26
[    3.419350] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC12
[    3.419393] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC13
[    3.419434] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC14
[    3.419474] sun7i-a20-pinctrl 1c20800.pinctrl: unsupported function mmc2 on pin PC15
[    4.188932] sunxi-mmc 1c11000.mmc: fatal err update clk timeout
[    4.196251] mmc0: host does not support reading read-only switch, assuming write-enable
[    4.199039] mmc0: new high speed SDHC card at address 0007
[    4.199802] mmcblk0: mmc0:0007 SD04G 3.71 GiB
[    4.201255]  mmcblk0: p1
[    4.209058] sunxi-mmc 1c11000.mmc: base:0xf0d7c000 irq:27
[    4.623425] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    5.978941] sunxi-mmc 1c11000.mmc: fatal err update clk timeout
[    6.728928] sunxi-mmc 1c11000.mmc: fatal err update clk timeout
[    7.478973] sunxi-mmc 1c11000.mmc: fatal err update clk timeout
[    8.326099] EXT4-fs (mmcblk0p1): re-mounted. Opts: data=writeback,commit=600,errors=remount-ro

 

 

the same as in kernel 4.2.3.

 

8-bit data bus for MMC2 (probably for all MMC) is not supported!

Link to comment
Share on other sites

Hi to All,

 

Finally Olimex published their new images rel. 5 with support for both A20-Olinuxino-Lime2-eMMC and A20-Olinuxino-Lime2-4GB boards.

You can find links to forum publication, their updated A20-Olinuxino-Lime2 wiki page and my first tests.

 

I have also try to apply changes to customized by me Armbian and succeed to build and boot it with following changes.

modified in lime2.fex:

[nand_para]
nand_used = 1 -> 0
...
[mmc2_para]
sdc_used = 0 -> 1
sdc_detmode = 1 -> 3

applied a20-emmc.patch

 

 

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5352cd7..2690b64 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -481,6 +481,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 
 	if (card->ext_csd.rev >= 5) {
 		/* check whether the eMMC card supports HPI */
+#if 0
+// comment for emmc HPI patch
 		if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1) {
 			card->ext_csd.hpi = 1;
 			if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2)
@@ -495,6 +497,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 				ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10;
 		}
 
+#endif
 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
 		card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
 	}

 

 

and changed in boot.cmd

root=/dev/mmcblk0p1 -> root=/dev/mmcblk1p1

In some unknown reason mmc2 (eMMC) is recognized and become /dev/mmcblk0 instead of /dev/mmcblk1 even it is not recognized by U-Boot

lsblk command reports:

root@egpr:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    0 55.9G  0 disk
├─sda1         8:1    0   50G  0 part /media/sda1
└─sda2         8:2    0  5.9G  0 part /media/sda2
mmcblk0boot0 179:8    0   16M  1 disk
mmcblk0boot1 179:16   0   16M  1 disk
mmcblk0      179:0    0  3.6G  0 disk
└─mmcblk0p1  179:1    0  3.6G  0 part /mnt
mmcblk1      179:24   0  3.7G  0 disk
└─mmcblk1p1  179:25   0  1.2G  0 part /

Note that mmcblk1p1 is 1.2G (size of striped partition) because resize2fs script is trying to resize mmcblk0p1

'ls -la /dev/mmc*' command reports:

root@egpr:~# ls -la /dev/mmc*
brw-rw---- 1 root disk 179,  0 Apr  8 21:44 /dev/mmcblk0
brw-rw---- 1 root disk 179,  8 Apr  8 21:53 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 16 Apr  8 21:44 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179,  1 Apr  8 21:44 /dev/mmcblk0p1
brw-rw---- 1 root disk 179, 24 Apr  8 21:44 /dev/mmcblk1
brw-rw---- 1 root disk 179, 25 Apr  8 21:44 /dev/mmcblk1p1

eMMC read and write performance is like at Olimex image:

root@egpr:~# dd if=/dev/zero of=/mnt/1GBfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 93.1988 s, 11.5 MB/s
root@egpr:~# dd of=/dev/null if=/mnt/1GBfile
2097152+0 records in
2097152+0 records out
1073741824 bytes (1.1 GB) copied, 84.7143 s, 12.7 MB/s

kernel boot mmc related messages:

 

 

root@egpr:~# dmesg | grep mmc
[    0.000000] Kernel command line: console=tty1 root=/dev/mmcblk1p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=7
[    1.821640] [mmc-msg] sw_mci_init
[    1.827405] [mmc-msg] MMC host used card: 0x5, boot card: 0x4, io_card 0
[    1.832777] [mmc-msg] sdc2 set round clock 400000, src 24000000
[    1.841036] [mmc-msg] sdc2 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.849272] [mmc-msg] sdc2 Probe: base:0xf05f2000 irq:66 sg_cpu:f05f4000(4fc00000) ret 0.
[    1.857182] [mmc-msg] sdc2 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.859644] [mmc-msg] sdc2 power on
[    1.864697] [mmc-msg] sdc0 set round clock 400000, src 24000000
[    1.872941] [mmc-msg] sdc0 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.881157] [mmc-msg] sdc0 Probe: base:0xf05f6000 irq:64 sg_cpu:f05f8000(4fc01000) ret 0.
[    1.885759] [mmc_pm]: failed to fetch sdio card configuration!
[    1.896534] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.901437] [mmc-msg] sdc2 set round clock 400000, src 24000000
[    1.984003] [mmc-err] smc 2 err, cmd 52,  RTO
[    1.989538] [mmc-err] smc 2 err, cmd 52,  RTO
[    1.997926] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.020029] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.026535] [mmc-err] smc 2 err, cmd 8,  RTO
[    2.033913] [mmc-err] smc 2 err, cmd 5,  RTO
[    2.037982] [mmc-err] smc 2 err, cmd 5,  RTO
[    2.045222] [mmc-err] smc 2 err, cmd 5,  RTO
[    2.052021] [mmc-err] smc 2 err, cmd 5,  RTO
[    2.056718] [mmc_pm]: No sdio card, please check your config !!
[    2.060062] [mmc-err] smc 2 err, cmd 55,  RTO
[    2.067079] [mmc-err] smc 2 err, cmd 55,  RTO
[    2.072672] [mmc-err] smc 2 err, cmd 55,  RTO
[    2.080825] [mmc-err] smc 2 err, cmd 55,  RTO
[    2.089200] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.105976] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.155877] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.164222] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.182772] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.256032] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    2.286686] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 8 timing LEGACY(SDR12) dt B
[    2.302574] [mmc-err] smc 2 err, cmd 8,  EBE
[    2.305808] [mmc-err] In data read operation
[    2.310860] [mmc-msg] found data error, need to send stop command
[    2.315590] [mmc-err] sdc 2 send stop command failed
[    2.320113] mmc0: unexpected status 0x400800 after switch
[    2.328478] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 4 timing LEGACY(SDR12) dt B
[    2.337969] mmc0: switch to highspeed failed
[    2.346508] [mmc-msg] sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 4 timing LEGACY(SDR12) dt B
[    2.351698] [mmc-msg] sdc2 set round clock 25000000, src 600000000
[    2.415388] [mmc-msg] sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 8 timing LEGACY(SDR12) dt B
[    2.419998] [mmc-err] smc 2 err, cmd 8,  EBE
[    2.423233] [mmc-err] In data read operation
[    2.428285] [mmc-msg] found data error, need to send stop command
[    2.432232] [mmc-err] sdc 2 send stop command failed
[    2.441719] [mmc-msg] sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 4 timing LEGACY(SDR12) dt B
[    2.446541] mmc0: new MMC card at address 0001
[    2.450629] mmcblk0: mmc0:0001 P1XXXX 3.60 GiB
[    2.455770] mmcblk0boot0: mmc0:0001 P1XXXX partition 1 16.0 MiB
[    2.460912] mmcblk0boot1: mmc0:0001 P1XXXX partition 2 16.0 MiB
[    2.463957]  mmcblk0: p1
[    2.473943] Dev Sunxi softw311 mmcblk0boot1 magic does not match for MBR 1:
[    2.480676] Dev Sunxi softw311 mmcblk0boot1 magic does not match for MBR 2:
[    2.487426] Dev Sunxi softw311 mmcblk0boot1 magic does not match for MBR 3:
[    2.494152] Dev Sunxi softw311 mmcblk0boot1 magic does not match for MBR 4:
[    2.502600] Dev Sunxi softw311 mmcblk0boot1 header bad for all MBR copies, MBR corrupted or not present.
[    2.509341] Dev Sunxi softw411 mmcblk0boot1 magic does not match for MBR 1:
[    2.516705] Dev Sunxi softw411 mmcblk0boot1 magic does not match for MBR 2:
[    2.524050] Dev Sunxi softw411 mmcblk0boot1 magic does not match for MBR 3:
[    2.531354] Dev Sunxi softw411 mmcblk0boot1 magic does not match for MBR 4:
[    2.539820] Dev Sunxi softw411 mmcblk0boot1 header bad for all MBR copies, MBR corrupted or not present.
[    2.543596]  mmcblk0boot1: unknown partition table
[    2.553282] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 1:
[    2.560012] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 2:
[    2.566752] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 3:
[    2.573482] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 4:
[    2.581924] Dev Sunxi softw311 mmcblk0boot0 header bad for all MBR copies, MBR corrupted or not present.
[    2.588691] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 1:
[    2.596053] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 2:
[    2.603371] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 3:
[    2.610674] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 4:
[    2.619158] Dev Sunxi softw411 mmcblk0boot0 header bad for all MBR copies, MBR corrupted or not present.
[    2.622938]  mmcblk0boot0: unknown partition table
[    2.865398] [mmc-msg] mmc 0 detect change, present 1
[    3.364409] [mmc-msg] sdc0 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.366894] [mmc-msg] sdc0 power on
[    3.394849] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.399790] [mmc-msg] sdc0 set round clock 400000, src 24000000
[    3.472199] [mmc-err] smc 0 err, cmd 52,  RTO
[    3.476347] [mmc-err] smc 0 err, cmd 52,  RTO
[    3.484712] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.495488] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.500870] [mmc-err] smc 0 err, cmd 5,  RTO
[    3.504922] [mmc-err] smc 0 err, cmd 5,  RTO
[    3.510825] [mmc-err] smc 0 err, cmd 5,  RTO
[    3.517366] [mmc-err] smc 0 err, cmd 5,  RTO
[    3.526421] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.534769] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.545567] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    3.610446] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[    3.618903] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[    3.624082] [mmc-msg] sdc0 set round clock 42857143, src 600000000
[    3.632115] Waiting for root device /dev/mmcblk1p1...
[    3.687618] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B
[    3.692420] mmc1: new high speed SDHC card at address 0002
[    3.696623] mmcblk1: mmc1:0002 00000 3.70 GiB
[    3.699965]  mmcblk1: p1
[    3.760683] EXT4-fs (mmcblk1p1): mounted filesystem with writeback data mode. Opts: (null)
[   17.285937] EXT4-fs (mmcblk1p1): re-mounted. Opts: data=writeback,commit=600,errors=remount-ro
[   33.349637] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 1:
[   33.365043] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 2:
[   33.378066] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 3:
[   33.391128] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 4:
[   33.407035] Dev Sunxi softw311 mmcblk0boot0 header bad for all MBR copies, MBR corrupted or not present.
[   33.421293] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 1:
[   33.435493] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 2:
[   33.448904] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 3:
[   33.462262] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 4:
[   33.476623] Dev Sunxi softw411 mmcblk0boot0 header bad for all MBR copies, MBR corrupted or not present.
[   33.486312]  mmcblk0boot0: unknown partition table
[   33.509603] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 1:
[   33.523581] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 2:
[   33.538109] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 3:
[   33.550973] Dev Sunxi softw311 mmcblk0boot0 magic does not match for MBR 4:
[   33.565396] Dev Sunxi softw311 mmcblk0boot0 header bad for all MBR copies, MBR corrupted or not present.
[   33.578210] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 1:
[   33.591659] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 2:
[   33.604984] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 3:
[   33.618394] Dev Sunxi softw411 mmcblk0boot0 magic does not match for MBR 4:
[   33.632633] Dev Sunxi softw411 mmcblk0boot0 header bad for all MBR copies, MBR corrupted or not present.
[   33.642241]  mmcblk0boot0: unknown partition table
[  267.127146] EXT4-fs (mmcblk0p1): recovery complete
[  267.139992] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)

 

 

are quite different from once in Olimex image probably because of kernel version difference (3.4.111 vs. 3.4.103).

Note that kernel initialize sdc2 (eMMC) first which explains mmc device numbering.

 

Proposed by Olimex fix_gigabit_phy.patch to fix GBit Ethernet was not applied by me because I have found it is working before.

Unfortunately, the speed is not proven to be a GBit (~9 MB/s at download of 1GB file from eMMC).

 

Next step will be to patch u_Boot to recognize eMMC on A20-OLinuXIno-Lime2-eMMC board and change boot script to boot from both SD Card and eMMC

 

Best regards

Chris

Link to comment
Share on other sites

Hi to All,

 

I have successfully build and boot Armbian 5.07 with mainline kernel 4.4.6 supporting eMMC on A20-OLinuXIno-Lime2-eMMC board.

For successful booting I add in userpatches/lib.config:

BOOTBRANCH=v2015.10

in userpatches/kernel/sunxi-next I add a20-lime2-emmc-mainline.patch

 

 

*** a/drivers/mmc/core/mmc.c
--- b/drivers/mmc/core/mmc.c
***************
*** 504,510 ****
  				pr_debug("%s: MAN_BKOPS_EN bit is not set\n",
  					mmc_hostname(card->host));
  		}
! 
  		/* check whether the eMMC card supports HPI */
  		if (!broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) {
  			card->ext_csd.hpi = 1;
--- 504,510 ----
  				pr_debug("%s: MAN_BKOPS_EN bit is not set\n",
  					mmc_hostname(card->host));
  		}
! #if 0
  		/* check whether the eMMC card supports HPI */
  		if (!broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) {
  			card->ext_csd.hpi = 1;
***************
*** 519,525 ****
  			card->ext_csd.out_of_int_time =
  				ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10;
  		}
! 
  		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
  		card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
  
--- 519,525 ----
  			card->ext_csd.out_of_int_time =
  				ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10;
  		}
! #endif
  		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
  		card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];

 

 

after building of the image and booting I did:

 

 

cd /boot/dtb
cp sun7i-a20-olinuxino-lime2.dtb sun7i-a20-olinuxino-lime2-orig.dtb
dtc -I dtb -O dts -o sun7i-a20-olinuxino-lime2.dts sun7i-a20-olinuxino-lime2.dtb
patch a20-lime2-emmc-dts.patch
dtc -O dtb -I dts -o sun7i-a20-olinuxino-lime2.dtb sun7i-a20-olinuxino-lime2.dts
reboot

 

 

where a20-lime2-emmc-dts.patch is:

 

 

*** sun7i-a20-olinuxino-lime2-orig.dts  2016-04-09 02:47:00.101190981 +0300
--- sun7i-a20-olinuxino-lime2.dts       2016-04-09 02:27:17.176556131 +0300
***************
*** 657,665 ****
                        clocks = <0x3 0xa 0x1e 0x0 0x1e 0x1 0x1e 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "disabled";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                };

                mmc@01c12000 {
--- 657,670 ----
                        clocks = <0x3 0xa 0x1e 0x0 0x1e 0x1 0x1e 0x2>;
                        clock-names = "ahb", "mmc", "output", "sample";
                        interrupts = <0x0 0x22 0x4>;
!                       status = "okay";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
+                         pinctrl-names = "default";
+                         pinctrl-0 = <0x44>;
+                         vmmc-supply = <0x1b>;
+                         bus-width = <0x4>;
+                         non-removable;
                };

                mmc@01c12000 {
***************
*** 1037,1042 ****
--- 1042,1049 ----
                                allwinner,function = "mmc2";
                                allwinner,drive = <0x2>;
                                allwinner,pull = <0x1>;
+                                 linux,phandle = <0x44>;
+                                 phandle = <0x44>;
                        };

                        mmc3@0 {

 

 

Note that line vmmc-supply = <0x1b>; have to refer the same vmmc-supply as mmc@1c0f000

After booting you can find following messages:

 

 

root@lime2:~# dmesg | grep mmc
[    0.000000] Kernel command line: console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=1
[    3.507580] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[    3.508239] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    3.541444] sunxi-mmc 1c0f000.mmc: base:0xf0d74000 irq:26
[    3.541852] sunxi-mmc 1c11000.mmc: No vqmmc regulator found
[    3.578459] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.581220] sunxi-mmc 1c11000.mmc: base:0xf0d78000 irq:27
[    3.581231] mmc0: new high speed SDHC card at address 0007
[    3.582212] mmcblk0: mmc0:0007 SD04G 3.71 GiB
[    3.583827]  mmcblk0: p1
[    3.590844] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 8, RTO !!
[    3.595044] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.595903] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.596757] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.597616] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    3.635082] mmc1: MAN_BKOPS_EN bit is not set
[    3.641879] mmc1: new high speed MMC card at address 0001
[    3.642725] mmcblk1: mmc1:0001 P1XXXX 3.60 GiB
[    3.643152] mmcblk1boot0: mmc1:0001 P1XXXX partition 1 16.0 MiB
[    3.643606] mmcblk1boot1: mmc1:0001 P1XXXX partition 2 16.0 MiB
[    3.644792]  mmcblk1: p1
[    4.024224] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[    6.338350] EXT4-fs (mmcblk0p1): re-mounted. Opts: data=writeback,commit=600,errors=remount-ro

 

 

lsblk command reports:

root@lime2:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0   16M  1 disk
mmcblk1boot1 179:24   0   16M  1 disk
mmcblk0      179:0    0  3.7G  0 disk
└─mmcblk0p1  179:1    0  3.5G  0 part /
mmcblk1      179:8    0  3.6G  0 disk
└─mmcblk1p1  179:9    0  3.6G  0 part

The good news is that mmc0 was registered as device mmcblk0 so no changes have to be made at boot script.

'ls -la /dev/mmc*':

root@lime2:~# ls -la /dev/mmc*
brw-rw---- 1 root disk 179,  0 Apr  9 02:54 /dev/mmcblk0
brw-rw---- 1 root disk 179,  1 Apr  9 02:54 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,  8 Apr  9 02:53 /dev/mmcblk1
brw-rw---- 1 root disk 179, 16 Apr  9 02:53 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 24 Apr  9 02:53 /dev/mmcblk1boot1
brw-rw---- 1 root disk 179,  9 Apr  9 02:53 /dev/mmcblk1p1

'fdisk /dev/mmcblk1'

root@lime2:~# fdisk /dev/mmcblk1
...
Command (m for help): p
Disk /dev/mmcblk1: 3.6 GiB, 3867148288 bytes, 7553024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe84940b0

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk1p1       2048 7553023 7550976  3.6G 83 Linux

eMMC read and write performance is better then with default kernel 3.4.111 (especially at reading):

root@lime2:~# dd if=/dev/zero of=/mnt/1GBfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 81.1107 s, 13.2 MB/s
root@lime2:~# dd of=/dev/null if=/mnt/1GBfile
2097152+0 records in
2097152+0 records out
1073741824 bytes (1.1 GB) copied, 49.7389 s, 21.6 MB/s

Ethernet is connected as:

[  686.791628] sun7i-dwmac 1c50000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[  686.791706] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Network performance measured by scp command is like with default kernel 3.4.111:

root@chr-vm-yocto:/data# scp root@192.168.1.190:/mnt/1GBfile .
root@192.168.1.190's password: 
1GBfile                                                  100% 1024MB   8.2MB/s   02:05    

More test should be done to prove if the Ethernet connection is really GBit.

 

Best ragards

Chris

Link to comment
Share on other sites

Network performance

 

can't be measured by using scp! Your A20 was busy at 100% and you tested the speed of SSH encryption algorithms (that are negotiated dynamically between client and server so they may vary between different test nodes) and not network: http://linux-sunxi.org/Sunxi_devices_as_NAS#Use_the_right_tools

 

Use iperf/iperf3 -- it's far from perfect but not broken by design as scp.

Link to comment
Share on other sites

Thanks tkaizer,

 

I plan to use iperf for network performance measurement.

 

Conversely to my first observation Ethernet did not work at GBit LAN at any board with Armbian.

So as a beginning I need to solve the issue but

  • Olimex have a fix_gigabit_phy.patch they for kernel 3.4.103 to solve the issue of slow Ethernet at GBit LAN.
  • Unfortunately, patched file drivers/net/phy/phy.c in kernel 3.4.111 and 4.4.6 is completely different and patch is useless.

 

The patch itself is:

 

 

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c8d08e8..3c4eafb 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -170,6 +170,11 @@ int genphy_config_aneg(struct phy_device *phydev)
 {
 	int result;
 
+	/* If PHY id is RTL8211CL then force MASTER configuration.
+	 * No that two master PHYs cannot be connected directly! */
+	if(phydev->phy_id == 0x001cc912)
+		phy_write(phydev, MDIO_DEVAD_NONE, 0x09, 0x1B00);
+
 	if (AUTONEG_ENABLE != phydev->autoneg)
 		return genphy_setup_forced(phydev);

 

 

Any ideas how to solve the problem?

 

EDIT:

Unfortunately, the file to path is also different in sunxi Linux repository.

Fortunately, the same staff is present in file drivers/net/phy/phy_device.c.

Is it safe to apply the patch to the second file?

 

SECOND EDIT: The patch if U-Boot related.

 

Best regards

Chris

Link to comment
Share on other sites

Meanwhile I try to apply similar path to file drivers/net/phy/phy_device.c:

 

 

*** a/drivers/net/phy/phy_device.c
--- b/drivers/net/phy/phy_device.c
***************
*** 933,938 ****
--- 933,943 ----
  {
  	int result;
  
+ 	/* If PHY id is RTL8211CL then force MASTER configuration.
+ 	 * No that two master PHYs cannot be connected directly! */
+ 	if(phydev->phy_id == 0x001cc912)
+ 		phy_write(phydev, MDIO_DEVAD_NONE, 0x09, 0x1B00);
+ 
  	if (AUTONEG_ENABLE != phydev->autoneg)
  		return genphy_setup_forced(phydev);
  

 

 

In some reason kernel compile process crashes. May be the patch is wrong.

 

EDIT: patch is for u-boot

 

How can I create patch after modifying some file in source tree (kernel for example)?

Have I to double the tree or the file inside original tree?

What command should I use: 'diff -c ...' or 'diff --git ...'?

 

EDIT:

  • Make first build without modification of the file(s)
  • edit the file(s) you want to modify
  • re-build with 'FORCE_CHECKOUT = "no"' option in compile.sh and test modification(s)
  • inside the source tree issue command 'git diff modified_file.x > /path-to-patches/modified_file.patch'
  • if more than a file is modified concatenate all files patches in a single file (respect the order if important)
  • re-build with 'FORCE_CHECKOUT = "yes"' option in compile.sh

Sorry for the "noise"

Link to comment
Share on other sites

I test creating of patch with 'git diff phy_device.c > a20_gigabit_slow.patch' command (after modifying drivers/net/phy/phy_device. file):

 

 

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 0bfbaba..a8172ab 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -933,6 +933,11 @@ int genphy_config_aneg(struct phy_device *phydev)
 {
     int result;
 
+    /* If PHY id is RTL8211CL then force MASTER configuration.
+     * No that two master PHYs cannot be connected directly! */
+    if(phydev->phy_id == 0x001cc912)
+        phy_write(phydev, MDIO_DEVAD_NONE, 0x09, 0x1B00);
+
     if (AUTONEG_ENABLE != phydev->autoneg)
         return genphy_setup_forced(phydev);
  

 

 

and put it in userpatches/kernel/sunxi-next folder.

Unfortunately, file is patched but kernel compile process crashes at the same place.

 

Where is my fault?

 

EDIT: The patch is not for this file even it is not for kernel but for u-boot

Link to comment
Share on other sites

The fault is to try to patch kernel instead of u-boot.

The Olimex patch:

 

 

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c8d08e8..3c4eafb 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -170,6 +170,11 @@ int genphy_config_aneg(struct phy_device *phydev)
 {
 	int result;
 
+	/* If PHY id is RTL8211CL then force MASTER configuration.
+	 * No that two master PHYs cannot be connected directly! */
+	if(phydev->phy_id == 0x001cc912)
+		phy_write(phydev, MDIO_DEVAD_NONE, 0x09, 0x1B00);
+
 	if (AUTONEG_ENABLE != phydev->autoneg)
 		return genphy_setup_forced(phydev);
 

 

 

is for the U-Boot and verified to have effect with v2015.10.

Alternative patch is proposed by Michael Haas here.

 

The result is higher then 100 Mbps performance while Lime2 Ethernet port is connected to GBit switch.

 

 

root@lime2:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ ID] Interval       Transfer     Bandwidth
[  4] local 192.168.1.190 port 5001 connected with 192.168.1.132 port 55851
[  4]  0.0-10.0 sec   280 MBytes   235 Mbits/sec
[  5] local 192.168.1.190 port 5001 connected with 192.168.1.132 port 55852
[  5]  0.0-10.3 sec   308 MBytes   250 Mbits/sec
[  4] local 192.168.1.190 port 5001 connected with 192.168.1.132 port 55853
[  4]  0.0-10.3 sec   300 MBytes   244 Mbits/sec

 

 

Link to comment
Share on other sites

I have succeed to patch U_Boot (v2015.10) for being able to recognize eMMC on Lime2-eMMC board by following patch:

 

 

diff --git a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
index 8acff78..3cdc5d1 100644
--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
@@ -182,6 +182,15 @@
 	status = "okay";
 };
 
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins_a>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
diff --git a/configs/A20-OLinuXino-Lime2_defconfig b/configs/A20-OLinuXino-Lime2_defconfig
index c9d0f47..1b1ea27 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_USB0_VBUS_PIN="PC17"
 CONFIG_USB0_VBUS_DET="PH5"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2"

 

 

At boot u-boot reports:

 

 

U-Boot SPL 2015.10-armbian (Apr 10 2016 - 03:25:06)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2


U-Boot 2015.10-armbian (Apr 10 2016 - 03:25:06 +0300) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0 (SD), SUNXI SD/MMC: 1

 

 

From u-boot:

 

 

=> mmc list
SUNXI SD/MMC: 0 (SD)
SUNXI SD/MMC: 1

=> mmc dev 0 0
switch to partitions #0, OK
mmc0 is current device
=> mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            7374849         00064c66-01     83
=> mmc info
Device: SUNXI SD/MMC
Manufacturer ID: 27
OEM: 5048
Name: SD04G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

=> mmc dev 1 1
switch to partitions #1, OK
mmc1(part 1) is current device
=> mmc part

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            7550976         e84940b0-01     83
=> mmc info
Device: SUNXI SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: P1XXX
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.5
High Capacity: Yes
Capacity: 16 MiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 3.6 GiB
Boot Capacity: 16 MiB ENH
RPMB Capacity: 128 KiB ENH

 

 

Final patch for the mainline kernel (4.4) to recognize eMMC on Lime2-eMMC board is:

 

 

diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
index d5c796c..1f5339d 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
@@ -188,6 +188,15 @@
 	status = "okay";
 };
 
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins_a>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3d5087b..78668aa 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -504,7 +504,7 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
 				pr_info("%s: MAN_BKOPS_EN bit is not set\n",
 					mmc_hostname(card->host));
 		}
-
+#if 0
 		/* check whether the eMMC card supports HPI */
 		if (!broken_hpi && (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1)) {
 			card->ext_csd.hpi = 1;
@@ -519,7 +519,7 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
 			card->ext_csd.out_of_int_time =
 				ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10;
 		}
-
+#endif
 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
 		card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
 

 

 

it makes eMMC usable as /dev/mmcblk1 and works fine.

 

It is time to prepare u-boot script to boot from eMMC

Link to comment
Share on other sites

The patches for default case (legacy kernel 3.4)

userpatches/kernel/sun7i-default/a20-lime-emmc-kernel-default.patch

 

 

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5352cd7..2690b64 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -481,6 +481,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 
 	if (card->ext_csd.rev >= 5) {
 		/* check whether the eMMC card supports HPI */
+#if 0
+// comment for emmc HPI patch
 		if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1) {
 			card->ext_csd.hpi = 1;
 			if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2)
@@ -495,6 +497,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 				ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10;
 		}
 
+#endif
 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
 		card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
 	}

 

 

Copy lib/config/lime2.fex as lib/config/lime2-emmc.fex and use following patch:

 

 

*** lime2.fex	2016-03-31 22:55:01.541095080 +0300
--- lime2-emmc.fex	2016-04-10 04:58:59.071927637 +0300
***************
*** 315,321 ****
  leds_trigger_1 = "mmc0"
  
  [nand_para]
! nand_used = 1
  nand_we = port:PC00<2><default><default><default>
  nand_ale = port:PC01<2><default><default><default>
  nand_cle = port:PC02<2><default><default><default>
--- 315,321 ----
  leds_trigger_1 = "mmc0"
  
  [nand_para]
! nand_used = 0
  nand_we = port:PC00<2><default><default><default>
  nand_ale = port:PC01<2><default><default><default>
  nand_cle = port:PC02<2><default><default><default>
***************
*** 648,654 ****
  sdc_regulator = "none"
  
  [mmc2_para]
! sdc_used = 0
  sdc_detmode = 3
  sdc_buswidth = 4
  sdc_cmd = port:PC06<3><1><2><default>
--- 648,654 ----
  sdc_regulator = "none"
  
  [mmc2_para]
! sdc_used = 1
  sdc_detmode = 3
  sdc_buswidth = 4
  sdc_cmd = port:PC06<3><1><2><default>

 

 

I personally prefer to keep lime2-emmc.fex outside Armbian source tree and to overwrite /boot/bin/lime2.bin file in customization phase.

Link to comment
Share on other sites

Hi to All,

 

Thanks to tkaize's post I succeeded to install and customize RPI Monitor 2.10 in Armbian 5.07 with Kernel 4.4.6 and run it on A20-Olinuxino-Lime2-eMMC.

 

You can find the report of the series of thermal and power tests done with and without CPU and Network load in the attached file.

 

The good news is that there are no hangs while testing even the temperatures of both CPU and PMU chips go up to 58°C.

 

EDIT:

  • Forget to mention that the tested board is out of a box (horizontal placed) and CPU has ALUMINIUM-HEATSINK-20x20x6MM.
  • Attachment slightly modified with event and Network bandwidth marks around the graphics.

 

Best regards

Chris

Armbian-5.07_Kernel-4.4.6_A20-Lime2-eMMC_Power-Thermal-Tests.pdf

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