Commit 4ec3a7f0fdbad19ad4fa0172b97451b98e82316a

Authored by wdenk
1 parent 79536a6eb0
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

Patch by Vincent Dubey, 24 Sep 2004:

Add support for xaeniax board

Showing 10 changed files with 1603 additions and 1 deletions Side-by-side Diff

... ... @@ -2,6 +2,9 @@
2 2 Changes since U-Boot 1.1.1:
3 3 ======================================================================
4 4  
  5 +* Patch by Vincent Dubey, 24 Sep 2004:
  6 + Add support for xaeniax board
  7 +
5 8 * Add comment about non-GPL character of standalone applications to
6 9 COPYING file
7 10  
... ... @@ -149,7 +149,11 @@
149 149 ## Xscale Systems
150 150 #########################################################################
151 151  
152   -LIST_pxa="cerf250 cradle csb226 innokom lubbock wepep250 xm250 xsengine"
  152 +LIST_pxa=" \
  153 + cerf250 cradle csb226 innokom \
  154 + lubbock wepep250 xaeniax xm250 \
  155 + xsengine \
  156 +"
153 157  
154 158 LIST_ixp="ixdp425"
155 159  
... ... @@ -1316,6 +1316,9 @@
1316 1316 wepep250_config : unconfig
1317 1317 @./mkconfig $(@:_config=) arm pxa wepep250
1318 1318  
  1319 +xaeniax_config : unconfig
  1320 + @./mkconfig $(@:_config=) arm pxa xaeniax
  1321 +
1319 1322 xm250_config : unconfig
1320 1323 @./mkconfig $(@:_config=) arm pxa xm250
1321 1324  
board/xaeniax/Makefile
  1 +#
  2 +# (C) Copyright 2000, 2002
  3 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4 +#
  5 +# See file CREDITS for list of people who contributed to this
  6 +# project.
  7 +#
  8 +# This program is free software; you can redistribute it and/or
  9 +# modify it under the terms of the GNU General Public License as
  10 +# published by the Free Software Foundation; either version 2 of
  11 +# the License, or (at your option) any later version.
  12 +#
  13 +# This program is distributed in the hope that it will be useful,
  14 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 +# GNU General Public License for more details.
  17 +#
  18 +# You should have received a copy of the GNU General Public License
  19 +# along with this program; if not, write to the Free Software
  20 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 +# MA 02111-1307 USA
  22 +#
  23 +
  24 +include $(TOPDIR)/config.mk
  25 +
  26 +LIB = lib$(BOARD).a
  27 +
  28 +OBJS := xaeniax.o flash.o
  29 +SOBJS := memsetup.o
  30 +
  31 +$(LIB): $(OBJS) $(SOBJS)
  32 + $(AR) crv $@ $(OBJS) $(SOBJS)
  33 +
  34 +clean:
  35 + rm -f $(SOBJS) $(OBJS)
  36 +
  37 +distclean: clean
  38 + rm -f $(LIB) core *.bak .depend
  39 +
  40 +#########################################################################
  41 +
  42 +.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
  43 + $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
  44 +
  45 +-include .depend
  46 +
  47 +#########################################################################
board/xaeniax/config.mk
  1 +TEXT_BASE = 0xa3FB0000
  2 +#TEXT_BASE = 0
