]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/uboot/u-boot-1.1.2/mnci.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / uboot / u-boot-1.1.2 / mnci.patch
1
2 #
3 # Patch managed by http://www.holgerschurig.de/patcher.html
4 #
5
6 --- u-boot-1.1.2/CREDITS~mnci
7 +++ u-boot-1.1.2/CREDITS
8 @@ -360,6 +360,9 @@
9  E: r.schwebel@pengutronix.de
10  D: Support for csb226, logodl and innokom boards (PXA2xx)
11  
12 +N: Holger Schurig
13 +D: Support for MNCI-RX "Ramses"
14 +
15  N: Yasushi Shoji
16  E: yashi@atmark-techno.com
17  D: Support for Xilinx MicroBlaze, for Atmark Techno SUZAKU FPGA board
18 --- u-boot-1.1.2/MAINTAINERS~mnci
19 +++ u-boot-1.1.2/MAINTAINERS
20 @@ -396,6 +396,10 @@
21         csb226                  xscale
22         innokom                 xscale
23  
24 +Holger Schurig
25 +
26 +       mnci                    xscale
27 +
28  Andrea Scian <andrea.scian@dave-tech.it>
29  
30         B2                              ARM7TDMI (S3C44B0X)
31 --- u-boot-1.1.2/Makefile~mnci
32 +++ u-boot-1.1.2/Makefile
33 @@ -1388,6 +1388,9 @@
34  wepep250_config        :       unconfig
35         @./mkconfig $(@:_config=) arm pxa wepep250
36  
37 +mnci_config    :       unconfig
38 +       @./mkconfig $(@:_config=) arm pxa mnci
39 +
40  xaeniax_config :       unconfig
41         @./mkconfig $(@:_config=) arm pxa xaeniax
42  
43 --- /dev/null
44 +++ u-boot-1.1.2/board/mnci/Makefile
45 @@ -0,0 +1,49 @@
46 +#
47 +# (C) Copyright 2000
48 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
49 +# (C) Copyright 2005
50 +# M&N Solutions GmbH, Rosbach, Germany, Holger Schurig
51 +#
52 +# See file CREDITS for list of people who contributed to this
53 +# project.
54 +#
55 +# This program is free software; you can redistribute it and/or
56 +# modify it under the terms of the GNU General Public License as
57 +# published by the Free Software Foundation; either version 2 of
58 +# the License.
59 +#
60 +# This program is distributed in the hope that it will be useful,
61 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
62 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
63 +# GNU General Public License for more details.
64 +#
65 +# You should have received a copy of the GNU General Public License
66 +# along with this program; if not, write to the Free Software
67 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
68 +# MA 02111-1307 USA
69 +#
70 +
71 +include $(TOPDIR)/config.mk
72 +
73 +LIB    = lib$(BOARD).a
74 +
75 +OBJS   := mnci.o
76 +SOBJS  := memsetup.o
77 +
78 +$(LIB): $(OBJS) $(SOBJS)
79 +       $(AR) crv $@ $(OBJS) $(SOBJS)
80 +
81 +clean:
82 +       rm -f $(SOBJS) $(OBJS
83 +
84 +distclean: clean
85 +       rm -f $(LIB) core *.bak .depend
86 +
87 +#########################################################################
88 +
89 +.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
90 +       $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
91 +
92 +-include .depend
93 +
94 +#########################################################################
95 --- /dev/null
96 +++ u-boot-1.1.2/board/mnci/config.mk
97 @@ -0,0 +1 @@
98 +TEXT_BASE = 0xa1fe0000
99 --- /dev/null
100 +++ u-boot-1.1.2/board/mnci/u-boot.lds
101 @@ -0,0 +1,55 @@
102 +/*
103 + * (C) Copyright 2000
104 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
105 + *
106 + * See file CREDITS for list of people who contributed to this
107 + * project.
108 + *
109 + * This program is free software; you can redistribute it and/or
110 + * modify it under the terms of the GNU General Public License as
111 + * published by the Free Software Foundation; either version 2 of
112 + * the License.
113 + *
114 + * This program is distributed in the hope that it will be useful,
115 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
116 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
117 + * GNU General Public License for more details.
118 + *
119 + * You should have received a copy of the GNU General Public License
120 + * along with this program; if not, write to the Free Software
121 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
122 + * MA 02111-1307 USA
123 + */
124 +
125 +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
126 +OUTPUT_ARCH(arm)
127 +ENTRY(_start)
128 +SECTIONS
129 +{
130 +       . = 0x00000000;
131 +
132 +       . = ALIGN(4);
133 +       .text      :
134 +       {
135 +         cpu/pxa/start.o       (.text)
136 +         *(.text)
137 +       }
138 +
139 +       . = ALIGN(4);
140 +       .rodata : { *(.rodata) }
141 +
142 +       . = ALIGN(4);
143 +       .data : { *(.data) }
144 +
145 +       . = ALIGN(4);
146 +       .got : { *(.got) }
147 +
148 +       __u_boot_cmd_start = .;
149 +       .u_boot_cmd : { *(.u_boot_cmd) }
150 +       __u_boot_cmd_end = .;
151 +
152 +       . = ALIGN(4);
153 +       __bss_start = .;
154 +       .bss : { *(.bss) }
155 +       _end = .;
156 +}
157 --- /dev/null
158 +++ u-boot-1.1.2/board/mnci/mnci.c
159 @@ -0,0 +1,174 @@
160 +/*
161 + * See file CREDITS for list of people who contributed to this
162 + * project.
163 + *
164 + * This program is free software; you can redistribute it and/or
165 + * modify it under the terms of the GNU General Public License as
166 + * published by the Free Software Foundation; either version 2 of
167 + * the License.
168 + *
169 + * This program is distributed in the hope that it will be useful,
170 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
171 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
172 + * GNU General Public License for more details.
173 + *
174 + * You should have received a copy of the GNU General Public License
175 + * along with this program; if not, write to the Free Software
176 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
177 + * MA 02111-1307 USA
178 + */
179 +
180 +#include <common.h>
181 +#include <asm/arch/pxa-regs.h>
182 +#include <asm/mach-types.h>
183 +
184 +/**
185 + * board_init: - setup some data structures
186 + *
187 + * @return: 0 in case of success
188 + */
189 +
190 +int board_init (void)
191 +{
192 +       DECLARE_GLOBAL_DATA_PTR;
193 +
194 +       /* memory and cpu-speed are setup before relocation */
195 +       /* so we do _nothing_ here */
196 +
197 +       gd->bd->bi_arch_number = MACH_TYPE_RAMSES;
198 +       gd->bd->bi_boot_params = 0xa0000100;
199 +#if 0
200 +       gd->bd->bi_baudrate = 115200;
201 +#endif
202 +
203 +#if 0
204 +       CKEN |= CKEN2_AC97;
205 +       GCR = GCR_COLD_RST;
206 +#endif
207 +
208 +       return 0;
209 +}
210 +
211 +
212 +int board_late_init(void)
213 +{
214 +       setenv("stdout", "serial");
215 +       setenv("stderr", "serial");
216 +       return 0;
217 +}
218 +
219 +
220 +/**
221 + * dram_init: - setup dynamic RAM
222 + *
223 + * @return: 0 in case of success
224 + */
225 +
226 +int dram_init (void)
227 +{
228 +       DECLARE_GLOBAL_DATA_PTR;
229 +
230 +       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
231 +       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
232 +
233 +       return 0;
234 +}
235 +
236 +
237 +
238 +#ifdef CFG_JFFS_CUSTOM_PART
239 +
240 +#include <jffs2/jffs2.h>
241 +
242 +#define FLASH_DEBUG 1
243 +
244 +/* Some debug macros */
245 +#if (FLASH_DEBUG > 2 )
246 +#define PRINTK3(args...) printf(args)
247 +#else
248 +#define PRINTK3(args...)
249 +#endif
250 +
251 +#if FLASH_DEBUG > 1
252 +#define PRINTK2(args...) printf(args)
253 +#else
254 +#define PRINTK2(args...)
255 +#endif
256 +
257 +#ifdef FLASH_DEBUG
258 +#define PRINTK(args...) printf(args)
259 +#else
260 +#define PRINTK(args...)
261 +#endif
262 +
263 +
264 +#define FLASH_BANK_SIZE 0x02000000     /* 32 MB (during development)       */
265 +#define MAIN_SECT_SIZE  0x00040000     /* 256k per sector                  */
266 +
267 +#ifndef CFG_FLASH_CFI
268 +flash_info_t    flash_info[CFG_MAX_FLASH_BANKS];
269 +#endif
270 +
271 +static struct part_info part;
272 +static int current_part = -1;
273 +
274 +struct part_info* jffs2_part_info(int part_num) {
275 +       void *jffs2_priv_saved = part.jffs2_priv;
276 +
277 +       PRINTK2("jffs2_part_info: part_num=%i\n",part_num);
278 +
279 +       if (current_part == part_num)
280 +               return &part;
281 +
282 +       /* u-boot partition */
283 +       if(part_num==0){
284 +               memset(&part, 0, sizeof(part));
285 +
286 +               part.offset=(char*)0x00000000;
287 +               part.size=0x00040000;
288 +
289 +               /* Mark the struct as ready */
290 +               current_part = part_num;
291 +
292 +               PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
293 +               PRINTK("part.size   = 0x%08x\n",(unsigned int)part.size);
294 +       }
295 +
296 +       /* primary Kernel partition */
297 +       if(part_num==1){
298 +               memset(&part, 0, sizeof(part));
299 +
300 +               part.offset=(char*)0x00040000;
301 +               part.size=0x00040000*4;
302 +
303 +               /* Mark the struct as ready */
304 +               current_part = part_num;
305 +
306 +               PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
307 +               PRINTK("part.size   = 0x%08x\n",(unsigned int)part.size);
308 +       }
309 +
310 +       /* data partition */
311 +       if(part_num==3){
312 +               memset(&part, 0, sizeof(part));
313 +
314 +               part.offset=(char*)0x00140000;
315 +               part.size=FLASH_BANK_SIZE-0x00140000;
316 +
317 +               /* Mark the struct as ready */
318 +               current_part = part_num;
319 +
320 +               PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
321 +               PRINTK("part.size   = 0x%08x\n",(unsigned int)part.size);
322 +       }
323 +
324 +       if (current_part == part_num) {
325 +               part.usr_priv = &current_part;
326 +               part.jffs2_priv = jffs2_priv_saved;
327 +               return &part;
328 +       }
329 +
330 +       PRINTK("jffs2_part_info: end of partition table\n");
331 +       return 0;
332 +}
333 +#endif
334 --- /dev/null
335 +++ u-boot-1.1.2/include/configs/mnci.h
336 @@ -0,0 +1,309 @@
337 +/*
338 + * (C) Copyright 2005
339 + * Holger Schurig, M&N Solutions GmbH, Rosbach, Germany
340 + *
341 + * Configuration for the Auerswald Innokom CPU board.
342 + *
343 + * See file CREDITS for list of people who contributed to this
344 + * project.
345 + *
346 + * This program is free software; you can redistribute it and/or
347 + * modify it under the terms of the GNU General Public License as
348 + * published by the Free Software Foundation; either version 2 of
349 + * the License, or (at your option) any later version.
350 + *
351 + * This program is distributed in the hope that it will be useful,
352 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
353 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
354 + * GNU General Public License for more details.
355 + *
356 + * You should have received a copy of the GNU General Public License
357 + * along with this program; if not, write to the Free Software
358 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
359 + * MA 02111-1307 USA
360 + */
361 +
362 +#ifndef __CONFIG_H
363 +#define __CONFIG_H
364 +
365 +#include <asm/arch/pxa-regs.h>
366 +
367 +/*
368 + * If we are developing, we might want to start armboot from ram
369 + * so we MUST NOT initialize critical regs like mem-timing ...
370 + */
371 +#define CONFIG_INIT_CRITICAL                   /* undef for developing */
372 +
373 +/*
374 + * define the following to enable debug blinks.  A debug blink function
375 + * must be defined in memsetup.S
376 + */
377 +#undef DEBUG_BLINK_ENABLE      
378 +#undef DEBUG_BLINKC_ENABLE     
379 +
380 +/*
381 + * High Level Configuration Options
382 + * (easy to change)
383 + */
384 +#define CONFIG_PXA250          1       /* This is an PXA250 CPU    */
385 +
386 +#undef CONFIG_LCD
387 +#ifdef CONFIG_LCD
388 +#define CONFIG_SHARP_LM8V31
389 +#endif
390 +
391 +#define CONFIG_MMC             1
392 +#define BOARD_LATE_INIT                1
393 +
394 +#undef CONFIG_USE_IRQ                  /* we don't need IRQ/FIQ stuff */
395 +
396 +/*
397 + * Size of malloc() pool
398 + */
399 +#define CFG_MALLOC_LEN     (CFG_ENV_SIZE + 128*1024)
400 +#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
401 +
402 +/*
403 + * MNCI memory map information
404 + */
405 +
406 +#define MNCI_CS5_ETH_OFFSET    0x03400000
407 +
408 +
409 +/*
410 + * Hardware drivers
411 + */
412 +#if 0
413 +#define CONFIG_DRIVER_SMC91111         
414 +#define CONFIG_SMC91111_BASE   (PXA_CS5_PHYS + MNCI_CS5_ETH_OFFSET + 0x300)    
415 +#define CONFIG_SMC_USE_32_BIT  1
416 +//#define CONFIG_SMC_USE_IOFUNCS
417 +#endif
418 +
419 +/* the following has to be set high -- suspect something is wrong with
420 + * with the tftp timeout routines. FIXME!!!
421 + */
422 +#define CONFIG_NET_RETRY_COUNT 100
423 +
424 +/*
425 + * select serial console configuration
426 + */
427 +#define CONFIG_FFUART         1       /* we use FFUART on MNCI */
428 +
429 +/* allow to overwrite serial and ethaddr */
430 +//#define CONFIG_ENV_OVERWRITE
431 +
432 +#define CONFIG_BAUDRATE                115200
433 +
434 +#define CONFIG_COMMANDS ( 0                    \
435 +                       | CFG_CMD_ENV           \
436 +                       | CFG_CMD_FLASH         \
437 +                       | CFG_CMD_LINUX         \
438 +                       | CFG_CMD_JFFS2         \
439 +                       | CFG_CMD_LOADB         \
440 +                       | CFG_CMD_MEMORY        \
441 +                       | CFG_CMD_MISC          \
442 +                       | CFG_CMD_RUN           \
443 +                       )
444 +
445 +/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
446 +#include <cmd_confdefs.h>
447 +
448 +#define CONFIG_BOOTDELAY       0
449 +#define CONFIG_BOOTCOMMAND     "linux"
450 +#define CONFIG_BOOTARGS                "console=ttyS0,115200 rootfstype=jffs2 root=/dev/mtdblock2"
451 +//#define CONFIG_BOOTARGS      "console=ttyS0,115200 root=/dev/nfsroot ip=192.168.233.14:192.168.233.1:192.168.233.1:255.255.255.0:ramses2:eth0:off"
452 +#define CONFIG_CMDLINE_TAG     1
453 +#define CONFIG_SETUP_MEMORY_TAGS 1
454 +#define CFG_CONSOLE_INFO_QUIET  1
455 +#define CFG_JFFS_SINGLE_PART   1
456 +
457 +/* 
458 + * Current memory map for MNCI supplied Linux images:
459 + * 
460 + * Flash: 
461 + * 0x00000  - 0x003ffff: bootloader
462 + * 0x040000 - 0x013ffff: kernel
463 + * 0x140000 - 0x1ffffff: file system
464 + * 
465 + * RAM:
466 + * 0xa0008000 - kernel is loaded
467 + * 0xa1fe0000 - Uboot runs (48MB into RAM)
468 + *
469 + */
470 +
471 +#define MY_CONFIG_EXTRA_ENV_SETTINGS                                   \
472 +       "prog_boot_mmc="                                                \
473 +                       "mw.b 0xa0000000 0xff 0x40000; "                \
474 +                       "if      mmcinit && "                           \
475 +                               "fatload mmc 0 0xa0000000 u-boot.bin; " \
476 +                       "then "                                         \
477 +                               "protect off 0x0 0x3ffff; "             \
478 +                               "erase 0x0 0x3ffff; "                   \
479 +                               "cp.b 0xa0000000 0x0 0x40000; "         \
480 +                               "reset;"                                \
481 +                       "fi\0"                                          \
482 +       "prog_uImage_mmc="                                              \
483 +                       "mw.b 0xa0000000 0xff 0x1C0000; "               \
484 +                       "if      mmcinit && "                           \
485 +                               "fatload mmc 0 0xa0000000 uImage; "     \
486 +                       "then "                                         \
487 +                               "protect off 0x40000 0x13ffff; "                \
488 +                               "erase 0x40000 0x13ffff; "              \
489 +                               "cp.b 0xa0000000 0x40000 0x1C0000; "    \
490 +                       "fi\0"                                          \
491 +       "prog_jffs_mmc="                                                \
492 +                       "mw.b 0xa0000000 0xff 0x1e00000; "              \
493 +                       "if      mmcinit && "                           \
494 +                               "fatload mmc 0 0xa0000000 root.jffs; "  \
495 +                       "then "                                         \
496 +                               "protect off 0x200000 0x13fffff; "      \
497 +                               "erase 0x200000 0x13fffff; "            \
498 +                               "cp.b 0xa0000000 0x200000 0x1e00000; "  \
499 +                       "fi\0"                                          \
500 +       "boot_mmc="                                                     \
501 +                       "if      mmcinit && "                           \
502 +                               "fatload mmc 0 0xa1000000 uImage && "   \
503 +                       "then "                                         \
504 +                               "bootm 0xa1000000; "                    \
505 +                       "fi\0"                                          \
506 +       "prog_boot_net="                                                \
507 +                       "mw.b 0xa0000000 0xff 0x100000; "               \
508 +                       "if      bootp 0xa0000000 u-boot.bin; "         \
509 +                       "then "                                         \
510 +                               "protect off 0x0 0x3ffff; "             \
511 +                               "erase 0x0 0x3ffff; "                   \
512 +                               "cp.b 0xa0000000 0x0 0x40000; "         \
513 +                               "reset; "                               \
514 +                       "fi\0"                                          \
515 +       "prog_uImage_net="                                              \
516 +                       "mw.b 0xa0000000 0xff 0x1C0000; "               \
517 +                       "if      bootp 0xa0000000 uImage; "             \
518 +                       "then "                                         \
519 +                               "protect off 0x40000 0x13ffff; "                \
520 +                               "erase 0x40000 0x13ffff; "              \
521 +                               "cp.b 0xa0000000 0x40000 0x1C0000; "    \
522 +                       "fi\0"                                          \
523 +       "boot_uImage_net="                                              \
524 +                       "mw.b 0xa0000000 0xff 0x1C0000; "               \
525 +                       "if      bootp 0xa0000000 uImage; "             \
526 +                       "then "                                         \
527 +                                "bootm 0xa0000000; "                   \
528 +                       "fi\0"                                          \
529 +       "prog_jffs_net="                                                \
530 +                       "mw.b 0xa0000000 0xff 0x1e00000; "              \
531 +                       "if      bootp 0xa0000000 root.jffs; "          \
532 +                       "then "                                         \
533 +                               "protect off 0x200000 0x13fffff; "      \
534 +                               "erase 0x200000 0x13fffff; "            \
535 +                               "cp.b 0xa0000000 0x200000 0x1e00000; "  \
536 +                       "fi\0"
537 +
538 +#define CONFIG_EXTRA_ENV_SETTINGS                                      \
539 +       "bootargsnfs=console=ttyS0,115200 root=/dev/nfsroot ip=192.168.233.14:192.168.233.1:192.168.233.1:255.255.255.0:ramses2:eth0:off;\0" \
540 +       "boot_nfs="                                                     \
541 +                       "set bootargs $bootargsnfs; "                   \
542 +                       "linux\0"
543 +                       
544 +
545 +#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
546 +#define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
547 +#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
548 +#endif
549 +
550 +/*
551 + * Miscellaneous configurable options
552 + */
553 +//#define CFG_HUSH_PARSER              1
554 +//#define CFG_PROMPT_HUSH_PS2  "> "
555 +
556 +#define CFG_LONGHELP                           /* undef to save memory         */
557 +#define CFG_PROMPT             "mnci> "        /* Monitor Command Prompt */
558 +#define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
559 +#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
560 +#define CFG_MAXARGS            16              /* max number of command args   */
561 +#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
562 +#define CFG_DEVICE_NULLDEV     1
563 +
564 +#define CFG_MEMTEST_START      0xa0400000      /* memtest works on     */
565 +#define CFG_MEMTEST_END                0xa0800000      /* 4 ... 8 MB in DRAM   */
566 +
567 +#undef CFG_CLKS_IN_HZ          /* everything, incl board info, in Hz */
568 +
569 +#define CFG_LOAD_ADDR          0x40000         /* default load address */
570 +
571 +#define CFG_HZ                 3686400         /* incrementer freq: 3.6864 MHz */
572 +#define CFG_CPUSPEED           0x141           /* set core clock to 400/200/100 MHz */
573 +
574 +//#define RTC  1                               /* enable 32KHz osc */
575 +
576 +                                               /* valid baudrates */
577 +#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
578 +
579 +#define CFG_MMC_BASE           0xF0000000
580 +
581 +/*
582 + * Stack sizes
583 + *
584 + * The stack sizes are set up in start.S using the settings below
585 + */
586 +#define CONFIG_STACKSIZE       (256*1024)      /* regular stack */
587 +#ifdef CONFIG_USE_IRQ
588 +#define CONFIG_STACKSIZE_IRQ   (4*1024)        /* IRQ stack */
589 +#define CONFIG_STACKSIZE_FIQ   (4*1024)        /* FIQ stack */
590 +#endif
591 +
592 +
593 +/*
594 + * Environment
595 + */
596 +#define CFG_MONITOR_BASE       0
597 +#define CFG_MONITOR_LEN                0x40000
598 +
599 +#define CFG_ENV_IS_IN_FLASH    1
600 +#define CFG_ENV_ADDR           0x20000
601 +#define CFG_ENV_SIZE           0x4000
602 +#define        CFG_ENV_SECT_SIZE       0x40000
603 +
604 +/*
605 + * Physical Memory Map
606 + */
607 +#define CONFIG_NR_DRAM_BANKS   1          /* we have 1 banks of DRAM */
608 +#define PHYS_SDRAM_1           0xa0000000 /* SDRAM Bank #1 */
609 +#define PHYS_SDRAM_1_SIZE      0x08000000 /* 64 MB */
610 +
611 +#define PHYS_FLASH_1           0x00000000 /* Flash Bank #1 */
612 +#define PHYS_FLASH_2           0x02000000 /* Flash Bank #2 */
613 +#define PHYS_FLASH_SIZE                0x02000000 /* 32 MB */
614 +//#define PHYS_FLASH_BANK_SIZE 0x02000000 /* 32 MB Banks */
615 +//#define PHYS_FLASH_SECT_SIZE 0x00040000 /* 256 KB sectors (x2) */
616 +
617 +#define CFG_DRAM_BASE          PHYS_SDRAM_1
618 +#define CFG_DRAM_SIZE          PHYS_SDRAM_1_SIZE
619 +
620 +#define CFG_FLASH_BASE         PHYS_FLASH_1
621 +
622 +
623 +/*
624 + * JFFS2 Partitions
625 + */
626 +#define CFG_JFFS_CUSTOM_PART   1               /* see board/innokom/flash.c */
627 +
628 +
629 +/*
630 + * FLASH organization
631 + */
632 +#define CFG_FLASH_CFI
633 +#define CFG_FLASH_CFI_DRIVER   1
634 +
635 +#define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks           */
636 +#define CFG_MAX_FLASH_SECT     128  /* max number of sectors on one chip    */
637 +
638 +#define CFG_FLASH_USE_BUFFER_WRITE     1
639 +
640 +/* timeout values are in ticks */
641 +#define CFG_FLASH_ERASE_TOUT   (25*CFG_HZ) /* Timeout for Flash Erase */
642 +#define CFG_FLASH_WRITE_TOUT   (25*CFG_HZ) /* Timeout for Flash Write */
643 +
644 +
645 +#endif /* __CONFIG_H */
646 --- /dev/null
647 +++ u-boot-1.1.2/board/mnci/memsetup.S
648 @@ -0,0 +1,359 @@
649 +/*
650 + * Memory & peripheral setup of the XScale PXA250
651 + *
652 + * Written October 2002 by H.Schurig for M&N Logistik-Lösungen Online GmbH
653 + * http://www.mn-logistik.de/unsupported/pxa250/
654 + *
655 + * Number in Parentheses like (3-29) refer to pages in the
656 + *
657 + *     Intel PXA250 and PXA210
658 + *     Application Processor
659 + *     Developer's Manual
660 + *     February 2002
661 + *
662 + *
663 + * See file CREDITS for list of people who contributed to this
664 + * project.
665 + *
666 + * This program is free software; you can redistribute it and/or
667 + * modify it under the terms of the GNU General Public License as
668 + * published by the Free Software Foundation; either version 2 of
669 + * the License, or (at your option) any later version.
670 + *
671 + * This program is distributed in the hope that it will be useful,
672 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
673 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
674 + * GNU General Public License for more details.
675 + *
676 + * You should have received a copy of the GNU General Public License
677 + * along with this program; if not, write to the Free Software
678 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
679 + * MA 02111-1307 USA
680 + */
681 +
682 +#include <config.h>
683 +#include <version.h>
684 +#include <asm/arch/pxa-regs.h>
685 +
686 +
687 +/**********************************************************************
688 + *
689 + * reginit
690 + *
691 + * PURPOSE:   initialize stuff using a addr/data pair table
692 + * PARAMS:    r0 - address the the table
693 + * REGISTERS: r0, r1, r2, r3
694 + * CALLS:     Nothing
695 + * RETURNS:   Nothing
696 + **********************************************************************/
697 +reginit:
698 +1:     ldmia   r0!, {r1,r2}                    @ load reg/value from regtable
699 +       cmp     r1, #0                          @ at end?
700 +       strne   r2, [r1]                        @ if not, store value into reg
701 +       ldrne   r3, [r1]                        @ if not, read it back (see PXA errata)
702 +       bne     1b                              @ if not, branch back
703 +       mov     pc, lr
704 +
705 +
706 +/**********************************************************************
707 + *
708 + * memsetup
709 + *
710 + * PURPOSE:
711 + * PARAMS:
712 + * REGISTERS:
713 + * CALLS:     
714 + * RETURNS:   Nothing
715 + **********************************************************************/
716 +
717 +.globl memsetup
718 +memsetup:
719 +       mov     r11, lr
720 +
721 +       adr     r0, SystemUnitTable
722 +       bl      reginit
723 +
724 +       @ Steps 2a..4d
725 +       adr     r0,MemTable1
726 +       bl      reginit
727 +
728 +       @ Step 4e wait 200 usec
729 +       ldr     r0, oscr_addr
730 +       ldr     r1, [r0]
731 +       add     r1,r1,#0x300                    @ Current OSCR+0x300
732 +1:
733 +       ldr     r2, [r0]
734 +       cmp     r1, r2
735 +       bgt     1b
736 +       
737 +       @ TODO: data cache must be off, see Developers Manual, Section 6.12,
738 +       @ page 6-77, point 6.
739 +
740 +       @ Step 4f attempt read access to trigger a number of refresh cycles
741 +       ldr     r2, =CFG_DRAM_BASE
742 +.rept 8
743 +       str     r2, [r2]
744 +.endr
745 +
746 +       @ TODO: re-enable data cache
747 +
748 +       @ Steps 4g..4h
749 +       adr     r0,MemTable2
750 +       bl      reginit
751 +       @ Done with memory setup
752 +
753 +
754 +       @ Check if we return from Sleep Mode via RCSR (3-33)
755 +       ldr     r0, rcsr_addr
756 +       ldr     r1, [r0]
757 +       and     r1,r1,#0xf                      @ mask RCSR_HWR|RCSR_WDR|RCSR_SMR|RCSR_GPR
758 +       str     r1, [r0]                        @ clear Reset Controll State Register
759 +       teq     r1, #4                          @ RCSR_SMR (Sleep Mode)
760 +       beq     WakeUp
761 +
762 +       @ Issue Frequency Change Sequence
763 +freqchange:
764 +       mov     r0, #3
765 +       mcr     p14, 0, r0, c6, c0, 0
766 +       mov     pc, r11
767 +
768 +WakeUp:
769 +       @ retrieve the scratchpad value and jump to that address
770 +       ldr     r0, pspr_addr
771 +       ldr     pc, [r0]
772 +
773 +
774 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
775 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
776 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
777 +
778 +       
779 +SystemUnitTable:
780 +       @ (4-22) Mask all interrupts
781 +       .long   ICMR,   0x00000000              @ PM
782 +       @ (4-22) Interrupts are IRQs, not FIQs
783 +       .long   ICLR,   0x00000000
784 +       @ (4-23) Only enabled and unmasked interrupts bring the CPU out of idle mode
785 +       .long   ICCR,   0x00000001
786 +       @ (4-41) Clear OS Timer Match bits
787 +       .long   OSSR,   0x0000000f              @ NO PM
788 +       @ (3-34) Set clock register (we change CP14,6 at the end of this function)
789 +       .long   CCCR,   0x00000161              @ NO PM, 121 is slow, 241 is medium, 161 is fast
790 +       @ (3-38) Enable 32 kHz Oszillator
791 +       .long   OSCC,   0x00000002
792 +
793 +       @ (3-36) Enable needed clocks
794 +       .long   CKEN,   0x00000043              @ PM: FFUART, PWM0, PWM1
795 +
796 +       .long   0x17c00004,8                    @ CPLD: PER_PWR_EN
797 +
798 +// Bit       GPIO  Level  Function     Direct  Altern Function
799 +// --------------------------------------------------
800 +// 00000001  0     1      nc           Input   0 normal GPIO
801 +// 00000002  1     1      nPFI         Input   0 normal GPIO
802 +// 00000004  2     1      BAT_DATA     Input   0 normal GPIO
803 +// 00000008  3     1      IRQ_KEY      Input   0 normal GPIO
804 +// 00000010  4     0      IRQ_ETH      Input   0 normal GPIO
805 +// 00000020  5     1      nc           Input   0 normal GPIO
806 +// 00000040  6     0      MMC_CLK      Output  1 MMC_CLK
807 +// 00000080  7     1      IRQ_GSM      Input   0 normal GPIO
808 +// 00000100  8     1      nPCC_S1_CD   Input   0 normal GPIO
809 +// 00000200  9     1      nMMC_CD      Input   0 normal GPIO
810 +// 00000400  10    1      IRQ_RTC      Input   0 normal GPIO
811 +// 00000800  11    0      nc 3M6       Output  1 3.6 MHz
812 +// 00001000  12    1      nc           Input   0 normal GPIO
813 +// 00002000  13    1      IRQ_DOCK     Input   0 normal GPIO
814 +// 00004000  14    1      nc           Input   0 normal GPIO
815 +// 00008000  15    1      nc nCS1      Output  2 nCS1
816 +
817 +// 00010000  16    1      PWM0         Output  2 PWM0
818 +// 00020000  17    1      PWM1         Output  2 PWM1
819 +// 00040000  18    1      RDY          Input   1 RDY
820 +// 00080000  19    1      nPCC_S0_IRQ  Input   0 normal GPIO
821 +// 00100000  20    1      nc           Input   0 normal GPIO
822 +// 00200000  21    1      AC97_IRQ     Input   0 normal GPIO
823 +// 00400000  22    1      nPCC_S1_IRQ  Input   0 normal GPIO
824 +// 00800000  23    1      nc IRQ_GSM   Input   0 normal GPIO
825 +// 01000000  24    0      UART_INTB    Input   0 normal GPIO
826 +// 02000000  25    0      UART_INTC    Input   0 normal GPIO
827 +// 04000000  26    1      UART_INTD    Input   0 normal GPIO
828 +// 08000000  27    0      nc cpldfree  Input   0 normal GPIO
829 +// 10000000  28    1      AUD_BITCLK   Input   1 97_BITCLK
830 +// 20000000  29    0      AUD_SDIN0    Input   1 97_SDATAIN0
831 +// 40000000  30    0      AUD_SDOUT    Output  2 97_SDATAOUT
832 +// 80000000  31    0      AUD_SYNC     Output  2 97_SYNC
833 +
834 +       .long   GPSR0,  0x00008000              @ set nCS1
835 +       .long   GPDR0,  0xd0038840              @ out MMC_CLK, 3M6, nCS1, PWM0, PWM1
836 +       .long   GAFR0_L,0x80401000              @ MMC_CLK:1, 3M6:1, nCS1:2
837 +       .long   GAFR0_U,0xA500001a              @ PWM0:2, PWM1:2, RDY:1
838 +                                               @ 97_BITCLK:1, 97_SDATAIN0:1, 97_SDATAOUT:2, 97_SYNC:2
839 +       .long   PGSR0,  0x00028000              @ sleep set: nCS1, PWM1
840 +       .long   GRER0,  0x00000000              @ rising edge detect: none
841 +       .long   GFER0,  0x00000000              @ falling edge detect: none
842 +
843 +
844 +// 00000001  32    0      USB_INT      Input   0 normal GPIO
845 +// 00000002  33    1      nCS5         Output  2 nCS5
846 +// 00000004  34    1      FF_RXD       Input   1 FF_RXD
847 +// 00000008  35    1      FF_CTS       Input   1 FF_CTS
848 +// 00000010  36    1      FF_DCD       Input   1 FF_DCD
849 +// 00000020  37    1      FF_DSR       Input   1 FF_DSR
850 +// 00000040  38    1      FF_RI        Input   1 FF_RI
851 +// 00000080  39    0      FF_TXD       Output  2 FF_TXD
852 +// 00000100  40    0      FF_DTR       Output  2 FF_DTR
853 +// 00000200  41    0      FF_RTS       Output  2 FF_RTS
854 +// 00000400  42    1      BT_RXD       Input   1 BT_RXD
855 +// 00000800  43    1      BT_TXD       Output  2 BT_TXD
856 +// 00001000  44    0      BT_CTS       Input   1 BT_CTS
857 +// 00002000  45    1      BT_RTS       Output  2 BT_RTS
858 +// 00004000  46    1      IR_RXD       Input   1 ICP_RXD
859 +// 00008000  47    0      IR_TXD       Output  2 ICP_TXD
860 +// 00010000  48    1      nPOE         Output  2 nPOE
861 +// 00020000  49    1      nPWE         Output  2 nPWE
862 +// 00040000  50    1      nPIOR        Output  2 nPIOR
863 +// 00080000  51    1      nPIOW        Output  2 nPIOW
864 +// 00100000  52    1      nPCE1        Output  2 nPCE1
865 +// 00200000  53    1      nPCE2        Output  2 nPCE2
866 +// 00400000  54    0      nPKTSEL      Output  2 nPKTSEL
867 +// 00800000  55    1      nPREG        Output  2 nPREG
868 +// 01000000  56    1      nPWAIT       Input   1 nPWAIT
869 +// 02000000  57    1      nIOIS16      Input   1 nIOI16
870 +// 04000000  58    0      LDD0         Output  2 LDD0
871 +// 08000000  59    1      LDD1         Output  2 LDD1
872 +// 10000000  60    0      LDD2         Output  2 LDD2
873 +// 20000000  61    1      LDD3         Output  2 LDD3
874 +// 40000000  62    0      LDD4         Output  2 LDD4
875 +// 80000000  63    0      LDD5         Output  2 LDD5
876 +
877 +       .long   GPSR1,  0x00020302              @ set nCS5, FF_RTS, FF_DTR, nPWE
878 +       .long   GPCR1,  0x00000080              @ clear FF_TXD
879 +       .long   GPDR1,  0xfcffab82              @ out: nCS5, FF_TXD, FF_DTR, FF_RTS, BT_TXD,
880 +                                               @      BT_RTS, IR_TXD, nPOE...nPREG, LDD0..LDD5
881 +       .long   GAFR1_L,0x999a9558              @
882 +       .long   GAFR1_U,0xaaa5aaaa              @
883 +       .long   PGSR1,  0x00020002              @ sleep set: nCS5, nPWE
884 +       .long   GRER1,  0x00000000              @
885 +       .long   GFER1,  0x00000000              @
886 +
887 +
888 +
889 +// 00000001  64    0      LDD6         Output  2 LDD6
890 +// 00000002  65    1      LDD7         Output  2 LDD7
891 +// 00000004  66    1      LDD8         Output  2 LDD8
892 +// 00000008  67    0      LDD9         Output  2 LDD9
893 +// 00000010  68    1      LDD10        Output  2 LDD10
894 +// 00000020  69    0      LDD11        Output  2 LDD11
895 +// 00000040  70    0      LDD12        Output  2 LDD12
896 +// 00000080  71    1      LDD13        Output  2 LDD13
897 +// 00000100  72    0      LDD14        Output  2 LDD14
898 +// 00000200  73    0      LDD15        Output  2 LDD15
899 +// 00000400  74    1      FCLK         Output  2 FCLK
900 +// 00000800  75    1      LCLK         Output  2 LCLK
901 +// 00001000  76    1      PCLK         Output  2 PCLK
902 +// 00002000  77    0      BIAS         Output  2 ACBIAS
903 +// 00004000  78    1      nCS2         Output  2 nCS2
904 +// 00008000  79    1      nCS3         Output  2 nCS3
905 +// 00010000  80    1      nCS4         Output  2 nCS4
906 +// 00020000  81    1      nc           Input   0 normal GPIO
907 +// 00040000  82    1      nc           Input   0 normal GPIO
908 +// 00080000  83    1      nc           Input   0 normal GPIO
909 +// 00100000  84    1      nc           Input   0 normal GPIO
910 +
911 +       .long   GPSR2,  0x0001c000              @ set nCS2..4
912 +       .long   GPDR2,  0x0001FFFF              @ out: LDD6..nCS4
913 +       .long   GAFR2_L,0xaaaaaaaa              @
914 +       .long   GAFR2_U,0x00000002              @
915 +       .long   PGSR2,  0x0001c000              @ sleep set: nCS2..4
916 +       .long   GRER2,  0x00000000              @
917 +       .long   GFER2,  0x00000000              @
918 +
919 +       @ (3-25) Power Wakeup Registers
920 +       .long   PWER,   0x00000008              @ wake up on IRQ_KEY
921 +       .long   PRER,   0x00000008              @ detect rising edge on IRQ_KEY
922 +       .long   PFER,   0x00000000              @ dont detect falling edges
923 +
924 +       @ (3-28) Power Manager Edge Detect Status Register
925 +       .long   PEDR,   0x00000008              @ clear edge detect status for IRQ_KEY
926 +
927 +       @ (3-29) Sleep State Register
928 +       .long   PSSR,   0x00000030              @ clear PH and RDH
929 +
930 +       .long   PWM_CTRL0,     0
931 +       .long   PWM_CTRL0,     0
932 +       .long   PWM_PERVAL0, 512
933 +       .long   PWM_PERVAL1, 512
934 +       .long   PWM_PWDUTY0, 440
935 +       .long   PWM_PWDUTY1, 450
936 +
937 +       @ End
938 +       .long   0,0
939 +
940 +
941 +
942 +
943 +MemTable1:
944 +       @ Info on this sequence is in the OS Developers Guide, Section 10.0 on page 13
945 +       @ also see Developers Manual, Section 6.12 on page 6-76
946 +
947 +       @ write MSC0, MSC1, MSC2 (6-44)
948 +       .long   MSC0,   0x7ff0fdc3              @ f4c0
949 +       .long   MSC1,   0x29842981
950 +       .long   MSC2,   0x29842984
951 +
952 +       @ no synchronous static stuff here
953 +       .long   SXCNFG, 0x00000000              @ (6-31)
954 +
955 +       @ write MECR (6-60), MCMEMx (6-57), MCATTx (6-58), MCIOx (6-58)
956 +       .long   MECR,   0x00000003
957 +       .long   MCMEM0, 0x00020418
958 +       .long   MCMEM1, 0x00020418
959 +       .long   MCATT0, 0x0002449D
960 +       .long   MCATT1, 0x0002449D
961 +       .long   MCIO0,  0x00014290
962 +       .long   MCIO1,  0x00014290
963 +
964 +       @ write FLYCNFG (that register is now undocumented)
965 +
966 +       @ OS Developers Manual: write MDREFR (6-15), K0RUN and K0PIN are
967 +       @       set for synchronous static memory. The desired value of
968 +       @       K0DB2 can be programmed. KxFREE can be deasserted. APD must
969 +       @       remain deasserted and SLFRSH must remain asserted.
970 +       @ Developers Manual: write K0RUN and E0PIN. Configure K0DB2. Retain
971 +       @       the current values of APD and SLFRSH. DRI must contain a
972 +       @       valid value. Deassert KxFREE.
973 +       .long   MDREFR, 0x00400016              @ 2d KxFREE & APD deasserted, SLFRSH asserted
974 +
975 +       @ Developers Manual: in systems containing Synchronous Static Memory, write
976 +       @ to SXCNFG, including the enable bits.
977 +       @.long  SXCNFG, 0x00000000              @ no Synchronous Static Memory
978 +
979 +       @ Assert K1RUN and K2RUN and configure K1DB2 and K2DB2
980 +       .long   MDREFR, 0x00450016              @ 4a
981 +       .long   MDREFR, 0x00050016              @ 4b deassert SLFRFH
982 +       .long   MDREFR, 0x00058016              @ 4c assert E1PIN
983 +       .long   MDCNFG, 0x0A000AC8              @ 4d without DE0/DE1 (6-10)
984 +       .long   0,0
985 +
986 +oscr_addr:
987 +       .long   OSCR
988 +rcsr_addr:
989 +       .long   RCSR
990 +pspr_addr:
991 +       .long   PSPR
992 +
993 +
994 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
995 +
996 +       
997 +MemTable2:
998 +       .long   MDCNFG, 0x0A000ACB              @ 4d with DE0/DE1
999 +       .long   MDMRS,  0x00000000              @ 4h
1000 +       .long   MDREFR, 0x00118016              @ 5 (optional) turn APD on
1001 +       .long   0x17C0002C, 0x00000011          @ MNCI: enable FFUART driver
1002 +       .long   0x17c00034, 0x00000000          @ MNCI: enable flash write
1003 +       .long   0x17c00028, 0x00000000          @ MNCI: turn off CF-Card enable
1004 +       .long   0x17c00014, 0x00000000          @ MNCI: turn off CF-Card power
1005 +       .long   0x10000000, 0x0000d803          @ MNCI: disable all LEDs, SCANNER_WAKE & SCANNER_TRIG on
1006 +@      .long   0x10000000, 0x0000d80b          @ MNCI: disable all LEDs, SCANNER_WAKE, SCANNER_TRIG & UARTB on
1007 +       .long   0,0