WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: A10 boot files  (Read 42090 times)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #15 on: August 07, 2013, 01:02:32 AM »
Warning...
[Begin rant]
Why the H*** would they use Java as an archiving method?
Never I have needed Java to perform a kernel compile.
This is what I absolutely hate about the direction that Linux is going.
Bloat and unneeded crap just to unpack an archive! Really!
[/End rant]
Sorry, but this seems like a really stupid idea to require Java.
10+ Years Contributing to Linux Open Source Projects.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: A10 boot files
« Reply #16 on: August 07, 2013, 05:37:06 AM »
+1

When I had first read that, I had just wondered if that would be something arm specific, as I couldn't understand why java would get invoked...
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: A10 boot files
« Reply #17 on: August 07, 2013, 08:12:22 AM »
I've often resorted to coffee when learning how to setup TCL on ARM devices but that sounds like flying to Brazil to buy a bottle of iced coffee.

 ??? ??? ???

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #18 on: August 07, 2013, 11:39:05 AM »
Dear Roberts,

I don't know why they used Java ?!

I just used your links at the following posts :

1- [http://forum.tinycorelinux.net/index.php/topic,13827.msg78685.html#msg78685]
and
2- [http://forum.tinycorelinux.net/index.php/topic,13827.msg78687.html#msg78687].

Please help me about the above steps for kernel compile.

Thank you.
« Last Edit: August 07, 2013, 11:42:29 AM by persian »

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #19 on: August 07, 2013, 01:40:47 PM »
Dear friends,

Hi,

I used the [linux-sunxi-g2d.zip] source code (from http://tinycorelinux.net/5.x/armv7/src/) and I enabled Ugly GPIO and SPI driver with [make menuconfig] and saved them at the [.config] file.

My board is Marsboard [a10_mid_1gb], but when I used the make command I get the following error:

tc@box:/mnt/mmcblk0p2/tce/linux-sunxi-g2d$ make
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  AS      arch/arm/kernel/head.o
arch/arm/kernel/head.S:93:2: error: #error "unsupport chip"
make[1]: *** [arch/arm/kernel/head.o] Error 1
make: *** [arch/arm/kernel] Error 2


Please help me about this error.

I want to make my image for enabling GPIO and SPI functions with the guidence of wiki:custom_kernel (http://wiki.tinycorelinux.net/wiki:custom_kernel).

Thank you.

« Last Edit: August 07, 2013, 01:44:03 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #20 on: August 07, 2013, 09:57:15 PM »
That wiki is for x86. The marsboard being an A10 requires uImage which is a mkimaged from compiled kernel. You choice to use Allwinner is a more complex arm development environment that say rPi or even i.MX6. Anyway, if you have access to a powered hard drive to use as persistent storage then you can compile both kernel and modules on the marsbard using a10Core. You must also have swap available.

From running a10Core you just need to import

build-essential
libncurses5-dev

Then a make menuconfig should work

make
make modules

then be sure you have, get, or compile, mkimage from sunxi tools

make uImage
make modules_install=INSTALL_MOD_PATH=/mnt/sdX/some-persistent storage

If all you need are a few modules, then you may get by with make modules and make modules_install thereby bypassing sunxi tools mkimage.

Good luck
« Last Edit: August 07, 2013, 10:12:37 PM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #21 on: August 08, 2013, 02:37:51 AM »
Dear Roberts,

Thank you for your replies to my questions.

I imported (with -b switch) the [build-eesential] and [nlibcurses5-dev] and I am working only with [linux-sunxi-g2d.zip] source codes (from http://tinycorelinux.net/5.x/armv7/src/) and make and compile them on my Marsbord (not on a PC virtual machine).

I don't know how to do the following tasks:

1- How to define or enable Swap ?

2- Which version of Sunxi tools is sweet for A10 chip and how to get and install it on my Marsborad for compilation?

3- The make menuconfig  have many options for AllWinner SUN4I Platform (ARCH_SUN4I) and I don't know how to select options and sub-options for this or other (such as CPU freq., Kernel, Memory split, Preemption model, ELF, Net and ...) parameters setting ?

Note: My Marsborad have a uSD 8GB (without Hard disk) and I compile on it with the selection of  Ugly GPIO and SPI drivers options in make menuconfig  .

Thank you again.
« Last Edit: August 08, 2013, 10:03:25 AM by persian »

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #22 on: August 08, 2013, 04:53:54 AM »
Dear Robers,

I found how to define chip with [make menuconfig] from <linux-sunxi-g2d> directory.

But I got the following warnings and error with [make] :
 
:
:
  CC      arch/arm/mach-sun4i/dma/dma_15.o
  LD      arch/arm/mach-sun4i/dma/built-in.o
WARNING: arch/arm/mach-sun4i/dma/built-in.o(.devinit.text+0xc): Section mismatch in reference from the function sw_dmac_probe() to the function .init.text:sw15_dma_init()
The function __devinit sw_dmac_probe() references
a function __init sw15_dma_init().
If sw15_dma_init is only used by sw_dmac_probe then
annotate sw15_dma_init with a matching annotation.

WARNING: arch/arm/mach-sun4i/dma/built-in.o(.devinit.text+0x14): Section mismatch in reference from the function sw_dmac_probe() to the function .init.text:sw_dma_init_map()
The function __devinit sw_dmac_probe() references
a function __init sw_dma_init_map().
If sw_dma_init_map is only used by sw_dmac_probe then
annotate sw_dma_init_map with a matching annotation.

  CC      arch/arm/mach-sun4i/pm/pm.o
  LD      arch/arm/mach-sun4i/pm/built-in.o
  CC      arch/arm/mach-sun4i/core.o
  CC      arch/arm/mach-sun4i/devices.o
  CC      arch/arm/mach-sun4i/sys_config.o
  LD      arch/arm/mach-sun4i/built-in.o
WARNING: arch/arm/mach-sun4i/built-in.o(.devinit.text+0xc): Section mismatch in reference from the function sw_dmac_probe() to the function .init.text:sw15_dma_init()
The function __devinit sw_dmac_probe() references
a function __init sw15_dma_init().
If sw15_dma_init is only used by sw_dmac_probe then
annotate sw15_dma_init with a matching annotation.

WARNING: arch/arm/mach-sun4i/built-in.o(.devinit.text+0x14): Section mismatch in reference from the function sw_dmac_probe() to the function .init.text:sw_dma_init_map()
The function __devinit sw_dmac_probe() references
a function __init sw_dma_init_map().
If sw_dma_init_map is only used by sw_dmac_probe then
annotate sw_dma_init_map with a matching annotation.

  CC      kernel/sched.o
  CC      kernel/fork.o
:
:
:
  LD      drivers/i2c/built-in.o
  CC      drivers/input/input.o
drivers/input/input.c: In function 'input_pass_event':
drivers/input/input.c:106:7: warning: unused variable 'not_gsensor' [-Wunused-variable]
drivers/input/input.c:105:6: warning: unused variable 'i' [-Wunused-variable]
drivers/input/input.c: At top level:
drivers/input/input.c:88:20: warning: 'gsensor_name_list' defined but not used [-Wunused-variable]
  CC      drivers/input/input-compat.o
  CC      drivers/input/input-mt.o
:
:
:
  LD      drivers/media/built-in.o
  CC      drivers/misc/sun4i-gpio.o
drivers/misc/sun4i-gpio.c: In function 'sun4i_gpio_init':
drivers/misc/sun4i-gpio.c:248:20: warning: ignoring return value of 'sysfs_create_group', declared with attribute warn_unused_result [-Wunused-result]
  LD      drivers/misc/built-in.o
  LD      drivers/net/built-in.o
  CC      drivers/rtc/rtc-lib.o
  LD      drivers/rtc/built-in.o
  CC      drivers/spi/spi.o
  CC      drivers/spi/spi_sunxi.o
  LD      drivers/spi/built-in.o
WARNING: drivers/spi/built-in.o(.text+0x2818): Section mismatch in reference from the function spi_sunxi_register_spidev() to the function .init.text:spi_register_board_info()
The function spi_sunxi_register_spidev() references
the function __init spi_register_board_info().
This is often because spi_sunxi_register_spidev lacks a __init
annotation or the annotation of spi_register_board_info is wrong.

  CC      drivers/tty/tty_io.o
  CC      drivers/tty/n_tty.o
:
:
:
  LD      drivers/built-in.o
WARNING: drivers/built-in.o(.text+0x2abc0): Section mismatch in reference from the function spi_sunxi_register_spidev() to the function .init.text:spi_register_board_info()
The function spi_sunxi_register_spidev() references
the function __init spi_register_board_info().
This is often because spi_sunxi_register_spidev lacks a __init
annotation or the annotation of spi_register_board_info is wrong.

  CC      net/nonet.o
:
:
:
  AR      lib/lib.a
  LD      vmlinux.o
  MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x119020): Section mismatch in reference from the function spi_sunxi_register_spidev() to the function .init.text:spi_register_board_info()
The function spi_sunxi_register_spidev() references
the function __init spi_register_board_info().
This is often because spi_sunxi_register_spidev lacks a __init
annotation or the annotation of spi_register_board_info is wrong.

WARNING: vmlinux.o(.devinit.text+0x74): Section mismatch in reference from the function sw_dmac_probe() to the function .init.text:sw15_dma_init()
The function __devinit sw_dmac_probe() references
a function __init sw15_dma_init().
If sw15_dma_init is only used by sw_dmac_probe then
annotate sw15_dma_init with a matching annotation.

WARNING: vmlinux.o(.devinit.text+0x7c): Section mismatch in reference from the function sw_dmac_probe() to the function .init.text:sw_dma_init_map()
The function __devinit sw_dmac_probe() references
a function __init sw_dma_init_map().
If sw_dma_init_map is only used by sw_dmac_probe then
annotate sw_dma_init_map with a matching annotation.

  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
drivers/built-in.o: In function `mma7660_probe':
hid-input.c:(.devinit.text+0xdc): undefined reference to `input_allocate_polled_device'
hid-input.c:(.devinit.text+0x1a0): undefined reference to `input_register_polled_device'
make: *** [.tmp_vmlinux1] Error 1

tc@box:/mnt/mmcblk0p2/tce/linux-sunxi-g2d$
 


I found [mma7660] is an I2C G-sensor but I did not enable any G-sensor with [make menuconfig] and this option is not selected in menuconfig !

please help me about the above warning and error.

Thank you.
« Last Edit: August 08, 2013, 09:34:00 AM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #23 on: August 08, 2013, 10:33:07 AM »
Sorry, but if you don't know basic Linux, i.e., enabling swap, then I would suggest that you should start there. Get a book on Linux, also there are books on embedded linux development explaining u-boot, as well a much available on the internet. Without basic Linux knowledge this task will be most difficult.

When compiling a kernel there will be some warning messages. Did you start with a10-kernel.config and just add you requirements? You still haven't even indicated the kernel config additions that meet your requirements. What did you add to a10-kernel.config?

Another thing, I am sure that you would not want to load the compiler environment upon evey boot. Using import -b is not recommended. Basic use of dCore is import, which is used only once, loadsce which is used when you want to load and use an application.
« Last Edit: August 08, 2013, 10:35:51 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #24 on: August 08, 2013, 11:11:31 AM »
Dear Roberts,

Thank you, I know the difference of  (import -b) and (loadsce).

As I said before I want to enable Ugly GPIO and SPI driver, then I think at file [a10Core-kernel.config] the following line
# CONFIG_SUN4I_GPIO_UGLY is not set
must be change to
CONFIG_SUN4I_GPIO_UGLY=y
but I did not find any line for enabling general SPI functions (for general hardware devices such as  RFM12B RF modules or other self-made GSM, ADXL345 sensor or GPS devices ).

I done the above with [make menuconfig] but after make I got the following error.

Why the following error occued ? I did not enable any G-sensore such as mma7660 !

drivers/built-in.o: In function `mma7660_probe':
hid-input.c:(.devinit.text+0xdc): undefined reference to `input_allocate_polled_device'
hid-input.c:(.devinit.text+0x1a0): undefined reference to `input_register_polled_device'
make: *** [.tmp_vmlinux1] Error 1

Thanks again.
« Last Edit: August 08, 2013, 11:18:27 AM by persian »

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #25 on: August 08, 2013, 11:20:23 AM »
Where is the location of [a10Core-kernel.config] at  <linux-sunxi-g2d> directory for compilation ?
« Last Edit: August 08, 2013, 11:29:08 AM by persian »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: A10 boot files
« Reply #26 on: August 08, 2013, 11:29:27 AM »
Hi persian
Quote
hid-input.c:(.devinit.text+0xdc): undefined reference to `input_allocate_polled_device'
hid-input.c:(.devinit.text+0x1a0): undefined reference to `input_register_polled_device'
Try setting  INPUT_POLLDEV  in menuconfig to  Y  and see if that helps.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #27 on: August 08, 2013, 02:37:34 PM »
Dear Roberts & Rich,

Thank you for your useful posts specially Reply #20 and Reply #26.

Finally I makes modules and installed them with the following command :

tc@box:/mnt/mmcblk0p2/tce/linux-sunxi-g2d$ sudo make modules_install INSTALL_MOD_PATH=/mnt/mmcblk0p2/My_Added_Modules
  INSTALL drivers/misc/sun4i-gpio.ko
  INSTALL drivers/spi/spi_sunxi.ko
  DEPMOD  3.0.42
Warning: you may need to install module-init-tools
See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt


Also I imported and loaded [module-init-tools] but I got the following error when I tried to load sun4i-gpio.ko and spi_sunxi.ko modules with modprobe command:

tc@box:/mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/misc$ modprobe sun4i-gpio
modprobe: module sun4i-gpio not found in modules.dep

or

tc@box:/mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/misc$ modprobe sun4i-gpio.ko
modprobe: module sun4i-gpio not found in modules.dep

The content of [modules.dep] file (at location: /mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/) is:
----------------------------------------------------
kernel/drivers/misc/sun4i-gpio.ko:
kernel/drivers/spi/spi_sunxi.ko:


What is my fault?

Thank you
« Last Edit: August 08, 2013, 03:27:09 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #28 on: August 08, 2013, 05:48:27 PM »
The modules would need to be standard locations and included in modules.dep in order to use modprobe.

But, no problem, use insmod with full path to module to test.

# insmod /mnt/your_drive/and_path_to/kernel/drivers/misc/sun4i-gpio.ko
# insmod /mnt/your_drive/and_path_to/kernel/drivers/misc/spi_sunxi.ko

Once you know it is working then make an sce extension with just those modules.

You can use 8192cu.sce as an exmple sce extension which it just a module.
unpack it with unsquashfs to see.

pack yours with mksquashfs
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #29 on: August 09, 2013, 03:36:37 AM »
Dear Roberts,

It gives me an error that:

insmod: can't insert 'sun4i-gpio.ko': invalid module format

I think that this error is because of my kernel version is not the one on which I am running the insmod command, but I don't know what to do to sort out this problem?

I downloaded and used the [linux-sunxi-g2d.zip] source file  (from http://tinycorelinux.net/5.x/armv7/src/) for making these modules.

Also I run dmesg and uname -a commands and the results are :

tc@box:/mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/misc$ dmesg
:
:
[ 2239.490000] sun4i_gpio: module_layout: kernel tainted.
[ 2239.500000] Disabling lock debugging due to kernel taint
[ 2239.500000] sun4i_gpio: version magic '3.0.42 ARMv7 ' should be '3.0.42 preempt mod_unload modversions ARMv7 '
[ 3118.120000] spi_sunxi: version magic '3.0.42 ARMv7 ' should be '3.0.42 preempt mod_unload modversions ARMv7 '

tc@box:/mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/misc$ uname -a
Linux box 3.0.42 #3 PREEMPT Fri Feb 8 18:38:58 PST 2013 armv7l GNU/Linux


I attached the driver modules as a compressed tar file to this post for your review.

Please help me about the action I should take to sort out this problem?

Thanks,

    [EDIT] Attachment removed due to policy violation.  Rich
« Last Edit: August 09, 2013, 10:41:07 AM by Rich »