Author Topic: Building u-boot and kernel for mmc on C2  (Read 98798 times)

yang.zheng

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #90 on: December 30, 2013, 08:45:00 pm »
Hi Patwood,

The problem I met with branch pat-3.4.67:

It would be branch pat-3.4.67 which I planned to try today. I got it with:
   git clone -b pat-3.4.67 https://github.com/patrickhwood/linux-sunxi
And confirmed with :
    git branch -r  (head - > pat-3.4.67)
    git branch -l   (* pat-3.4.67)

Then I copied config.3.4.67-sun7i+ as .config from http://dl.cubieforums.com/patwood/A20-kernel-3.4.67.tar.gz. Following your tutorial in this thread, of course, the uImage and modules were compiled successfully.
==> BUT, I never noticed until I  found that the modules were outputed to "lib/modules/3.4.75-sun7i+" NOT 3.4.67, and .config was changed to 3.4.75 also (line 3).

Q: What's wrong in my steps?

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #91 on: December 30, 2013, 11:26:35 pm »
Hi Patwood,

The problem I met with branch pat-3.4.67:

It would be branch pat-3.4.67 which I planned to try today. I got it with:
   git clone -b pat-3.4.67 https://github.com/patrickhwood/linux-sunxi
And confirmed with :
    git branch -r  (head - > pat-3.4.67)
    git branch -l   (* pat-3.4.67)

Then I copied config.3.4.67-sun7i+ as .config from http://dl.cubieforums.com/patwood/A20-kernel-3.4.67.tar.gz. Following your tutorial in this thread, of course, the uImage and modules were compiled successfully.
==> BUT, I never noticed until I  found that the modules were outputed to "lib/modules/3.4.75-sun7i+" NOT 3.4.67, and .config was changed to 3.4.75 also (line 3).

Q: What's wrong in my steps?

Nothing.  I recently updated this branch with the latest code from the linux-sunxi git repo, and it pulled in the 3.4.75 update.  This branch now matches the pat-3.4.75 branch.  You can check out commit fbd93d81347802bd9fe734250ab0bb7a61448673 if you want the final 3.4.67 tree.

As for the I2C problem, did you modify the script.bin to match the I2C settings from the A10?

yang.zheng

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #92 on: December 31, 2013, 02:08:21 am »
Hi Patwood,
....
==> BUT, I never noticed until I  found that the modules were outputed to "lib/modules/3.4.75-sun7i+" NOT 3.4.67, and .config was changed to 3.4.75 also (line 3).

Q: What's wrong in my steps?

Nothing.  I recently updated this branch with the latest code from the linux-sunxi git repo, and it pulled in the 3.4.75 update.  This branch now matches the pat-3.4.75 branch.  You can check out commit fbd93d81347802bd9fe734250ab0bb7a61448673 if you want the final 3.4.67 tree.

As for the I2C problem, did you modify the script.bin to match the I2C settings from the A10?

Yes. I modified script.fex as following:

[twi1_para]
twi1_used = 1
twi1_scl = port:PB18<2><default><default><default>
twi1_sda = port:PB19<2><default><default><default>

[ctp_para]
ctp_used = 1
ctp_name = "ft5x_ts"
ctp_twi_id = 1
ctp_twi_addr = 0x38
ctp_screen_max_x = 1024
ctp_screen_max_y = 768
ctp_revert_x_flag = 0
ctp_revert_y_flag = 0
ctp_exchange_x_y_flag = 1
ctp_firm = 1
ctp_int_port = port:PH7<6><default><default><default>
ctp_wakeup = port:PB13<1><default><default><1>
ctp_io_port = port:PH21<0><default><default><default>
« Last Edit: December 31, 2013, 02:12:38 am by yang.zheng »

yang.zheng

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #93 on: December 31, 2013, 08:01:45 am »
Regarding to the outputs from pr_info, I tried it without irq mod IRQF_TRIGGER_FALLING like

  err = request_irq(SW_INT_IRQNO_PIO, ft5x_ts_interrupt, IRQF_SHARED, "ft5x_ts", ft5x_ts);