board/xaeniax/flash.c
  1 +/*
  2 + * (C) Copyright 2001
  3 + * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
  4 + *
  5 + * (C) Copyright 2001
  6 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7 + *
  8 + * See file CREDITS for list of people who contributed to this
  9 + * project.
  10 + *
  11 + * This program is free software; you can redistribute it and/or
  12 + * modify it under the terms of the GNU General Public License as
  13 + * published by the Free Software Foundation; either version 2 of
  14 + * the License, or (at your option) any later version.
  15 + *
  16 + * This program is distributed in the hope that it will be useful,
  17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19 + * GNU General Public License for more details.
  20 + *
  21 + * You should have received a copy of the GNU General Public License
  22 + * along with this program; if not, write to the Free Software
  23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24 + * MA 02111-1307 USA
  25 + */
  26 +
  27 +#include <common.h>
  28 +#include <linux/byteorder/swab.h>
  29 +
  30 +
  31 +flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
  32 +
  33 +/* Board support for 1 or 2 flash devices */
  34 +#define FLASH_PORT_WIDTH32
  35 +#undef FLASH_PORT_WIDTH16
  36 +
  37 +#ifdef FLASH_PORT_WIDTH16
  38 +#define FLASH_PORT_WIDTH ushort
  39 +#define FLASH_PORT_WIDTHV vu_short
  40 +#define SWAP(x) __swab16(x)
  41 +#else
  42 +#define FLASH_PORT_WIDTH ulong
  43 +#define FLASH_PORT_WIDTHV vu_long
  44 +#define SWAP(x) __swab32(x)
  45 +#endif
  46 +
  47 +#define FPW FLASH_PORT_WIDTH
  48 +#define FPWV FLASH_PORT_WIDTHV
  49 +
  50 +#define mb() __asm__ __volatile__ ("" : : : "memory")
  51 +
  52 +/*-----------------------------------------------------------------------
  53 + * Functions
  54 + */
  55 +static ulong flash_get_size (FPW *addr, flash_info_t *info);
  56 +static int write_data (flash_info_t *info, ulong dest, FPW data);
  57 +static void flash_get_offsets (ulong base, flash_info_t *info);
  58 +void inline spin_wheel (void);
  59 +
  60 +/*-----------------------------------------------------------------------
  61 + */
  62 +
  63 +unsigned long flash_init (void)
  64 +{
  65 + int i;
  66 + ulong size = 0;
  67 +
  68 + for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
  69 + switch (i) {
  70 + case 0:
  71 + flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
  72 + flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
  73 + break;
  74 + case 1:
  75 + flash_get_size ((FPW *) PHYS_FLASH_2, &flash_info[i]);
  76 + flash_get_offsets (PHYS_FLASH_2, &flash_info[i]);
  77 + break;
  78 + default:
  79 + panic ("configured too many flash banks!\n");
  80 + break;
  81 + }
  82 + size += flash_info[i].size;
  83 + }
  84 +
  85 + /* Protect monitor and environment sectors
  86 + */
  87 + flash_protect ( FLAG_PROTECT_SET,
  88 + CFG_FLASH_BASE,
  89 + CFG_FLASH_BASE + monitor_flash_len - 1,
  90 + &flash_info[0] );
  91 +
  92 + flash_protect ( FLAG_PROTECT_SET,
  93 + CFG_ENV_ADDR,
  94 + CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0] );
  95 +
  96 + return size;
  97 +}
  98 +
  99 +/*-----------------------------------------------------------------------
  100 + */
  101 +static void flash_get_offsets (ulong base, flash_info_t *info)
  102 +{
  103 + int i;
  104 +
  105 + if (info->flash_id == FLASH_UNKNOWN) {
  106 + return;
  107 + }
  108 +
  109 + if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
  110 + for (i = 0; i < info->sector_count; i++) {
  111 + info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
  112 + info->protect[i] = 0;
  113 + }
  114 + }
  115 +}
  116 +
  117 +/*-----------------------------------------------------------------------
  118 + */
  119 +void flash_print_info (flash_info_t *info)
  120 +{
  121 + int i;
  122 +
  123 + if (info->flash_id == FLASH_UNKNOWN) {
  124 + printf ("missing or unknown FLASH type\n");
  125 + return;
  126 + }
  127 +
  128 + switch (info->flash_id & FLASH_VENDMASK) {
  129 + case FLASH_MAN_INTEL:
  130 + printf ("INTEL ");
  131 + break;
  132 + default:
  133 + printf ("Unknown Vendor ");
  134 + break;
  135 + }
  136 +
  137 + switch (info->flash_id & FLASH_TYPEMASK) {
  138 + case FLASH_28F128J3A:
  139 + printf ("28F128J3A\n");
  140 + break;
  141 + default:
  142 + printf ("Unknown Chip Type\n");
  143 + break;
  144 + }
  145 +
  146 + printf (" Size: %ld MB in %d Sectors\n",
  147 + info->size >> 20, info->sector_count);
  148 +
  149 + printf (" Sector Start Addresses:");
  150 + for (i = 0; i < info->sector_count; ++i) {
  151 + if ((i % 5) == 0)
  152 + printf ("\n ");
  153 + printf (" %08lX%s",
  154 + info->start[i],
  155 + info->protect[i] ? " (RO)" : " ");
  156 + }
  157 + printf ("\n");
  158 + return;
  159 +}
  160 +
  161 +/*
  162 + * The following code cannot be run from FLASH!
  163 + */
  164 +static ulong flash_get_size (FPW *addr, flash_info_t *info)
  165 +{
  166 + volatile FPW value;
  167 +
  168 + /* Write auto select command: read Manufacturer ID */
  169 + addr[0x5555] = (FPW) 0x00AA00AA;
  170 + addr[0x2AAA] = (FPW) 0x00550055;
  171 + addr[0x5555] = (FPW) 0x00900090;
  172 +
  173 + mb ();
  174 + value = addr[0];
  175 +
  176 + switch (value) {
  177 +
  178 + case (FPW) INTEL_MANUFACT:
  179 + info->flash_id = FLASH_MAN_INTEL;
  180 + break;
  181 +
  182 + default:
  183 + info->flash_id = FLASH_UNKNOWN;
  184 + info->sector_count = 0;
  185 + info->size = 0;
  186 + addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
  187 + return (0); /* no or unknown flash */
  188 + }
  189 +
  190 + mb ();
  191 + value = addr[1]; /* device ID */
  192 +
  193 + switch (value) {
  194 +
  195 + case (FPW) INTEL_ID_28F128J3A:
  196 + info->flash_id += FLASH_28F128J3A;
  197 + info->sector_count = 128;
  198 + info->size = 0x02000000;
  199 + break; /* => 16 MB */
  200 +
  201 + default:
  202 + info->flash_id = FLASH_UNKNOWN;
  203 + break;
  204 + }
  205 +
  206 + if (info->sector_count > CFG_MAX_FLASH_SECT) {
  207 + printf ("** ERROR: sector count %d > max (%d) **\n",
  208 + info->sector_count, CFG_MAX_FLASH_SECT);
  209 + info->sector_count = CFG_MAX_FLASH_SECT;
  210 + }
  211 +
  212 + addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
  213 +
  214 + return (info->size);
  215 +}
  216 +
  217 +
  218 +/*-----------------------------------------------------------------------
  219 + */
  220 +
  221 +int flash_erase (flash_info_t *info, int s_first, int s_last)
  222 +{
  223 + int flag, prot, sect;
  224 + ulong type, start, last;
  225 + int rcode = 0;
  226 +
  227 + if ((s_first < 0) || (s_first > s_last)) {
  228 + if (info->flash_id == FLASH_UNKNOWN) {
  229 + printf ("- missing\n");
  230 + } else {
  231 + printf ("- no sectors to erase\n");
  232 + }
  233 + return 1;
  234 + }
  235 +
  236 + type = (info->flash_id & FLASH_VENDMASK);
  237 + if ((type != FLASH_MAN_INTEL)) {
  238 + printf ("Can't erase unknown flash type %08lx - aborted\n",
  239 + info->flash_id);
  240 + return 1;
  241 + }
  242 +
  243 + prot = 0;
  244 + for (sect = s_first; sect <= s_last; ++sect) {
  245 + if (info->protect[sect]) {
  246 + prot++;
  247 + }
  248 + }
  249 +
  250 + if (prot) {
  251 + printf ("- Warning: %d protected sectors will not be erased!\n",
  252 + prot);
  253 + } else {
  254 + printf ("\n");
  255 + }
  256 +
  257 + start = get_timer (0);
  258 + last = start;
  259 +
  260 + /* Disable interrupts which might cause a timeout here */
  261 + flag = disable_interrupts ();
  262 +
  263 + /* Start erase on unprotected sectors */
  264 + for (sect = s_first; sect <= s_last; sect++) {
  265 + if (info->protect[sect] == 0) { /* not protected */
  266 + FPWV *addr = (FPWV *) (info->start[sect]);
  267 + FPW status;
  268 +
  269 + printf ("Erasing sector %2d ... ", sect);
  270 +
  271 + /* arm simple, non interrupt dependent timer */
  272 + reset_timer_masked ();
  273 +
  274 + *addr = (FPW) 0x00500050; /* clear status register */
  275 + *addr = (FPW) 0x00200020; /* erase setup */
  276 + *addr = (FPW) 0x00D000D0; /* erase confirm */
  277 +
  278 + while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
  279 + if (get_timer_masked () > CFG_FLASH_ERASE_TOUT) {
  280 + printf ("Timeout\n");
  281 + *addr = (FPW) 0x00B000B0; /* suspend erase */
  282 + *addr = (FPW) 0x00FF00FF; /* reset to read mode */
  283 + rcode = 1;
  284 + break;
  285 + }
  286 + }
  287 +
  288 + *addr = 0x00500050; /* clear status register cmd. */
  289 + *addr = 0x00FF00FF; /* resest to read mode */
  290 +
  291 + printf (" done\n");
  292 + }
  293 + }
  294 + return rcode;
  295 +}
  296 +
  297 +/*-----------------------------------------------------------------------
  298 + * Copy memory to flash, returns:
  299 + * 0 - OK
  300 + * 1 - write timeout
  301 + * 2 - Flash not erased
  302 + * 4 - Flash not identified
  303 + */
  304 +
  305 +int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
  306 +{
  307 + ulong cp, wp;
  308 + FPW data;
  309 + int count, i, l, rc, port_width;
  310 +
  311 + if (info->flash_id == FLASH_UNKNOWN) {
  312 + return 4;
  313 + }
  314 +/* get lower word aligned address */
  315 +#ifdef FLASH_PORT_WIDTH16
  316 + wp = (addr & ~1);
  317 + port_width = 2;
  318 +#else
  319 + wp = (addr & ~3);
  320 + port_width = 4;
  321 +#endif
  322 +
  323 + /*
  324 + * handle unaligned start bytes
  325 + */
  326 + if ((l = addr - wp) != 0) {
  327 + data = 0;
  328 + for (i = 0, cp = wp; i < l; ++i, ++cp) {
  329 + data = (data << 8) | (*(uchar *) cp);
  330 + }
  331 + for (; i < port_width && cnt > 0; ++i) {
  332 + data = (data << 8) | *src++;
  333 + --cnt;
  334 + ++cp;
  335 + }
  336 + for (; cnt == 0 && i < port_width; ++i, ++cp) {
  337 + data = (data << 8) | (*(uchar *) cp);
  338 + }
  339 +
  340 + if ((rc = write_data (info, wp, SWAP (data))) != 0) {
  341 + return (rc);
  342 + }
  343 + wp += port_width;
  344 + }
  345 +
  346 + /*
  347 + * handle word aligned part
  348 + */
  349 + count = 0;
  350 + while (cnt >= port_width) {
  351 + data = 0;
  352 + for (i = 0; i < port_width; ++i) {
  353 + data = (data << 8) | *src++;
  354 + }
  355 + if ((rc = write_data (info, wp, SWAP (data))) != 0) {
  356 + return (rc);
  357 + }
  358 + wp += port_width;
  359 + cnt -= port_width;
  360 + if (count++ > 0x800) {
  361 + spin_wheel ();
  362 + count = 0;
  363 + }
  364 + }
  365 +
  366 + if (cnt == 0) {
  367 + return (0);
  368 + }
  369 +
  370 + /*
  371 + * handle unaligned tail bytes
  372 + */
  373 + data = 0;
  374 + for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
  375 + data = (data << 8) | *src++;
  376 + --cnt;
  377 + }
  378 + for (; i < port_width; ++i, ++cp) {
  379 + data = (data << 8) | (*(uchar *) cp);
  380 + }
  381 +
  382 + return (write_data (info, wp, SWAP (data)));
  383 +}
  384 +
  385 +/*-----------------------------------------------------------------------
  386 + * Write a word or halfword to Flash, returns:
  387 + * 0 - OK
  388 + * 1 - write timeout
  389 + * 2 - Flash not erased
  390 + */
  391 +static int write_data (flash_info_t *info, ulong dest, FPW data)
  392 +{
  393 + FPWV *addr = (FPWV *) dest;
  394 + ulong status;
  395 + int flag;
  396 +
  397 + /* Check if Flash is (sufficiently) erased */
  398 + if ((*addr & data) != data) {
  399 + printf ("not erased at %08lx (%lx)\n", (ulong) addr, *addr);
  400 + return (2);
  401 + }
  402 + /* Disable interrupts which might cause a timeout here */
  403 + flag = disable_interrupts ();
  404 +
  405 + *addr = (FPW) 0x00400040; /* write setup */
  406 + *addr = data;
  407 +
  408 + /* arm simple, non interrupt dependent timer */
  409 + reset_timer_masked ();
  410 +
  411 + /* wait while polling the status register */
  412 + while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
  413 + if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
  414 + *addr = (FPW) 0x00FF00FF; /* restore read mode */
  415 + return (1);
  416 + }
  417 + }
  418 +
  419 + *addr = (FPW) 0x00FF00FF; /* restore read mode */
  420 +
  421 + return (0);
  422 +}
  423 +
  424 +void inline spin_wheel (void)
  425 +{
  426 + static int p = 0;
  427 + static char w[] = "\\/-";
  428 +
  429 + printf ("\010%c", w[p]);
  430 + (++p == 3) ? (p = 0) : 0;
  431 +}
