! LaTeX Error: File `lmodern.sty' not found.
install lmodern to fix:.sudo apt-get install lmodern
My experience on Android Porting
in ipu_sdc.c:ipu_sdc_init_panel
#ifdef CONFIG_MACH_ARMADILLO5X0
old_conf = (div |
((div >> 4) - 1) << 24 | /* DISP3_IF_CLK_DOWN_WR */
((div >> 4) - 2) << 14); /* DISP3_IF_CLK_UP_WR */
mx3fb_write_reg(mx3fb, old_conf, DI_DISP3_TIME_CONF);
#else
/*
* DISP3_IF_CLK_DOWN_WR is half the divider value and 2 fraction bits
* fewer. Subtract 1 extra from DISP3_IF_CLK_DOWN_WR based on timing
* debug. DISP3_IF_CLK_UP_WR is 0
*/
mx3fb_write_reg(mx3fb, (((div / 8) - 1) << 22) | div, DI_DISP3_TIME_CONF);
#endif
Horizontal sync signal:
__ ______________________________ ___________
|_| |_|
|A|
|---------------B----------------|
Data:
______________________ ________
________| VIDEO |________| VIDEO (next line)
|-C-|----------D-----------|-E-|
Clock frequency 25.175 MHz (Pixel frequency)Timing mode parameters must meet those constraints but we can decide amounts of left and upper margins panning the valid image onto a well displayed position!
Line frequency 31469 Hz -> 800 pixel per line.
Field frequency 59.94 Hz -> 525 lines.
Same process for the resolution 800x600 with 56Hz of refresh rate results in this video mode:{ /* 640x480 @ 60 Hz */
.name = "CRT-VGA",
.refresh = 60,
.xres = 640,
.yres = 480,
.pixclock = 39721, //Period in picos
.left_margin = 35,
.right_margin = 115,
.upper_margin = 43,
.lower_margin = 1,
.hsync_len = 10,
.vsync_len = 1,
.sync = FB_SYNC_OE_ACT_HIGH,
.vmode = FB_VMODE_NONINTERLACED,
.flag = 0,
},
{ /* 800x600 @ 56 Hz */
.name = "CRT-SVGA",
.refresh = 56,
.xres = 800,
.yres = 600,
.pixclock = 30000,
.left_margin = 30,
.right_margin = 108,
.upper_margin = 13,
.lower_margin = 10,
.hsync_len = 10,
.vsync_len = 1,
.sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_HOR_HIGH_ACT |
FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED,
.flag = 0,
},
Next I created the BitBake configuration file locale.conf:Base dir
$ mkdir -p /media/dati/oe/stuff/build/conf
$ cd /media/dati/oe/stuff/
For BitBake
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake
For Openembedded
$ git clone git://git.openembedded.net/openembedded
$ cd /media/dati/oe/stuff/
$ cp openembedded/conf/local.conf.sample build/conf/local.conf
And next the patch to openembedded: 0001-Initial-Armadillo-500-support-for-OpenEmbedded.patch
TOPDIR = "/media/dati/oe"
DL_DIR = "${TOPDIR}/sources"
BBFILES = "${TOPDIR}/stuff/openembedded/recipes/*/*.bb"
BBMASK = ""
PREFERRED_PROVIDERS = "virtual/qte:qte virtual/libqpe:libqpe-opie"
PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-x11"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-intermediate:gcc-cross-intermediate"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"
MACHINE = "armadillo500"
TARGET_OS = "linux"
DISTRO = "angstrom-2008.1"
GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 it_DE.UTF-8"
IMAGE_FSTYPES = "ext2"
CACHE = "${TOPDIR}/cache"
BBINCLUDELOGS = "yes"
Produce at /media/dati/oe/tmp/deploy/glibc/images/armadillo500 the file Angstrom-helloworld-image-glibc-ipk-2009.X-test-20090506-armadillo500.rootfs.ext2$ cd /media/dati/oe/stuff/
$ bitbake helloworld-image
Work great as rootfilesystem!$ sudo mount Angstrom-helloworld-image-glibc-ipk-2009.X-test-20090506-armadillo500.rootfs.ext2 /nfsarmadilloroot -t ext2 -o loop
git pullin the root local git repository.
From: http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html$ git config --global user.name "Alberto Panizzo"
$ git config --global user.email maramaopercheseimorto@gmail.com
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index ca46f48..f1a581d 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -581,6 +581,11 @@ int __init mx31_clocks_init(unsigned long fref)
MX32, but still required to be set */
MXC_CCM_CGR2);
+ /* Ensure ipg_per_clk clock is generated by ipg_clk and not by
+ usb_pll (CCMR:24 = 1) to do not turn off UART after disabling
+ usb_pll and mantain ipg_clk and ipg_per_clk syncronization */
+ __raw_writel(__raw_readl(MXC_CCM_CCMR) | (1 << 24), MXC_CCM_CCMR);
+
usb_pll_disable(&usb_pll_clk);
pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk));
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index b371fba..5d08227 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -17,6 +17,9 @@
* 100% relocatable. Any attempt to do so will result in a crash.
* Please select one of the following when turning on debugging.
*/
+
+#define DEBUG 1
+
#ifdef DEBUG
#if defined(CONFIG_DEBUG_ICEDCC)
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 991952c..5d43cfa 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -50,7 +50,9 @@ __mmap_switched:
1: cmp r6, r7
strcc fp, [r6],#4
bcc 1b
-
+
+ bl __alive
+
ldmia r3, {r4, r5, r6, r7, sp}
str r9, [r4] @ Save processor ID
str r1, [r5] @ Save machine type
@@ -69,6 +71,16 @@ ENDPROC(__mmap_switched)
* and hope for the best (useful if bootloader fails to pass a proper
* machine ID for example).
*/
+__alive:
+ mov r10,r0
+ adr r0, str_a
+ bl printascii
+ mov r0,r10
+ mov pc, lr
+str_a: .asciz "\n Alive!\n"
+ .align
+ENDPROC(__alive)
+
__error_p:
#ifdef CONFIG_DEBUG_LL
adr r0, str_p1
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index d623558..4ac4337 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -64,4 +64,12 @@ config MACH_QONG
Include support for Dave/DENX QongEVB-LITE platform. This includes
specific configurations for the board and its peripherals.
+config MACH_ARMADILLO500
+ bool "Support Atmark Armadillo-500 Development Base Board"
+ select ARCH_MX31
+ default n
+ help
+ Include support for Atmark Armadillo-500 platform. This includes
+ specific configurations for the board and its peripherals.
+
endif
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 272c8a9..4659598 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -14,3 +14,4 @@ obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
mx31moboard-marxbot.o
obj-$(CONFIG_MACH_QONG) += qong.o
+obj-$(CONFIG_MACH_ARMADILLO500) += armadillo5x0.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
new file mode 100644
index 0000000..ae4e35e
--- /dev/null
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -0,0 +1,117 @@
+/*
+ * armadillo500.c
+ *
+ * Copyright 2009 Alberto Panizzo
+ * updates in http://alberdroid.blogspot.com/
+ *
+ * Based on Atmark Techno, Inc. armadillo 500 BSP 2008 All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+/* Define Machine specific Memory regions */
+#include
+/* All machine types definitions */
+#include
+/* Machine descriptor definition */
+#include
+/* Time keepeing definitions */
+#include
+/* Memory mapping functions */
+#include
+/* Define map_desc */
+#include
+
+/* Platform functions */
+#include
+#include
+
+
+
+static void __init armadillo5x0_init(void)
+{
+}
+
+/*!
+ * This structure defines static mappings for the i.MX31ADS board.
+ */
+static struct map_desc armadillo5x0_io_desc[] __initdata = {
+ /*{//Internal RAM
+ .virtual = MX31_IRAM_BASE_ADDR_VIRT,
+ .pfn = __phys_to_pfn(IRAM_BASE_ADDR),
+ .length = IRAM_SIZE,
+ .type = MT_NONSHARED_DEVICE},
+ },*//* {//ROM PATCH
+ .virtual = ROMP_BASE_ADDR_VIRT,
+ .pfn = __phys_to_pfn(ROMP_BASE_ADDR),
+ .length = ROMP_SIZE,
+ .type = MT_DEVICE_NONSHARED
+ },*/ {//Shared Perpheral Bus Arbiter
+ .virtual = SPBA0_BASE_ADDR_VIRT,
+ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
+ .length = SPBA0_SIZE,
+ .type = MT_DEVICE_NONSHARED
+ }, {//NOR Flash memory (32 M)
+ .virtual = CS0_BASE_ADDR_VIRT,
+ .pfn = __phys_to_pfn(CS0_BASE_ADDR),
+ .length = CS0_SIZE,
+ .type = MT_DEVICE
+ }, {//Extended Bus Region
+ .virtual = CS4_BASE_ADDR_VIRT,
+ .pfn = __phys_to_pfn(CS4_BASE_ADDR),
+ .length = CS4_SIZE,
+ .type = MT_DEVICE
+ },
+};
+
+/*!
+ * Set up static virtual mappings.
+ */
+static void __init armadillo5x0_map_io(void)
+{
+ /*
+ * Maps:
+ * - NAND, SDRAM, WEIM, M3IF, EMI controllers
+ * - AVIC (Vectored Interrupt controller)
+ * - AIPS1 and AIPS2
+ **/
+ mxc_map_io();
+ iotable_init(armadillo5x0_io_desc, ARRAY_SIZE(armadillo5x0_io_desc));
+}
+
+static void __init armadillo5x0_timer_init(void)
+{
+ mx31_clocks_init(26000000);
+}
+
+static struct sys_timer armadillo5x0_timer = {
+ .init = armadillo5x0_timer_init,
+};
+
+MACHINE_START(ARMADILLO5X0, "Armadillo-500")
+ /* Maintainer: Atmark Techno, Inc. */
+ .phys_io = AIPS1_BASE_ADDR,
+ .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x00000100,
+ //.map_io = armadillo5x0_map_io,
+ //.init_irq = mxc_init_irq,
+ //.timer = &armadillo5x0_timer,
+ //.init_machine = armadillo5x0_init,
+MACHINE_END
diff --git a/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
new file mode 100644
index 0000000..b16897b
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2007 Alberto Panizzo.
+ * All Rights Reserved.
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
+#define __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
+
+#include
+
+/*
+ * Other memory mapping regions
+ */
+
+#define CS0_BASE_ADDR_VIRT 0xE0000000
+#define CS0_SIZE SZ_128M
+
+/* mandatory for CONFIG_LL_DEBUG */
+
+#define MXC_LL_UART_PADDR UART1_BASE_ADDR
+#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
+
+#endif
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index 4f77314..d3440ab 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -34,6 +34,9 @@
#ifdef CONFIG_MACH_QONG
#include
#endif
+#ifdef CONFIG_MACH_ARMADILLO500
+#include
+#endif
.macro addruart,rx
mrc p15, 0, \rx, c1, c0
tst \rx, #1 @ MMU enabled?
apply the patch...
$ export ARCH=arm
$ export CROSS_COMPILE=/media/dati/android/cupcake/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
$ make allnoconfig
$ make gconfig
->System Type>ARMSystemType>Freescale MXC/iMX based=y
->Freescale MXC Implementation > Support Atmark Armadillo-500 Development Board=y
$ make
-> download to the board and boot!
#define init_func(prefix_name, arg) prefix_name##_init(arg)so calling:
init_func(armadillo, null)expands in:
armadillo_init(null)fox!
$ wget http://download.atmark-techno.com/armadillo-500-fx/source/kernel/linux-2.6.26-at3.tar.gz2
$ tar -xvf linux-2.6.26-at3.tar.gz
$ cd linux-2.6.26-at3Nota: ho usato la toolchain di cupcake, credo che anche con il branch master non abbia problemi..
$ make armadillo500_defconfig
$ export ARCH=arm
$ export CROSS_COMPILE=[basePathAndroid]/cupcake/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
$ make
$ inetd -d.Scaricata l'ultima versione del kernel da http://download.atmark-techno.com/armadillo-500/image/linux-a500-1.05.bin.gz nella cartella /tftp sono pronto per l'aggiornamento:
hermit> tftpdl 192.168.0.10 192.168.0.2 --kernel=linux-a500-1.05.bin.gzOk! aggiornato il kernel!
(tftpdl deviceIp workstationIp --regionName=fileToDownload)
hermit> setbootdevice flash
hermit> clearenvRisultati
hermit> setenv console=ttymcx0 root=/dev/mmcblk0p1 rootdelay=1
hermit> boot
sudo apt-get install tftpd-hpaCreiamo una cartella per lo scambio dei dati e diamo accesso in lettura e scrittura a chi vuole:
sudo mkdir /tftpOra modifichiamo il file di configurazione dei servizi /etc/inet.conf (Ubuntu 8.04 hardy)
sudo chmod a+r /tftp
sudo chmod a+w /tftp
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /tftpdove ogni campo significa:
sudo inetdattiveremo anche il server tftp, specificando l'opzione -d verrà visualizzato il debug dei servizi su shell.
pdftk nomefile.pdf burste merge per fondere singole pagine in unici file pdf:
pdftk nome1.pdf nome2.pdf ... cat output merge.pdfAllora, suddivisi i file di documentazione in gruppi di 6 pagine, stò trascrivendo le informazioni iportanti della scheda che pubblicherò :)
To rebuild the emulator kernel:ehm.. un pò da adattare dato che non menziona il branch android-goldfish-2.6.27 (nel branch common del kernel non c'è il file goldfish_defconfig) e che la toolchain di crosscompilazione non è (per ora) nel path d'esecuzione principale (non abbiamo modificato PATH).
% git clone git://android.kernel.org/kernel/common.git kernel
% cd kernel
% export ARCH=arm
% export CROSS_COMPILE=arm-eabi-
% make goldfish_defconfig
% make
If kernel/common.git is mapped into your repo client, you can
just built it from there instead of re-cloning it.
$ cd PATH_GIUSTO/alberdroid/master/out/target/product/generic/
$ cp PATH_GIUSTO/alberdroid/kernel-goldfish/.repo/manifests/arch/arm/boot/zImage .
$ emulator -system . -kernel zImage -show-kernelCosì l'emulatore cercherà i file ramdisk.img userdata.img e system.img nella cartella corrente (-system .), utilizzerà zImage come immagine del kernel (..non utilizzare l'immagine Image ma quella compressa zImage) e nella shell corrente mostrerà l'output del kernel!
$ mkdir -p alberdroid/kernel-goldfishSolito tempo che passa.....
$ cd alberdroid/kernel-goldfish
$ repo init -u git://android.git.kernel.org/kernel/common.git -b android-goldfish-2.6.27
$ repo sync
$ cd .repo/manifestse si continua con:
$ export ARCH=armVerrà così creato un buon kernel per l'emulatore :)
$ export CROSS_COMPILE=PATHGIUSTO/alberdroid/master/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
$ make goldfish_defconfig
$ make
$ cd ~/alberdroid/masterIl processo è abbastanza lungo (più di un'ora nel mio portatile) e necessita di molta memoria! 1GB di ram non basta.....
$ make
$ emulator -system out/target/product/generic/ \Vedremo apparire il nostro caro emulatore arm con android funzionante!!
-kernel prebuilt/android-arm/kernel/kernel-qemu -show-kernel
$ cd ~
$ mkdir bin
PATH=$PATH:/home/NOMEUTENTE/binpoi..
export PATH
$ curl http://android.git.kernel.org/repo >~/bin/repoRepo è uno script in continuo sviluppo, eseguendolo verrà stampata un'informazione relativa alla presenza di versioni più aggiornate se necessario.
$ chmod a+x ~/bin/repo
$ mkdir -p alberdroid/mastered inizializziamo il repository locale con:
$ cd alberdroid/master
$ repo init -u git://android.git.kernel.org/platform/manifest.gitLa cartella master è stata creata perché con questo comando verrà scaricato il barnch "master" con "git branch" otterremo i branch disponibili e con
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b BRANCHNAMEinizializzeremo il branch voluto.
$ cd alberdroid/masterPer sincronizzare singoli progetti..
$ repo sync
$ repo sync NOME1 NOME2 ..