then the module can be installed correctly.  And /dev/input/mouse0 was created, touching panel will write data into that device.

It's urgly but clicking works now at least.

I hope I can know why.

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #94 on: January 01, 2014, 11:59:03 am »
It looks like the A20 has a different interrupt controller from the A10 (ARM Cortex A7 vs Cortex A8), and this code indicates that the FALLING IRQ isn't handled: at line 191 in arch/arm/common/gic.c:

    if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
        return -EINVAL;

According to Documentation/devicetree/bindings/arm/gic.txt, the GIC is the ARM Generic Interrupt Controller and is used on SMP cores.  I've noticed in the past that the A10 and A20 have different interrupt numbering (the A20 numbering is offset by 32; this appears to be due to the fact that there are 32 internal interrupts that are reserved for each SMP core, so external interrupts, which can be handled by either core, start after these).

If the driver works without the IRQF_TRIGGER_FALLING flag, then it should be tested on the A10 and the change submitted to the linux-sunxi mailing list.

Offline ahrovan

  • Full Member
  • ***
  • Posts: 120
  • Karma: +10/-0
    • View Profile
    • BirRoboticGroup
Re: Building u-boot and kernel for mmc on C2
« Reply #95 on: January 24, 2014, 03:18:03 pm »
Hi-in virtualbox lubuntu-13.04 installed gcc isn't gcc 4.6.3 version -when make Erorr ::

Code: [Select]
/usr/src/linux# make menuconfig
  HOSTCC  scripts/basic/fixdep
/bin/sh: line 1: gcc: command not found
make[1]: *** [scripts/basic/fixdep] Error 127
make: *** [scripts_basic] Error 2

can I solve that ??

Offline ahrovan

  • Full Member
  • ***
  • Posts: 120
  • Karma: +10/-0
    • View Profile
    • BirRoboticGroup
Re: Building u-boot and kernel for mmc on C2
« Reply #96 on: January 25, 2014, 02:47:14 pm »
I follow this tutorials ::
http://docs.cubieboard.org/tutorials/dvk521/documentations/a20/kernel_porting_and_configuration
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
linaro-precise-alip-201209 was written into SD card - now for Config the kernel should copy new kernel into CB2 or run (in the virtualbox Lubuntu)?

Config the kernel (in the virtualbox Lubuntu)

Under the root directory, enter:

Code: [Select]
#make menuconfig
Config the kernel on the popup window, as shown in the picture below:
 (in the virtualbox Lubuntu)


what should change in kernel configuration page - ?

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Quote
Compile the kernel

Under the root directory, enter:
Code: [Select]
#make uImage

but error occurd  :-\
Code: [Select]
root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20# make menuconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig


Your configuration changes were NOT saved.

root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20# make uImage
make: arm-linux-gnueabihf-gcc: Command not found
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
#
# configuration written to .config
#
make: arm-linux-gnueabihf-gcc: Command not found
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
/bin/sh: 1: arm-linux-gnueabihf-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20# cd rootfs
root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20/rootfs# cd rootfs
bash: cd: rootfs: No such file or directory
root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20/rootfs# make uImage
make: *** No rule to make target `uImage'.  Stop.
root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20/rootfs# make uImage
make: *** No rule to make target `uImage'.  Stop.
root@Arovan:/home/ahrovan/cb/linux-sunxi-sunxi-3.4.61_A20/rootfs# make uImage

Quote
It will take much time to complete the compiling. When completed, the compressed kernel image will be generated under linux-sunxi-sunxi-3.4.61_A20/arch/arm/boot directory.
after finish this step - which files should copy into cubieboard? - I know kernel and uimage created -- now must copy this file into sd-card??

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #97 on: January 25, 2014, 05:17:58 pm »
Well, you don't seem to have any of the armhf tools installed.  Did you read through the wiki to find out about installing the proper toolchain? http://linux-sunxi.org/Toolchain  Did you read about building and installing the kernel? http://linux-sunxi.org/Linux_Kernel#Build  Did you read the first post in this thread? http://www.cubieforums.com/index.php/topic,472.0.html

Offline ahrovan

  • Full Member
  • ***
  • Posts: 120
  • Karma: +10/-0
    • View Profile
    • BirRoboticGroup