board/xaeniax/memsetup.S
  1 + /*
  2 + * Most of this taken from Redboot hal_platform_setup.h with cleanup
  3 + *
  4 + * NOTE: I haven't clean this up considerably, just enough to get it
  5 + * running. See hal_platform_setup.h for the source. See
  6 + * board/cradle/memsetup.S for another PXA250 setup that is
  7 + * much cleaner.
  8 + *
  9 + * See file CREDITS for list of people who contributed to this
  10 + * project.
  11 + *
  12 + * This program is free software; you can redistribute it and/or
  13 + * modify it under the terms of the GNU General Public License as
  14 + * published by the Free Software Foundation; either version 2 of
  15 + * the License, or (at your option) any later version.
  16 + *
  17 + * This program is distributed in the hope that it will be useful,
  18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20 + * GNU General Public License for more details.
  21 + *
  22 + * You should have received a copy of the GNU General Public License
  23 + * along with this program; if not, write to the Free Software
  24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25 + * MA 02111-1307 USA
  26 + */
  27 +
  28 +#include <config.h>
  29 +#include <version.h>
  30 +#include <asm/arch/pxa-regs.h>
  31 +
  32 +DRAM_SIZE: .long CFG_DRAM_SIZE
  33 +
  34 +/* wait for coprocessor write complete */
  35 + .macro CPWAIT reg
  36 + mrc p15,0,\reg,c2,c0,0
  37 + mov \reg,\reg
  38 + sub pc,pc,#4
  39 + .endm
  40 +
  41 +
  42 +.globl memsetup
  43 +memsetup:
  44 +
  45 + mov r10, lr
  46 +
  47 + /* Set up GPIO pins first ----------------------------------------- */
  48 +
  49 + ldr r0,=GPSR0
  50 + ldr r1,=CFG_GPSR0_VAL
  51 + str r1,[r0]
  52 +
  53 + ldr r0,=GPSR1
  54 + ldr r1,=CFG_GPSR1_VAL
  55 + str r1,[r0]
  56 +
  57 + ldr r0,=GPSR2
  58 + ldr r1,=CFG_GPSR2_VAL
  59 + str r1,[r0]
  60 +
  61 + ldr r0,=GPCR0
  62 + ldr r1,=CFG_GPCR0_VAL
  63 + str r1,[r0]
  64 +
  65 + ldr r0,=GPCR1
  66 + ldr r1,=CFG_GPCR1_VAL
  67 + str r1,[r0]
  68 +
  69 + ldr r0,=GPCR2
  70 + ldr r1,=CFG_GPCR2_VAL
  71 + str r1,[r0]
  72 +
  73 + ldr r0,=GPDR0
  74 + ldr r1,=CFG_GPDR0_VAL
  75 + str r1,[r0]
  76 +
  77 + ldr r0,=GPDR1
  78 + ldr r1,=CFG_GPDR1_VAL
  79 + str r1,[r0]
  80 +
  81 + ldr r0,=GPDR2
  82 + ldr r1,=CFG_GPDR2_VAL
  83 + str r1,[r0]
  84 +
  85 + ldr r0,=GAFR0_L
  86 + ldr r1,=CFG_GAFR0_L_VAL
  87 + str r1,[r0]
  88 +
  89 + ldr r0,=GAFR0_U
  90 + ldr r1,=CFG_GAFR0_U_VAL
  91 + str r1,[r0]
  92 +
  93 + ldr r0,=GAFR1_L
  94 + ldr r1,=CFG_GAFR1_L_VAL
  95 + str r1,[r0]
  96 +
  97 + ldr r0,=GAFR1_U
  98 + ldr r1,=CFG_GAFR1_U_VAL
  99 + str r1,[r0]
  100 +
  101 + ldr r0,=GAFR2_L
  102 + ldr r1,=CFG_GAFR2_L_VAL
  103 + str r1,[r0]
  104 +
  105 + ldr r0,=GAFR2_U
  106 + ldr r1,=CFG_GAFR2_U_VAL
  107 + str r1,[r0]
  108 +
  109 + ldr r0,=PSSR /* enable GPIO pins */
  110 + ldr r1,=CFG_PSSR_VAL
  111 + str r1,[r0]
  112 +
  113 + /* ---------------------------------------------------------------- */
  114 + /* Enable memory interface */
  115 + /* */
  116 + /* The sequence below is based on the recommended init steps */
  117 + /* detailed in the Intel PXA250 Operating Systems Developers Guide, */
  118 + /* Chapter 10. */
  119 + /* ---------------------------------------------------------------- */
  120 +
  121 + /* ---------------------------------------------------------------- */
  122 + /* Step 1: Wait for at least 200 microsedonds to allow internal */
  123 + /* clocks to settle. Only necessary after hard reset... */
  124 + /* FIXME: can be optimized later */
  125 + /* ---------------------------------------------------------------- */
  126 +
  127 + ldr r3, =OSCR /* reset the OS Timer Count to zero */
  128 + mov r2, #0
  129 + str r2, [r3]
  130 + ldr r4, =0x300 /* really 0x2E1 is about 200usec, */
  131 + /* so 0x300 should be plenty */
  132 +1:
  133 + ldr r2, [r3]
  134 + cmp r4, r2
  135 + bgt 1b
  136 +
  137 +mem_init:
  138 +
  139 + ldr r1,=MEMC_BASE /* get memory controller base addr. */
  140 +
  141 + /* ---------------------------------------------------------------- */
  142 + /* Step 2a: Initialize Asynchronous static memory controller */
  143 + /* ---------------------------------------------------------------- */
  144 +
  145 + /* MSC registers: timing, bus width, mem type */
  146 +
  147 + /* MSC0: nCS(0,1) */
  148 + ldr r2,=CFG_MSC0_VAL
  149 + str r2,[r1, #MSC0_OFFSET]
  150 + ldr r2,[r1, #MSC0_OFFSET] /* read back to ensure data latches */
  151 +
  152 + /* MSC1: nCS(2,3) */
  153 + ldr r2,=CFG_MSC1_VAL
  154 + str r2,[r1, #MSC1_OFFSET]
  155 + ldr r2,[r1, #MSC1_OFFSET]
  156 +
  157 + /* MSC2: nCS(4,5) */
  158 + ldr r2,=CFG_MSC2_VAL
  159 + str r2,[r1, #MSC2_OFFSET]
  160 + ldr r2,[r1, #MSC2_OFFSET]
  161 +
  162 + /* ---------------------------------------------------------------- */
  163 + /* Step 2b: Initialize Card Interface */
  164 + /* ---------------------------------------------------------------- */
  165 +
  166 + /* MECR: Memory Expansion Card Register */
  167 + ldr r2,=CFG_MECR_VAL
  168 + str r2,[r1, #MECR_OFFSET]
  169 + ldr r2,[r1, #MECR_OFFSET]
  170 +
  171 + /* MCMEM0: Card Interface slot 0 timing */
  172 + ldr r2,=CFG_MCMEM0_VAL
  173 + str r2,[r1, #MCMEM0_OFFSET]
  174 + ldr r2,[r1, #MCMEM0_OFFSET]
  175 +
  176 + /* MCMEM1: Card Interface slot 1 timing */
  177 + ldr r2,=CFG_MCMEM1_VAL
  178 + str r2,[r1, #MCMEM1_OFFSET]
  179 + ldr r2,[r1, #MCMEM1_OFFSET]
  180 +
  181 + /* MCATT0: Card Interface Attribute Space Timing, slot 0 */
  182 + ldr r2,=CFG_MCATT0_VAL
  183 + str r2,[r1, #MCATT0_OFFSET]
  184 + ldr r2,[r1, #MCATT0_OFFSET]
  185 +
  186 + /* MCATT1: Card Interface Attribute Space Timing, slot 1 */
  187 + ldr r2,=CFG_MCATT1_VAL
  188 + str r2,[r1, #MCATT1_OFFSET]
  189 + ldr r2,[r1, #MCATT1_OFFSET]
  190 +
  191 + /* MCIO0: Card Interface I/O Space Timing, slot 0 */
  192 + ldr r2,=CFG_MCIO0_VAL
  193 + str r2,[r1, #MCIO0_OFFSET]
  194 + ldr r2,[r1, #MCIO0_OFFSET]
  195 +
  196 + /* MCIO1: Card Interface I/O Space Timing, slot 1 */
  197 + ldr r2,=CFG_MCIO1_VAL
  198 + str r2,[r1, #MCIO1_OFFSET]
  199 + ldr r2,[r1, #MCIO1_OFFSET]
  200 +
  201 + /* ---------------------------------------------------------------- */
  202 + /* Step 2c: Write FLYCNFG FIXME: what's that??? */
  203 + /* ---------------------------------------------------------------- */
  204 +
  205 + /* ---------------------------------------------------------------- */
  206 + /* Step 2d: Initialize Timing for Sync Memory (SDCLK0) */
  207 + /* ---------------------------------------------------------------- */
  208 +
  209 + @ get the mdrefr settings
  210 + ldr r4,=CFG_MDREFR_VAL
  211 +
  212 + @ write back mdrefr
  213 + str r4,[r1, #MDREFR_OFFSET]
  214 + ldr r4,[r1, #MDREFR_OFFSET]
  215 +
  216 + /* ---------------------------------------------------------------- */
  217 + /* Step 3: Initialize Synchronous Static Memory (Flash/Peripherals) */
  218 + /* ---------------------------------------------------------------- */
  219 +
  220 + /* Initialize SXCNFG register. Assert the enable bits */
  221 +
  222 + /* Write SXMRS to cause an MRS command to all enabled banks of */
  223 + /* synchronous static memory. Note that SXLCR need not be written */
  224 + /* at this time. */
  225 +
  226 + /* FIXME: we use async mode for now */
  227 +
  228 + /* ---------------------------------------------------------------- */
  229 + /* Step 4: Initialize SDRAM */
  230 + /* ---------------------------------------------------------------- */
  231 +
  232 + @ set K1RUN for bank 0
  233 + @
  234 + orr r4, r4, #MDREFR_K1RUN
  235 +
  236 + @ write back mdrefr
  237 + @
  238 + str r4, [r1, #MDREFR_OFFSET]
  239 + ldr r4, [r1, #MDREFR_OFFSET]
  240 +
  241 + @ deassert SLFRSH
  242 + @
  243 + bic r4, r4, #MDREFR_SLFRSH
  244 +
  245 + @ write back mdrefr
  246 + @
  247 + str r4, [r1, #MDREFR_OFFSET]
  248 + ldr r4, [r1, #MDREFR_OFFSET]
  249 +
  250 + @ assert E1PIN
  251 + @ if E0PIN is also used: #(MDREFR_E1PIN|MDREFR_E0PIN)
  252 + orr r4, r4, #(MDREFR_E1PIN)
  253 +
  254 + @ write back mdrefr
  255 + @
  256 + str r4, [r1, #MDREFR_OFFSET]
  257 + ldr r4, [r1, #MDREFR_OFFSET]
  258 + nop
  259 + nop
  260 +
  261 + /* Step 4d: */
  262 + /* fetch platform value of mdcnfg */
  263 + @
  264 + ldr r2, =CFG_MDCNFG_VAL
  265 +
  266 + @ disable all sdram banks
  267 + @
  268 + bic r2, r2, #(MDCNFG_DE0 | MDCNFG_DE1)
  269 + bic r2, r2, #(MDCNFG_DE2 | MDCNFG_DE3)
  270 +
  271 + @ program banks 0/1 for bus width
  272 + @
  273 + bic r2, r2, #MDCNFG_DWID0 @0=32-bit
  274 +
  275 + @ write initial value of mdcnfg, w/o enabling sdram banks
  276 + @
  277 + str r2, [r1, #MDCNFG_OFFSET]
  278 +
  279 + /* Step 4e: Wait for the clock to the SDRAMs to stabilize, */
  280 + /* 100..200 ยตsec. */
  281 +
  282 + ldr r3, =OSCR /* reset the OS Timer Count to zero */
  283 + mov r2, #0
  284 + str r2, [r3]
  285 + ldr r4, =0x300 /* really 0x2E1 is about 200usec, */
  286 + /* so 0x300 should be plenty */
  287 +1:
  288 + ldr r2, [r3]
  289 + cmp r4, r2
  290 + bgt 1b
  291 +
  292 +
  293 + /* Step 4f: Trigger a number (usually 8) refresh cycles by */
  294 + /* attempting non-burst read or write accesses to disabled */
  295 + /* SDRAM, as commonly specified in the power up sequence */
  296 + /* documented in SDRAM data sheets. The address(es) used */
  297 + /* for this purpose must not be cacheable. */
  298 +
  299 + ldr r3, =CFG_DRAM_BASE
  300 + str r2, [r3]
  301 + str r2, [r3]
  302 + str r2, [r3]
  303 + str r2, [r3]
  304 + str r2, [r3]
  305 + str r2, [r3]
  306 + str r2, [r3]
  307 + str r2, [r3]
  308 + str r2, [r3]
  309 +
  310 +
  311 + /* Step 4g: Write MDCNFG with enable bits asserted */
  312 + /* get memory controller base address */
  313 + ldr r1, =MEMC_BASE
  314 +
  315 + @fetch current mdcnfg value
  316 + @
  317 + ldr r3, [r1, #MDCNFG_OFFSET]
  318 +
  319 + @enable sdram bank 0 if installed (must do for any populated bank)
  320 + @
  321 + orr r3, r3, #MDCNFG_DE0
  322 +
  323 + @write back mdcnfg, enabling the sdram bank(s)
  324 + @
  325 + str r3, [r1, #MDCNFG_OFFSET]
  326 +
  327 + /* Step 4h: Write MDMRS. */
  328 +
  329 + ldr r2, =CFG_MDMRS_VAL
  330 + str r2, [r1, #MDMRS_OFFSET]
  331 +
  332 +
  333 + /* We are finished with Intel's memory controller initialisation */
  334 +
  335 +
  336 + /* ---------------------------------------------------------------- */
  337 + /* Disable (mask) all interrupts at interrupt controller */
  338 + /* ---------------------------------------------------------------- */
  339 +
  340 +initirqs:
  341 + mov r1, #0 /* clear int. level register (IRQ, not FIQ) */
  342 + ldr r2, =ICLR
  343 + str r1, [r2]
  344 +
  345 + ldr r1, =CFG_ICMR_VAL /* mask all interrupts at the controller */
  346 + ldr r2, =ICMR
  347 + str r1, [r2]
  348 +
  349 +
  350 + /* ---------------------------------------------------------------- */
  351 + /* Clock initialisation */
  352 + /* ---------------------------------------------------------------- */
  353 +
  354 +initclks:
  355 +
  356 + /* Disable the peripheral clocks, and set the core clock frequency */
  357 + /* (hard-coding at 398.12MHz for now). */
  358 + /* Turn Off ALL on-chip peripheral clocks for re-configuration */
  359 + /* Note: See label 'ENABLECLKS' for the re-enabling */
  360 + ldr r1, =CKEN
  361 + mov r2, #0
  362 + str r2, [r1]
  363 +
  364 +
  365 + /* default value */
  366 + ldr r2, =(CCCR_L27|CCCR_M2|CCCR_N10) /* DEFAULT: {200/200/100} */
  367 +
  368 + /* ... and write the core clock config register */
  369 + ldr r1, =CCCR
  370 + str r2, [r1]
  371 +
  372 +#ifdef RTC
  373 + /* enable the 32Khz oscillator for RTC and PowerManager */
  374 +
  375 + ldr r1, =OSCC
  376 + mov r2, #OSCC_OON
  377 + str r2, [r1]
  378 +
  379 + /* NOTE: spin here until OSCC.OOK get set, meaning the PLL */
  380 + /* has settled. */
  381 +60:
  382 + ldr r2, [r1]
  383 + ands r2, r2, #1
  384 + beq 60b
  385 +#endif
  386 +
  387 + @ Turn on needed clocks
  388 + @
  389 +test:
  390 + ldr r1, =CKEN
  391 + ldr r2, =CFG_CKEN_VAL
  392 + str r2, [r1]
  393 +
  394 + /* ---------------------------------------------------------------- */
  395 + /* */
  396 + /* ---------------------------------------------------------------- */
  397 +
  398 + /* Save SDRAM size ?*/
  399 + ldr r1, =DRAM_SIZE
  400 + str r8, [r1]
  401 +
  402 + /* FIXME */
  403 +
  404 +#define NODEBUG
  405 +#ifdef NODEBUG
  406 + /*Disable software and data breakpoints */
  407 + mov r0,#0
  408 + mcr p15,0,r0,c14,c8,0 /* ibcr0 */
  409 + mcr p15,0,r0,c14,c9,0 /* ibcr1 */
  410 + mcr p15,0,r0,c14,c4,0 /* dbcon */
  411 +
  412 + /*Enable all debug functionality */
  413 + mov r0,#0x80000000
  414 + mcr p14,0,r0,c10,c0,0 /* dcsr */
  415 +
  416 +#endif
  417 +
  418 + /* ---------------------------------------------------------------- */
  419 + /* End memsetup */
  420 + /* ---------------------------------------------------------------- */
  421 +
  422 +endmemsetup:
  423 +
  424 + mov pc, lr
board/xaeniax/u-boot.lds
  1 +/*
  2 + * (C) Copyright 2000
  3 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4 + *
  5 + * See file CREDITS for list of people who contributed to this
  6 + * project.
  7 + *
  8 + * This program is free software; you can redistribute it and/or
  9 + * modify it under the terms of the GNU General Public License as
  10 + * published by the Free Software Foundation; either version 2 of
  11 + * the License, or (at your option) any later version.
  12 + *
  13 + * This program is distributed in the hope that it will be useful,
  14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 + * GNU General Public License for more details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program; if not, write to the Free Software
  20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 + * MA 02111-1307 USA
  22 + */
  23 +
  24 +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  25 +OUTPUT_ARCH(arm)
  26 +ENTRY(_start)
  27 +SECTIONS
  28 +{
  29 + . = 0x00000000;
  30 +
  31 + . = ALIGN(4);
  32 + .text :
  33 + {
  34 + cpu/pxa/start.o (.text)
  35 + *(.text)
  36 + }
  37 +
  38 + . = ALIGN(4);
  39 + .rodata : { *(.rodata) }
  40 +
  41 + . = ALIGN(4);
  42 + .data : { *(.data) }
  43 +
  44 + . = ALIGN(4);
  45 + .got : { *(.got) }
  46 +
  47 + __u_boot_cmd_start = .;
  48 + .u_boot_cmd : { *(.u_boot_cmd) }
  49 + __u_boot_cmd_end = .;
  50 +
  51 + . = ALIGN(4);
  52 + __bss_start = .;
  53 + .bss : { *(.bss) }
  54 + _end = .;
  55 +}
board/xaeniax/xaeniax.c
  1 +/*
  2 + * (C) Copyright 2004
  3 + * Vincent Dubey, Xa SA, vincent.dubey@xa-ch.com
  4 + *
  5 + * (C) Copyright 2002
  6 + * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
  7 + *
  8 + * (C) Copyright 2002
  9 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  10 + * Marius Groeger <mgroeger@sysgo.de>
  11 + *
  12 + * See file CREDITS for list of people who contributed to this
  13 + * project.
  14 + *
  15 + * This program is free software; you can redistribute it and/or
  16 + * modify it under the terms of the GNU General Public License as
  17 + * published by the Free Software Foundation; either version 2 of
  18 + * the License, or (at your option) any later version.
  19 + *
  20 + * This program is distributed in the hope that it will be useful,
  21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23 + * GNU General Public License for more details.
  24 + *
  25 + * You should have received a copy of the GNU General Public License
  26 + * along with this program; if not, write to the Free Software
  27 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  28 + * MA 02111-1307 USA
  29 + */
  30 +
  31 +#include <common.h>
  32 +
  33 +/* ------------------------------------------------------------------------- */
  34 +
  35 +
  36 +/*
  37 + * Miscelaneous platform dependent initialisations
  38 + */
  39 +
  40 +int board_init (void)
  41 +{
  42 + DECLARE_GLOBAL_DATA_PTR;
  43 +
  44 + /* memory and cpu-speed are setup before relocation */
  45 + /* so we do _nothing_ here */
  46 +
  47 + /* arch number of xaeniax */
  48 + gd->bd->bi_arch_number = 585;
  49 +
  50 + /* adress of boot parameters */
  51 + gd->bd->bi_boot_params = 0xa0000100;
  52 +
  53 + return 0;
  54 +}
  55 +
  56 +int board_late_init(void)
  57 +{
  58 + setenv("stdout", "serial");
  59 + setenv("stderr", "serial");
  60 + return 0;
  61 +}
  62 +
  63 +
  64 +int dram_init (void)
  65 +{
  66 + DECLARE_GLOBAL_DATA_PTR;
  67 +
  68 + gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  69 + gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  70 + /* gd->bd->bi_dram[1].start = PHYS_SDRAM_2;*/
  71 + /* gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;*/
  72 + /* gd->bd->bi_dram[2].start = PHYS_SDRAM_3; */
  73 + /* gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE; */
  74 + /* gd->bd->bi_dram[3].start = PHYS_SDRAM_4; */
  75 + /* gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE; */
  76 +
  77 + return 0;
  78 +}
include/configs/xaeniax.h
  1 +/*
  2 + * (C) Copyright 2004
  3 + * Vincent Dubey, Xa SA, vincent.dubey@xa-ch.com
  4 + *
  5 + * (C) Copyright 2002
  6 + * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.ne
  7 + *
  8 + * (C) Copyright 2002
  9 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  10 + * Marius Groeger <mgroeger@sysgo.de>
  11 + *
  12 + * Configuation settings for the xaeniax board.
  13 + *
  14 + * See file CREDITS for list of people who contributed to this
  15 + * project.
  16 + *
  17 + * This program is free software; you can redistribute it and/or
  18 + * modify it under the terms of the GNU General Public License as
  19 + * published by the Free Software Foundation; either version 2 of
  20 + * the License, or (at your option) any later version.
  21 + *
  22 + * This program is distributed in the hope that it will be useful,
  23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25 + * GNU General Public License for more details.
  26 + *
  27 + * You should have received a copy of the GNU General Public License
  28 + * along with this program; if not, write to the Free Software
  29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  30 + * MA 02111-1307 USA
  31 + */
  32 +
  33 +#ifndef __CONFIG_H
  34 +#define __CONFIG_H
  35 +
  36 +/*
  37 + * If we are developing, we might want to start armboot from ram
  38 + * so we MUST NOT initialize critical regs like mem-timing ...
  39 + */
  40 +#define CONFIG_INIT_CRITICAL /* undef for developing */
  41 +
  42 +/*
  43 +#undef CONFIG_INIT_CRITICAL
  44 +*/
  45 +
  46 +/*
  47 + * High Level Configuration Options
  48 + * (easy to change)
  49 + */
  50 +#define CONFIG_PXA250 1 /* This is an PXA255 CPU */
  51 +#define CONFIG_XAENIAX 1 /* on a xaeniax board */
  52 +
  53 +
  54 +#define BOARD_LATE_INIT 1
  55 +
  56 +
  57 +#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
  58 +
  59 +/*
  60 + * select serial console configuration
  61 + */
  62 +#define CONFIG_BTUART 1 /* we use BTUART on XAENIAX */
  63 +
  64 +
  65 +/* allow to overwrite serial and ethaddr */
  66 +#define CONFIG_ENV_OVERWRITE
  67 +
  68 +#define CONFIG_BAUDRATE 115200
  69 +
  70 +#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } /* valid baudrates */
  71 +
  72 +#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_DIAG | CFG_CMD_SDRAM & ~CONFIG_CMD_DTT)
  73 +
  74 +/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  75 +#include <cmd_confdefs.h>
  76 +
  77 +#define CONFIG_ETHADDR 08:00:3e:26:0a:5b
  78 +#define CONFIG_NETMASK 255.255.255.0
  79 +#define CONFIG_IPADDR 192.168.68.201
  80 +#define CONFIG_SERVERIP 192.168.68.62
  81 +
  82 +#define CONFIG_BOOTDELAY 3
  83 +#define CONFIG_BOOTCOMMAND "bootm 0x00100000"
  84 +#define CONFIG_BOOTARGS "console=ttyS1,115200"
  85 +#define CONFIG_CMDLINE_TAG1 /* enable passing of ATAGs */
  86 +
  87 +#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  88 +#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
  89 +#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
  90 +#endif
  91 +
  92 +/*
  93 + * Size of malloc() pool; this lives below the uppermost 128 KiB which are
  94 + * used for the RAM copy of the uboot code
  95 + */
  96 +#define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
  97 +#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  98 +
  99 +/*
  100 + * Miscellaneous configurable options
  101 + */
  102 +#define CFG_LONGHELP /* undef to save memory */
  103 +#define CFG_HUSH_PARSER 1
  104 +
  105 +#define CFG_PROMPT_HUSH_PS2 "> "
  106 +
  107 +#ifdef CFG_HUSH_PARSER
  108 +#define CFG_PROMPT "u-boot$ " /* Monitor Command Prompt */
  109 +#else
  110 +#define CFG_PROMPT "u-boot=> " /* Monitor Command Prompt */
  111 +#endif
  112 +#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  113 +#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  114 +#define CFG_MAXARGS 16 /* max number of command args */
  115 +#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  116 +#define CFG_DEVICE_NULLDEV 1
  117 +
  118 +#define CFG_MEMTEST_START 0xa0400000 /* memtest works on */
  119 +#define CFG_MEMTEST_END 0xa0800000 /* 4 ... 8 MB in DRAM */
  120 +
  121 +#undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
  122 +
  123 +#define CFG_LOAD_ADDR 0xa1000000 /* default load address */
  124 +
  125 +#define CFG_HZ 3686400 /* incrementer freq: 3.6864 MHz */
  126 +#define CFG_CPUSPEED 0x141 /* set core clock to 400/200/100 MHz */
  127 +
  128 +/*
  129 + * Physical Memory Map
  130 + */
  131 +#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 banks (partition) of DRAM */
  132 +#define PHYS_SDRAM_1 0xa0000000 /* SDRAM Bank #1 */
  133 +#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
  134 +#define PHYS_SDRAM_2 0xa4000000 /* SDRAM Bank #2 */
  135 +#define PHYS_SDRAM_2_SIZE 0x00000000 /* 0 MB */
  136 +#define PHYS_SDRAM_3 0xa8000000 /* SDRAM Bank #3 */
  137 +#define PHYS_SDRAM_3_SIZE 0x00000000 /* 0 MB */
  138 +#define PHYS_SDRAM_4 0xac000000 /* SDRAM Bank #4 */
  139 +#define PHYS_SDRAM_4_SIZE 0x00000000 /* 0 MB */
  140 +
  141 +#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
  142 +#define PHYS_FLASH_2 0x04000000 /* Flash Bank #2 */
  143 +#define PHYS_FLASH_SIZE 0x02000000 /* 32 MB */
  144 +#define PHYS_FLASH_BANK_SIZE 0x02000000 /* 32 MB Banks */
  145 +#define PHYS_FLASH_SECT_SIZE 0x00040000 /* 256 KB sectors (x2) */
  146 +
  147 +#define CFG_DRAM_BASE 0xa0000000
  148 +#define CFG_DRAM_SIZE 0x04000000
  149 +
  150 +#define CFG_FLASH_BASE PHYS_FLASH_1
  151 +
  152 +/*
  153 + * FLASH and environment organization
  154 + */
  155 +#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  156 +#define CFG_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
  157 +
  158 +/* timeout values are in ticks */
  159 +#define CFG_FLASH_ERASE_TOUT (25*CFG_HZ) /* Timeout for Flash Erase */
  160 +#define CFG_FLASH_WRITE_TOUT (25*CFG_HZ) /* Timeout for Flash Write */
  161 +
  162 +/* FIXME */
  163 +#define CFG_ENV_IS_IN_FLASH 1
  164 +#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x40000)/* Addr of Environment Sector */
  165 +#define CFG_ENV_SIZE 0x40000 /* Total Size of Environment Sector */
  166 +
  167 +/*
  168 + * Stack sizes
  169 + *
  170 + * The stack sizes are set up in start.S using the settings below
  171 + */
  172 +#define CONFIG_STACKSIZE (128*1024) /* regular stack */
  173 +#ifdef CONFIG_USE_IRQ
  174 +#define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */
  175 +#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
  176 +#endif
  177 +
  178 +/*
  179 + * SMSC91C111 Network Card
  180 + */
  181 +#define CONFIG_DRIVER_SMC91111 1
  182 +#define CONFIG_SMC91111_BASE 0x0C00030 /* chip select 3 */
  183 +#define CONFIG_SMC_USE_32_BIT 1 /* 32 bit bus */
  184 +#undef CONFIG_SMC_91111_EXT_PHY /* we use internal phy */
  185 +#undef CONFIG_SHOW_ACTIVITY
  186 +#define CONFIG_NET_RETRY_COUNT 10 /* # of retries */
  187 +
  188 +/*
  189 + * GPIO settings
  190 + */
  191 +
  192 +/*
  193 + * GP05 == nUSBReset is 1
  194 + * GP10 == CFReset is 1
  195 + * GP13 == nCFDataEnable is 1
  196 + * GP14 == nCFAddrEnable is 1
  197 + * GP15 == nCS1 is 1
  198 + * GP21 == ComBrdReset is 1
  199 + * GP24 == SFRM is 1
  200 + * GP25 == TXD is 1
  201 + * GP31 == SYNC is 1
  202 + * GP33 == nCS5 is 1
  203 + * GP39 == FFTXD is 1
  204 + * GP41 == RTS is 1
  205 + * GP43 == BTTXD is 1
  206 + * GP45 == BTRTS is 1
  207 + * GP47 == TXD is 1
  208 + * GP48 == nPOE is 1
  209 + * GP49 == nPWE is 1
  210 + * GP50 == nPIOR is 1
  211 + * GP51 == nPIOW is 1
  212 + * GP52 == nPCE[1] is 1
  213 + * GP53 == nPCE[2] is 1
  214 + * GP54 == nPSKTSEL is 1
  215 + * GP55 == nPREG is 1
  216 + * GP78 == nCS2 is 1
  217 + * GP79 == nCS3 is 1
  218 + * GP80 == nCS4 is 1
  219 + * GP82 == NSSPSFRM is 1
  220 + * GP83 == NSSPTXD is 1
  221 + */
  222 +#define CFG_GPSR0_VAL 0x8320E420
  223 +#define CFG_GPSR1_VAL 0x00FFAA82
  224 +#define CFG_GPSR2_VAL 0x000DC000
  225 +
  226 +/*
  227 + * GP03 == LANReset is 0
  228 + * GP06 == USBWakeUp is 0
  229 + * GP11 == USBControl is 0
  230 + * GP12 == Buzzer is 0
  231 + * GP16 == PWM0 is 0
  232 + * GP17 == PWM1 is 0
  233 + * GP23 == SCLK is 0
  234 + * GP30 == SDATA_OUT is 0
  235 + * GP81 == NSSPCLK is 0
  236 + */
  237 +#define CFG_GPCR0_VAL 0x40C31868
  238 +#define CFG_GPCR1_VAL 0x00000000
  239 +#define CFG_GPCR2_VAL 0x00020000
  240 +
  241 +/*
  242 + * GP00 == CPUWakeUpUSB is input
  243 + * GP01 == GP reset is input
  244 + * GP02 == LANInterrupt is input
  245 + * GP03 == LANReset is output
  246 + * GP04 == USBInterrupt is input
  247 + * GP05 == nUSBReset is output
  248 + * GP06 == USBWakeUp is output
  249 + * GP07 == CFReady/nBusy is input
  250 + * GP08 == nCFCardDetect1 is input
  251 + * GP09 == nCFCardDetect2 is input
  252 + * GP10 == nCFReset is output
  253 + * GP11 == USBControl is output
  254 + * GP12 == Buzzer is output
  255 + * GP13 == CFDataEnable is output
  256 + * GP14 == CFAddressEnable is output
  257 + * GP15 == nCS1 is output
  258 + * GP16 == PWM0 is output
  259 + * GP17 == PWM1 is output
  260 + * GP18 == RDY is input
  261 + * GP19 == ReaderReady is input
  262 + * GP20 == ReaderReset is input
  263 + * GP21 == ComBrdReset is output
  264 + * GP23 == SCLK is output
  265 + * GP24 == SFRM is output
  266 + * GP25 == TXD is output
  267 + * GP26 == RXD is input
  268 + * GP27 == EXTCLK is input
  269 + * GP28 == BITCLK is output
  270 + * GP29 == SDATA_IN0 is input
  271 + * GP30 == SDATA_OUT is output
  272 + * GP31 == SYNC is output
  273 + * GP32 == SYSSCLK is output
  274 + * GP33 == nCS5 is output
  275 + * GP34 == FFRXD is input
  276 + * GP35 == CTS is input
  277 + * GP36 == DCD is input
  278 + * GP37 == DSR is input
  279 + * GP38 == RI is input
  280 + * GP39 == FFTXD is output
  281 + * GP40 == DTR is output
  282 + * GP41 == RTS is output
  283 + * GP42 == BTRXD is input
  284 + * GP43 == BTTXD is output
  285 + * GP44 == BTCTS is input
  286 + * GP45 == BTRTS is output
  287 + * GP46 == RXD is input
  288 + * GP47 == TXD is output
  289 + * GP48 == nPOE is output
  290 + * GP49 == nPWE is output
  291 + * GP50 == nPIOR is output
  292 + * GP51 == nPIOW is output
  293 + * GP52 == nPCE[1] is output
  294 + * GP53 == nPCE[2] is output
  295 + * GP54 == nPSKTSEL is output
  296 + * GP55 == nPREG is output
  297 + * GP56 == nPWAIT is input
  298 + * GP57 == nPIOS16 is input
  299 + * GP58 == LDD[0] is output
  300 + * GP59 == LDD[1] is output
  301 + * GP60 == LDD[2] is output
  302 + * GP61 == LDD[3] is output
  303 + * GP62 == LDD[4] is output
  304 + * GP63 == LDD[5] is output
  305 + * GP64 == LDD[6] is output
  306 + * GP65 == LDD[7] is output
  307 + * GP66 == LDD[8] is output
  308 + * GP67 == LDD[9] is output
  309 + * GP68 == LDD[10] is output
  310 + * GP69 == LDD[11] is output
  311 + * GP70 == LDD[12] is output
  312 + * GP71 == LDD[13] is output
  313 + * GP72 == LDD[14] is output
  314 + * GP73 == LDD[15] is output
  315 + * GP74 == LCD_FCLK is output
  316 + * GP75 == LCD_LCLK is output
  317 + * GP76 == LCD_PCLK is output
  318 + * GP77 == LCD_ACBIAS is output
  319 + * GP78 == nCS2 is output
  320 + * GP79 == nCS3 is output
  321 + * GP80 == nCS4 is output
  322 + * GP81 == NSSPCLK is output
  323 + * GP82 == NSSPSFRM is output
  324 + * GP83 == NSSPTXD is output
  325 + * GP84 == NSSPRXD is input
  326 + */
  327 +#define CFG_GPDR0_VAL 0xD3E3FC68
  328 +#define CFG_GPDR1_VAL 0xFCFFAB83
  329 +#define CFG_GPDR2_VAL 0x000FFFFF
  330 +
  331 +/*
  332 + * GP01 == GP reset is AF01
  333 + * GP15 == nCS1 is AF10
  334 + * GP16 == PWM0 is AF10
  335 + * GP17 == PWM1 is AF10
  336 + * GP18 == RDY is AF01
  337 + * GP23 == SCLK is AF10
  338 + * GP24 == SFRM is AF10
  339 + * GP25 == TXD is AF10
  340 + * GP26 == RXD is AF01
  341 + * GP27 == EXTCLK is AF01
  342 + * GP28 == BITCLK is AF01
  343 + * GP29 == SDATA_IN0 is AF10
  344 + * GP30 == SDATA_OUT is AF01
  345 + * GP31 == SYNC is AF01
  346 + * GP32 == SYSCLK is AF01
  347 + * GP33 == nCS5 is AF10
  348 + * GP34 == FFRXD is AF01
  349 + * GP35 == CTS is AF01
  350 + * GP36 == DCD is AF01
  351 + * GP37 == DSR is AF01
  352 + * GP38 == RI is AF01
  353 + * GP39 == FFTXD is AF10
  354 + * GP40 == DTR is AF10
  355 + * GP41 == RTS is AF10
  356 + * GP42 == BTRXD is AF01
  357 + * GP43 == BTTXD is AF10
  358 + * GP44 == BTCTS is AF01
  359 + * GP45 == BTRTS is AF10
  360 + * GP46 == RXD is AF10
  361 + * GP47 == TXD is AF01
  362 + * GP48 == nPOE is AF10
  363 + * GP49 == nPWE is AF10
  364 + * GP50 == nPIOR is AF10
  365 + * GP51 == nPIOW is AF10
  366 + * GP52 == nPCE[1] is AF10
  367 + * GP53 == nPCE[2] is AF10
  368 + * GP54 == nPSKTSEL is AF10
  369 + * GP55 == nPREG is AF10
  370 + * GP56 == nPWAIT is AF01
  371 + * GP57 == nPIOS16 is AF01
  372 + * GP58 == LDD[0] is AF10
  373 + * GP59 == LDD[1] is AF10
  374 + * GP60 == LDD[2] is AF10
  375 + * GP61 == LDD[3] is AF10
  376 + * GP62 == LDD[4] is AF10
  377 + * GP63 == LDD[5] is AF10
  378 + * GP64 == LDD[6] is AF10
  379 + * GP65 == LDD[7] is AF10
  380 + * GP66 == LDD[8] is AF10
  381 + * GP67 == LDD[9] is AF10
  382 + * GP68 == LDD[10] is AF10
  383 + * GP69 == LDD[11] is AF10
  384 + * GP70 == LDD[12] is AF10
  385 + * GP71 == LDD[13] is AF10
  386 + * GP72 == LDD[14] is AF10
  387 + * GP73 == LDD[15] is AF10
  388 + * GP74 == LCD_FCLK is AF10
  389 + * GP75 == LCD_LCLK is AF10
  390 + * GP76 == LCD_PCLK is AF10
  391 + * GP77 == LCD_ACBIAS is AF10
  392 + * GP78 == nCS2 is AF10
  393 + * GP79 == nCS3 is AF10
  394 + * GP80 == nCS4 is AF10
  395 + * GP81 == NSSPCLK is AF01
  396 + * GP82 == NSSPSFRM is AF01
  397 + * GP83 == NSSPTXD is AF01
  398 + * GP84 == NSSPRXD is AF10
  399 + */
  400 +#define CFG_GAFR0_L_VAL 0x80000004
  401 +#define CFG_GAFR0_U_VAL 0x595A801A
  402 +#define CFG_GAFR1_L_VAL 0x699A9559
  403 +#define CFG_GAFR1_U_VAL 0xAAA5AAAA
  404 +#define CFG_GAFR2_L_VAL 0xAAAAAAAA
  405 +#define CFG_GAFR2_U_VAL 0x00000256
  406 +
  407 +/*
  408 + * clock settings
  409 + */
  410 +/* RDH = 1
  411 + * PH = 0
  412 + * VFS = 0
  413 + * BFS = 0
  414 + * SSS = 0
  415 + */
  416 +#define CFG_PSSR_VAL 0x00000030
  417 +
  418 +#define CFG_CKEN_VAL 0x00000080 /* */
  419 +#define CFG_ICMR_VAL 0x00000000 /* No interrupts enabled */
  420 +
  421 +
  422 +/*
  423 + * Memory settings
  424 + *
  425 + * This is the configuration for nCS0/1 -> flash banks
  426 + * configuration for nCS1 :
  427 + * [31] 0 -
  428 + * [30:28] 000 -
  429 + * [27:24] 0000 -
  430 + * [23:20] 0000 -
  431 + * [19] 0 -
  432 + * [18:16] 000 -
  433 + * configuration for nCS0:
  434 + * [15] 0 - Slower Device
  435 + * [14:12] 010 - CS deselect to CS time: 2*(2*MemClk) = 40 ns
  436 + * [11:08] 0011 - Address to data valid in bursts: (3+1)*MemClk = 40 ns
  437 + * [07:04] 1111 - " for first access: (23+2)*MemClk = 250 ns (fixme 12+2?)
  438 + * [03] 0 - 32 Bit bus width
  439 + * [02:00] 010 - burst OF 4 ROM or FLASH
  440 +*/
  441 +#define CFG_MSC0_VAL 0x000023D2
  442 +
  443 +/* This is the configuration for nCS2/3 -> USB controller, LAN
  444 + * configuration for nCS3: LAN
  445 + * [31] 0 - Slower Device
  446 + * [30:28] 001 - RRR3: CS deselect to CS time: 1*(2*MemClk) = 20 ns
  447 + * [27:24] 0010 - RDN3: Address to data valid in bursts: (2+1)*MemClk = 30 ns
  448 + * [23:20] 0010 - RDF3: Address for first access: (2+1)*MemClk = 30 ns
  449 + * [19] 0 - 32 Bit bus width
  450 + * [18:16] 100 - variable latency I/O
  451 + * configuration for nCS2: USB
  452 + * [15] 1 - Faster Device
  453 + * [14:12] 010 - RRR2: CS deselect to CS time: 2*(2*MemClk) = 40 ns
  454 + * [11:08] 0010 - RDN2: Address to data valid in bursts: (2+1)*MemClk = 30 ns
  455 + * [07:04] 0110 - RDF2: Address for first access: (6+1)*MemClk = 70 ns
  456 + * [03] 0 - 32 Bit bus width
  457 + * [02:00] 100 - variable latency I/O
  458 + */
  459 +#define CFG_MSC1_VAL 0x1224A264
  460 +
  461 +/* This is the configuration for nCS4/5 -> LAN
  462 + * configuration for nCS5:
  463 + * [31] 0 -
  464 + * [30:28] 000 -
  465 + * [27:24] 0000 -
  466 + * [23:20] 0000 -
  467 + * [19] 0 -
  468 + * [18:16] 000 -
  469 + * configuration for nCS4: LAN
  470 + * [15] 1 - Faster Device
  471 + * [14:12] 010 - RRR2: CS deselect to CS time: 2*(2*MemClk) = 40 ns
  472 + * [11:08] 0010 - RDN2: Address to data valid in bursts: (2+1)*MemClk = 30 ns
  473 + * [07:04] 0110 - RDF2: Address for first access: (6+1)*MemClk = 70 ns
  474 + * [03] 0 - 32 Bit bus width
  475 + * [02:00] 100 - variable latency I/O
  476 + */
  477 +#define CFG_MSC2_VAL 0x00001224
  478 +
  479 +/* MDCNFG: SDRAM Configuration Register
  480 + *
  481 + * [31:29] 000 - reserved
  482 + * [28] 0 - no SA1111 compatiblity mode
  483 + * [27] 0 - latch return data with return clock
  484 + * [26] 0 - alternate addressing for pair 2/3
  485 + * [25:24] 00 - timings
  486 + * [23] 0 - internal banks in lower partition 2/3 (not used)
  487 + * [22:21] 00 - row address bits for partition 2/3 (not used)
  488 + * [20:19] 00 - column address bits for partition 2/3 (not used)
  489 + * [18] 0 - SDRAM partition 2/3 width is 32 bit
  490 + * [17] 0 - SDRAM partition 3 disabled
  491 + * [16] 0 - SDRAM partition 2 disabled
  492 + * [15:13] 000 - reserved
  493 + * [12] 0 - no SA1111 compatiblity mode
  494 + * [11] 1 - latch return data with return clock
  495 + * [10] 0 - no alternate addressing for pair 0/1
  496 + * [09:08] 10 - tRP=2*MemClk CL=2 tRCD=2*MemClk tRAS=5*MemClk tRC=8*MemClk
  497 + * [7] 1 - 4 internal banks in lower partition pair
  498 + * [06:05] 10 - 13 row address bits for partition 0/1
  499 + * [04:03] 01 - 9 column address bits for partition 0/1
  500 + * [02] 0 - SDRAM partition 0/1 width is 32 bit
  501 + * [01] 0 - disable SDRAM partition 1
  502 + * [00] 1 - enable SDRAM partition 0
  503 + */
  504 +/* use the configuration above but disable partition 0 */
  505 +#define CFG_MDCNFG_VAL 0x00000AC9
  506 +
  507 +/* MDREFR: SDRAM Refresh Control Register
  508 + *
  509 + * [32:26] 0 - reserved
  510 + * [25] 0 - K2FREE: not free running
  511 + * [24] 0 - K1FREE: not free running
  512 + * [23] 0 - K0FREE: not free running
  513 + * [22] 0 - SLFRSH: self refresh disabled
  514 + * [21] 0 - reserved
  515 + * [20] 1 - APD: auto power down
  516 + * [19] 0 - K2DB2: SDCLK2 is MemClk
  517 + * [18] 0 - K2RUN: disable SDCLK2
  518 + * [17] 0 - K1DB2: SDCLK1 is MemClk
  519 + * [16] 1 - K1RUN: enable SDCLK1
  520 + * [15] 1 - E1PIN: SDRAM clock enable
  521 + * [14] 0 - K0DB2: SDCLK0 is MemClk
  522 + * [13] 0 - K0RUN: disable SDCLK0
  523 + * [12] 0 - E0PIN: disable SDCKE0
  524 + * [11:00] 000000011000 - (64ms/8192)*MemClkFreq/32 = 24
  525 + */
  526 +#define CFG_MDREFR_VAL 0x00138018 /* mh: was 0x00118018 */
  527 +
  528 +/* MDMRS: Mode Register Set Configuration Register
  529 + *
  530 + * [31] 0 - reserved
  531 + * [30:23] 00000000- MDMRS2: SDRAM2/3 MRS Value. (not used)
  532 + * [22:20] 011 - MDCL2: SDRAM2/3 Cas Latency. (not used)
  533 + * [19] 0 - MDADD2: SDRAM2/3 burst Type. Fixed to sequential. (not used)
  534 + * [18:16] 010 - MDBL2: SDRAM2/3 burst Length. Fixed to 4. (not used)
  535 + * [15] 0 - reserved
  536 + * [14:07] 00000000- MDMRS0: SDRAM0/1 MRS Value.
  537 + * [06:04] 011 - MDCL0: SDRAM0/1 Cas Latency.
  538 + * [03] 0 - MDADD0: SDRAM0/1 burst Type. Fixed to sequential.
  539 + * [02:00] 010 - MDBL0: SDRAM0/1 burst Length. Fixed to 4.
  540 + */
  541 +#define CFG_MDMRS_VAL 0x00320032
  542 +
  543 +/*
  544 + * PCMCIA and CF Interfaces
  545 + */
  546 +#define CFG_MECR_VAL 0x00000000
  547 +#define CFG_MCMEM0_VAL 0x00010504
  548 +#define CFG_MCMEM1_VAL 0x00010504
  549 +#define CFG_MCATT0_VAL 0x00010504
  550 +#define CFG_MCATT1_VAL 0x00010504
  551 +#define CFG_MCIO0_VAL 0x00004715
  552 +#define CFG_MCIO1_VAL 0x00004715
  553 +
  554 +
  555 +#endif /* __CONFIG_H */