imx-bootlets: refresh patches
[openwrt/staging/stintel.git] / package / boot / imx-bootlets / patches / 003-add-olinuxino.patch
1 --- /dev/null
2 +++ b/linux_prep/board/imx23_olinuxino_dev.c
3 @@ -0,0 +1,54 @@
4 +/*
5 + * Platform specific data for the IMX23_OLINUXINO development board
6 + *
7 + * Fadil Berisha <fadil.r.berisha@gmail.com>
8 + *
9 + * Copyright 2008 SigmaTel, Inc
10 + * Copyright 2008 Embedded Alley Solutions, Inc
11 + * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
12 + *
13 + * This file is licensed under the terms of the GNU General Public License
14 + * version 2. This program is licensed "as is" without any warranty of any
15 + * kind, whether express or implied.
16 + *
17 + * http://www.opensource.org/licenses/gpl-license.html
18 + * http://www.gnu.org/copyleft/gpl.html
19 + */
20 +#include <setup.h>
21 +#include <keys.h>
22 +#include <lradc_buttons.h>
23 +
24 +/************************************************
25 + * LRADC keyboard data *
26 + ************************************************/
27 +int lradc_keypad_ch = LRADC_CH0;
28 +int lradc_vddio_ch = LRADC_CH6;
29 +
30 +struct lradc_keycode lradc_keycodes[] = {
31 + { 100, KEY4 },
32 + { 306, KEY5 },
33 + { 601, KEY6 },
34 + { 932, KEY7 },
35 + { 1260, KEY8 },
36 + { 1424, KEY9 },
37 + { 1707, KEY10 },
38 + { 2207, KEY11 },
39 + { 2525, KEY12 },
40 + { 2831, KEY13 },
41 + { 3134, KEY14 },
42 + { -1, 0 },
43 +};
44 +
45 +/************************************************
46 + * Magic key combinations for Armadillo *
47 + ************************************************/
48 +u32 magic_keys[MAGIC_KEY_NR] = {
49 + [MAGIC_KEY1] = KEY4,
50 + [MAGIC_KEY2] = KEY6,
51 + [MAGIC_KEY3] = KEY10,
52 +};
53 +
54 +/************************************************
55 + * Default command line *
56 + ************************************************/
57 +char cmdline_def[] = "console=ttyAMA0,115200";
58 --- /dev/null
59 +++ b/linux_prep/cmdlines/imx23_olinuxino_dev.txt
60 @@ -0,0 +1 @@
61 +noinitrd console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw rootwait ssp1=mmc
62 --- a/linux_prep/core/setup.c
63 +++ b/linux_prep/core/setup.c
64 @@ -84,6 +84,8 @@ static void *memcpy(void *s1, const void
65 #include "../../mach-mx28/includes/registers/regsrtc.h"
66 #elif defined(STMP378X)
67 #include "../../mach-mx23/includes/registers/regsrtc.h"
68 +#elif defined(IMX23_OLINUXINO)
69 +#include "../../mach-mx23/includes/registers/regsrtc.h"
70 #endif
71
72 #define NAND_SECONDARY_BOOT 0x00000002
73 --- a/linux_prep/include/mx23/platform.h
74 +++ b/linux_prep/include/mx23/platform.h
75 @@ -19,6 +19,10 @@
76
77 #if defined (BOARD_STMP378X_DEV)
78 #define MACHINE_ID 0xa45
79 +
80 +#elif defined (BOARD_IMX23_OLINUXINO_DEV)
81 +#define MACHINE_ID 0x1009
82 +
83 #else
84 #error "Allocate a machine ID for your board"
85 #endif
86 --- a/linux_prep/Makefile
87 +++ b/linux_prep/Makefile
88 @@ -69,6 +69,11 @@ ARCH = mx28
89 HW_OBJS = $(LRADC_OBJS)
90 CFLAGS += -DMX28 -DBOARD_MX28_EVK
91 endif
92 +ifeq ($(BOARD), imx23_olinuxino_dev)
93 +ARCH = mx23
94 +HW_OBJS = $(LRADC_OBJS)
95 +CFLAGS += -DIMX23_OLINUXINO -DBOARD_IMX23_OLINUXINO_DEV
96 +endif
97
98 # Generic code
99 CORE_OBJS = entry.o resume.o cmdlines.o setup.o keys.o
100 --- a/Makefile
101 +++ b/Makefile
102 @@ -3,9 +3,9 @@ MEM_TYPE ?= MEM_DDR1
103 export MEM_TYPE
104
105 DFT_IMAGE=$(DEV_IMAGE)/boot/zImage
106 -DFT_UBOOT=$(DEV_IMAGE)/boot/u-boot
107 +DFT_UBOOT=../boot/u-boot
108
109 -BOARD ?= stmp378x_dev
110 +BOARD ?= imx23_olinuxino_dev
111
112 ifeq ($(BOARD), stmp37xx_dev)
113 ARCH = 37xx
114 @@ -16,6 +16,9 @@ endif
115 ifeq ($(BOARD), iMX28_EVK)
116 ARCH = mx28
117 endif
118 +ifeq ($(BOARD), imx23_olinuxino_dev)
119 +ARCH = mx23
120 +endif
121
122 all: build_prep gen_bootstream
123
124 @@ -94,6 +97,8 @@ distclean: clean
125 clean:
126 -rm -rf *.sb
127 rm -f sd_mmc_bootstream.raw
128 + rm -f linux_prep/board/*.o
129 + rm -f power_prep/*.o
130 $(MAKE) -C linux_prep clean ARCH=$(ARCH)
131 $(MAKE) -C boot_prep clean ARCH=$(ARCH)
132 $(MAKE) -C power_prep clean ARCH=$(ARCH)
133 --- a/uboot.db
134 +++ b/uboot.db
135 @@ -3,7 +3,7 @@
136 sources {
137 power_prep="./power_prep/power_prep";
138 sdram_prep="./boot_prep/boot_prep";
139 - image="/home/b18647/repos/ltib_latest/rootfs/boot/u-boot";
140 + image="../boot/u-boot";
141 }
142
143 section (0) {