Re: Building u-boot and kernel for mmc on C2
« Reply #98 on: January 27, 2014, 05:49:39 am »
Compiler ::
I choose lubuntu-12.04-desktop-i386 :

http://cdimage.ubuntu.com/lubuntu/releases/12.04/release/lubuntu-12.04-desktop-i386.list
Code: [Select]
/pool/main/f/fakeroot/fakeroot_1.18.2-1_i386.deb
/pool/main/g/gcc-4.6/g++-4.6_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/gcc-4.6_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/libgomp1_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/libquadmath0_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/libstdc++6-4.6-dev_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-defaults/g++_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-defaults/gcc_4.6.3-1ubuntu5_i386.deb
/pool/main/l/lupin/lupin-support_0.51_i386.deb

gcc-4.6_4.6.3-1ubuntu5_i386.deb  is ok ?

Toolchain ::

Code: [Select]
sudo add-apt-repository ppa:linaro-maintainers/toolchain
   sudo apt-get update
   sudo apt-get install gcc-arm-linux-gnueabi

 sudo apt-get install gcc-arm-linux-gnueabi >> ask for install gcc 4.7 >> Ctrl+z  >> Cancel is 4.7?

is nessecesy install Linaro toolchain and Code Sourcery ::

Linaro toolchain :

 at this page http://linux-sunxi.org/Toolchain follow this link https://launchpad.net/linaro-toolchain-binaries/+download and find ::

Quote
download gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.xz (md5, sig)   arm-linux-gnueabihf crosscompiler for Linux

find a bin directory in there but gcc version is 4.7 ?? continue and add it to the environment ??



 :) Thanks
« Last Edit: January 27, 2014, 08:19:08 am by ahrovan »

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #99 on: January 27, 2014, 02:33:47 pm »
Compiler ::
I choose lubuntu-12.04-desktop-i386 :

http://cdimage.ubuntu.com/lubuntu/releases/12.04/release/lubuntu-12.04-desktop-i386.list
Code: [Select]
/pool/main/f/fakeroot/fakeroot_1.18.2-1_i386.deb
/pool/main/g/gcc-4.6/g++-4.6_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/gcc-4.6_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/libgomp1_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/libquadmath0_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-4.6/libstdc++6-4.6-dev_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-defaults/g++_4.6.3-1ubuntu5_i386.deb
/pool/main/g/gcc-defaults/gcc_4.6.3-1ubuntu5_i386.deb
/pool/main/l/lupin/lupin-support_0.51_i386.deb

gcc-4.6_4.6.3-1ubuntu5_i386.deb  is ok ?

The x86 gcc compiler version doesn't matter.  It really doesn't get used to build an ARM kernel.

Quote
Toolchain ::

Code: [Select]
sudo add-apt-repository ppa:linaro-maintainers/toolchain
   sudo apt-get update
   sudo apt-get install gcc-arm-linux-gnueabi

 sudo apt-get install gcc-arm-linux-gnueabi >> ask for install gcc 4.7 >> Ctrl+z  >> Cancel is 4.7?

is nessecesy install Linaro toolchain and Code Sourcery ::

Linaro toolchain :

 at this page http://linux-sunxi.org/Toolchain follow this link https://launchpad.net/linaro-toolchain-binaries/+download and find ::

Quote
download gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.xz (md5, sig)   arm-linux-gnueabihf crosscompiler for Linux

find a bin directory in there but gcc version is 4.7 ?? continue and add it to the environment ??



 :) Thanks

There have been problems building the 3.4 kernel with gcc 4.7; if you can get 4.6, that's preferred.  If you can't, there's a kernel patch that's supposed to fix this. I haven't tested it, but I did push it to the pat-3.4.75 branch on my github repo (https://github.com/patrickhwood/linux-sunxi).
« Last Edit: January 27, 2014, 02:36:53 pm by patwood »

Offline mqlopes

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #100 on: February 03, 2014, 06:06:00 pm »
Hello,

First thanks for your wonderful work.

I am trying to compile the kernel following the 1st post, but the process stops at this point (make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage):

