]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/esd/dasa_sim/flash.c
ARM: highbank: use default prompt
[karo-tx-uboot.git] / board / esd / dasa_sim / flash.c
1 /*
2  * (C) Copyright 2001
3  * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <asm/ppc4xx.h>
10 #include <asm/processor.h>
11
12 /*
13  * include common flash code (for esd boards)
14  */
15 #include "../common/flash.c"
16
17 /*-----------------------------------------------------------------------
18  * Functions
19  */
20 static ulong flash_get_size (vu_long *addr, flash_info_t *info);
21 static void flash_get_offsets (ulong base, flash_info_t *info);
22
23
24 /*-----------------------------------------------------------------------
25  */
26
27 unsigned long flash_init (void)
28 {
29         unsigned long size_b0;
30         int i;
31
32         /* Init: no FLASHes known */
33         for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
34                 flash_info[i].flash_id = FLASH_UNKNOWN;
35         }
36
37         /* Static FLASH Bank configuration here - FIXME XXX */
38
39         size_b0 = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
40
41         if (flash_info[0].flash_id == FLASH_UNKNOWN) {
42                 printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
43                         size_b0, size_b0<<20);
44         }
45
46         /* Setup offsets */
47         flash_get_offsets (-size_b0, &flash_info[0]);
48
49         /* Monitor protection ON by default */
50         (void)flash_protect(FLAG_PROTECT_SET,
51                             -monitor_flash_len,
52                             0xffffffff,
53                             &flash_info[0]);
54
55         flash_info[0].size = size_b0;
56
57         return (size_b0);
58 }