drivers/built-in.o: In function `axp20_init_chip':
/home/linux-sunxi/drivers/power/axp_power/axp20-mfd.h:149: undefined reference to `hwmon_device_register'
drivers/built-in.o: In function `axp_mfd_remove':
/home/linux-sunxi/drivers/power/axp_power/axp-mfd.c:368: undefined reference to `hwmon_device_unregister'
make: *** [.tmp_vmlinux1] Error 1

My compiler: gcc version 4.6.3 20120624 (prerelease) (Ubuntu/Linaro 4.6.3-8ubuntu1~ppa1)

Thanks for helping!


Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #101 on: February 03, 2014, 07:14:08 pm »
Hello,

First thanks for your wonderful work.

I am trying to compile the kernel following the 1st post, but the process stops at this point (make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage):

drivers/built-in.o: In function `axp20_init_chip':
/home/linux-sunxi/drivers/power/axp_power/axp20-mfd.h:149: undefined reference to `hwmon_device_register'
drivers/built-in.o: In function `axp_mfd_remove':
/home/linux-sunxi/drivers/power/axp_power/axp-mfd.c:368: undefined reference to `hwmon_device_unregister'
make: *** [.tmp_vmlinux1] Error 1

My compiler: gcc version 4.6.3 20120624 (prerelease) (Ubuntu/Linaro 4.6.3-8ubuntu1~ppa1)

Thanks for helping!

You probably have CONFIG_AXP_HWMON=y but CONFIG_HWMON is either not enabled or set to "m".

Offline mqlopes

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #102 on: February 03, 2014, 10:01:26 pm »
Hello,

First thanks for your wonderful work.

I am trying to compile the kernel following the 1st post, but the process stops at this point (make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage):

drivers/built-in.o: In function `axp20_init_chip':
/home/linux-sunxi/drivers/power/axp_power/axp20-mfd.h:149: undefined reference to `hwmon_device_register'
drivers/built-in.o: In function `axp_mfd_remove':
/home/linux-sunxi/drivers/power/axp_power/axp-mfd.c:368: undefined reference to `hwmon_device_unregister'
make: *** [.tmp_vmlinux1] Error 1

My compiler: gcc version 4.6.3 20120624 (prerelease) (Ubuntu/Linaro 4.6.3-8ubuntu1~ppa1)

Thanks for helping!

You probably have CONFIG_AXP_HWMON=y but CONFIG_HWMON is either not enabled or set to "m".

Thanks a lot, patwood! It worked...

Offline mqlopes

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #103 on: February 04, 2014, 06:53:22 am »
Hello,

First thanks for your wonderful work.

I am trying to compile the kernel following the 1st post, but the process stops at this point (make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage):

drivers/built-in.o: In function `axp20_init_chip':
/home/linux-sunxi/drivers/power/axp_power/axp20-mfd.h:149: undefined reference to `hwmon_device_register'
drivers/built-in.o: In function `axp_mfd_remove':
/home/linux-sunxi/drivers/power/axp_power/axp-mfd.c:368: undefined reference to `hwmon_device_unregister'
make: *** [.tmp_vmlinux1] Error 1

My compiler: gcc version 4.6.3 20120624 (prerelease) (Ubuntu/Linaro 4.6.3-8ubuntu1~ppa1)

Thanks for helping!

You probably have CONFIG_AXP_HWMON=y but CONFIG_HWMON is either not enabled or set to "m".

Thanks a lot, patwood! It worked...


OK, now I'm facing this when compiling the modules:

HOSTCC  firmware/ihex2fw
make[1]: *** No rule to make target `firmware/ap6210/bcm20710a1.hcd', needed by `__fw_modbuild'.  Stop.

Thanks again...

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #104 on: February 04, 2014, 10:56:22 am »
You should have this file.  Make sure you have the most recent code checked out from github.  That file was checked in about 3 weeks ago: https://github.com/patrickhwood/linux-sunxi/blob/pat-3.4.75-ct/firmware/ap6210/bcm20710a1.hcd

It's also in the pat-3.4.75 branch, which I continue to update (pat-3.4.75-ct won't see any new commits).