[U-Boot] A bit about board.c, board.c
Hi, Each architecture has its own board.c but they are mostly quite similar. New features such as fdt, boot timing, trace, profiling, etc. must be done separately for each arch, even if there are no architecture-specific bits. What would you say to adding something like lib/board.c which is a simplified cleaned-up copy of one of the existing board.c files, and a CONFIG_ARCH_GENERIC_BOARD option to select that in preference to the architecture-specific one. Then perhaps people could try it out and we could slowly move to it over time... Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/2] bootstage: record and publish boot progress timing
Hi, On Sun, Oct 16, 2011 at 11:40 AM, Simon Glass wrote: > This patch is the first baby step in creating a simple boot progress timing > feature in U-Boot. > > Previous discussion on this were here: > > http://lists.denx.de/pipermail/u-boot/2011-May/thread.html#92584 > > A request was made to unify this with show_boot_progress(). There are many > ways to do this, and I propose the following: > > 1. Create bootstage.h with the intent of replacing integers with enums. This > will allow the values to be easily changed or rationalised later as required. > It also makes it more explicit that (for example) 15 means we are about to > run an OS. > > 2. Change show_boot_progress() to use these enums. This first patch just > shows doing this with one (commonly used) integer value. > > 3. Create bootstage.c file which permits recording of bootstage timestamps. > > 4. Change the existing show_boot_progress() handlers within board files to > use a provided bootstage progress handler instead. This is easy enough as > there are few users. > > 5. Change show_boot_progress() to call into bootstage, which in turns calls > the board-provided progress handler, if defined, after recording a timestamp. > The function signature will stay the same for now. Any comments on this please? I would like to get into this over the next week or two. Regards, Simon > > Please advise if you don't like the above approach or have a better idea. > Also I am not sure how best to deal with these pan-arch and pan-maintainer > patches. Should they be split into lots of little patches for each or can > they be applied to U-Boot's master so everyone can pick them up? It is not > as bad as it sounds since few files make a lot of use of > show_boot_progress(). > > If I get as far as 5, I will think about where to go next then. Ultimately I > would like boot timing available from before U-Boot to user space in Linux. > See RFC patch for Linux here: > > http://lwn.net/Articles/460432/ > > and discussion here: > > http://comments.gmane.org/gmane.linux.kernel/1194861 > Regards, Simon > > > Simon Glass (2): > Create an initial header for boot progress integers > bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress() > > arch/arm/lib/bootm.c | 2 +- > arch/avr32/lib/bootm.c | 2 +- > arch/m68k/lib/bootm.c | 2 +- > arch/microblaze/lib/bootm.c | 2 +- > arch/mips/lib/bootm.c | 2 +- > arch/mips/lib/bootm_qemu_mips.c | 2 +- > arch/powerpc/lib/bootm.c | 2 +- > board/csb226/csb226.c | 12 +--- > board/innokom/innokom.c | 8 +--- > board/pcs440ep/pcs440ep.c | 3 +-- > board/sixnet/sixnet.c | 2 +- > common/cmd_bootm.c | 8 > include/bootstage.h | 32 > 13 files changed, 59 insertions(+), 20 deletions(-) > create mode 100644 include/bootstage.h > > -- > 1.7.3.1 > > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()
Hi Albert, On Fri, Oct 21, 2011 at 3:24 PM, Albert ARIBAUD wrote: > Le 21/10/2011 23:54, Simon Glass a écrit : >> >> Hi Albert, >> >> On Fri, Oct 21, 2011 at 2:43 PM, Albert ARIBAUD >> wrote: >>> >>> Le 21/10/2011 23:18, Simon Glass a écrit : Hi Albert, On Fri, Oct 21, 2011 at 1:58 PM, Albert ARIBAUD wrote: > > Le 13/10/2011 23:05, Simon Glass a écrit : >> >> Some SOCs have do not start up with their 'main' CPU. The first U-Boot >> code may then be executed with a CPU which does not have a CP15, or >> not >> a >> useful one. >> >> Here we split the initialization of CP15 into a separate call, which >> can >> be performed later if required. >> >> Once the main CPU is running, you should call cpu_init_cp15() to >> perform >> this init as early as possible. >> >> Existing ARMv7 boards which define CONFIG_SKIP_LOWLEVEL_INIT should >> not >> need to change, this CP15 init is still skipped in that case. The only >> impact for these boards is that the cpu_init_cp15() will be available >> even if it is never used on these boards. > > I'm not too sure I understand how this is working: if you are moving > cp15 > init to later, it will still be done by the same core that would have > done > it earlier, won't it? > > IOW, I would like to better understand how this boot core/main core > business > works. How does the main core start execution? At which address? Does > it > go > through its reset vector? Do the cores share the same location for > reset > vectors? Etc. For Tegra is it like this: The ARM7 CPU (called AVP for Audio Video Processor) starts up first. It runs the boot ROM and then U-Boot and gets as far as arch_cpu_init(). The AVP does not have a CP15 or a cache so cannot run the CP15 init code. The AVP then starts up the first Cortex-A9 (an ARMv7 architecture CPU). This CPU (the main core, if you like) starts from the same address as the first one (i.e. the start of U-Boot). It is as if this is the core that we really wanted to use, but it wasn't available initially. This main core runs through arch_cpu_init() and sails into board_init_f(). At this point no CP15 init has been done. >>> >>> Thanks. So what this amounts to is, both cores will run the same binary, >>> and >>> I assume the AVP will shut itself off once the A9 runs. But what I don't >>> get >> >> Yes >> >>> is, if A9 goes through the same sequence of code as AVP, then it will >>> execute cp15 where is is not, won't it? >> >> On Tegra we have CONFIG_SKIP_LOWLEVEL_INIT set to avoid this. That >> much is already supported by U-Boot. > > I still don't get it: if you have lowlevel init skipped for one core, it > will be for the other as well. OK so let's run through the U-Boot code in order for each of the two CPUs: First AVP: _start skips lowlevel init (so no CP15) board_init_f arch_cpu_init (at this point it starts up the A9 and halts) A9: _start skips lowlevel init (so no CP15) board_init_f arch_cpu_init cpu_init_cp15 The call to cpu_init_cp15() is performed in arch_cpu_init() when we detect that we are the A9. > >>> Anyway: your patch moves cp15 init far enough that the AVP won't execute >>> it, >>> but the A9 will. >> >> Well, on Tegra we call the cp15 init directly when it is safe to do so, >> later. >> >>> >>> Only, what will happen when another multiple-core ARM SoC gets U-Boot >>> support but the location you chose for cp15 init is inadequate for it? >>> Shall >>> we move cp15 init again, and where? >> >> If CONFIG_SKIP_LOWLEVEL_INIT is not defined, then the low level init >> will operate exactly as now. My patch effectively just allows you to >> have CONFIG_SKIP_LOWLEVEL_INIT but later call part of that lowlevel >> init. In my view, the cp15 init should not be lumped in with the >> 'memory init' or whatever else it expected to be done in the lowlevel >> init. > > I think I get the point: due to the fact that both cores run the same starup > code path, and due to the fact that they run it one after the other and > share a lot of devices, at mots one of them shoud perform low level inits > (e.g. RAM init), and some low-level inits can only be performed by one of > them (e.g., cp15). Well on Tegra the RAM init is down by the boot ROM. There is no low level init bar the cp15 stuff. > >>> I'd prefer the cp15 init to stay where it is but execute only for A9, for >>> instance by checking some core identification register. >> >> Well I actually haven't moved it! It is just that previously it was >> impossible to call cp15_init from anywhere later. > > It is moved, in that it belongs to low level init... of A9. OK, I see - you mean moved in order if not in source code file. > >> What you say can be done, it would involve some assembler though and >> would need to be another CONFIG option. Was trying to av
Re: [U-Boot] [PATCH v2 1/3] Add limits.h to hold basic limits
Hi Albert, On Fri, Oct 21, 2011 at 3:39 PM, Albert ARIBAUD wrote: > Le 22/10/2011 00:02, Simon Glass a écrit : >> >> Hi Albert, >> >> On Fri, Oct 21, 2011 at 2:47 PM, Albert ARIBAUD >> wrote: >>> >>> Le 21/10/2011 23:12, Simon Glass a écrit : Hi Albert, On Fri, Oct 21, 2011 at 2:00 PM, Albert ARIBAUD wrote: > > Le 21/10/2011 22:19, Simon Glass a écrit : >> >> Hi Albert, >> >> On Fri, Oct 21, 2011 at 12:54 PM, Albert ARIBAUD >> wrote: >>> >>> Hi Simon, >>> >>> Le 10/10/2011 21:22, Simon Glass a écrit : This brings a basic limits.h implementation into U-Boot. Signed-off-by: Simon Glass --- fs/ubifs/ubifs.h | 4 +--- include/limits.h | 40 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 include/limits.h >>> >>> Apparently, in all the U-Boot codebase, only one file required >>> standard >>> limit names, and gets them with three lines of code. Is it worth >>> adding >>> 40 >>> lines of code for this? >> >> Well 2/3 is the license header - and I thought it best to add all the >> limits in one go. I can add just those few if you like. >> >> This file is used later in the patch series. > > I don't see much use of these in the subsequent patches either -- and > those > few uses could be discussed, such as for instance the use of INT_MAX as > the > maximum buffer size for some *printf() functions -- actually, anything > very > big would fit just as well, would it not? Yes it would, it's doesn't really need to be INT_MAX. Then again, limits.h is a fairly standard file to have around, and INT_MAX is an efficient 'large' value to load on many architectures. In any case it seems wrong to me that ubifs is defining its own INT_MAX and U-Boot doesn't have one. >>> >>> My point is precisely that as standard as limits.h is, U-Boot has managed >>> to >>> survive not having it around so far, which kind of shows limits.h is not >>> needed. >> >> By that logic one would never do any code clean ups. Do I understand >> you correctly? > > You're extending my logic here: not all cleanups are done by adding a header > file and replacing some lines by an include and some other lines. :) > > Actually, I don't think introducing limits.h is any cleanup; it is an > attempt at using standards whenever possible, which may be fine with some > standards: I'd be happy of U-Boot used uint{8,16,32}_t instead of > u{8,16,32}, for instance, because it uses that a lot. With limits.h, my > gripe with it here is that, while possible, I don't see it bringing benefits > here as 1) the ubi code already defines what it needs, 2) other uses in the > patchset do not actually require /limits/, and 3) there are not many places > in the whole U-Boot code that do. > > If you can prove me wrong, i.e. if you can show that limits.h would add a > lot of benefits to more than the other files in its own patchset, then I'll > happily reconsider. I see few and small benefits. Of course if it is not there then people will not use it, so it is self-fulfilling. > >> But this is the least of my concerns :-) If you don't want it, don't >> take it. Shall I modify the series to define its own INT_MAX, or just >> chose a large number? > > Well I don't think the limits.h introduction is useful here, and not > introducing it will barely cost a source code line. As for the number to use > in *printf(), either way is fine with me, as this number is arbitrary > anyway. OK > >> BTW I think you are looking at the old version of that patch series - >> we are now on v4. The limits.h patch is the same though. Later on in >> the series I add comments to vsprintf() functions and move them into >> their own header. If you apply the same logic there then that tidy is >> not needed also. Please let me know. > > Thanks for reminding me. I did see the V4 series and it is the one I > actually commented on in my previous mail. Apologies for not having made > that explicit. OK that's fine - I will redo the series without limits.h. Regards, Simon > >> Regards, >> Simon > > Amicalement, > -- > Albert. > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/8] Move simple_itoa to vsprintf
This function is generally useful and shouldn't hide away in hush. It has been moved as is. Signed-off-by: Simon Glass --- common/hush.c| 15 --- include/common.h |1 + lib/vsprintf.c | 16 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/common/hush.c b/common/hush.c index 85a6030..9bdb499 100644 --- a/common/hush.c +++ b/common/hush.c @@ -17,7 +17,6 @@ * Erik W. Troan, which they placed in the public domain. I don't know * how much of the Johnson/Troan code has survived the repeated rewrites. * Other credits: - * simple_itoa() was lifted from boa-0.93.15 * b_addchr() derived from similar w_addchar function in glibc-2.2 * setup_redirect(), redirect_opt_num(), and big chunks of main() *and many builtins derived from contributions by Erik Andersen @@ -922,20 +921,6 @@ static int b_addqchr(o_string *o, int ch, int quote) return b_addchr(o, ch); } -/* belongs in utility.c */ -char *simple_itoa(unsigned int i) -{ - /* 21 digits plus null terminator, good for 64-bit or smaller ints */ - static char local[22]; - char *p = &local[21]; - *p-- = '\0'; - do { - *p-- = '0' + i % 10; - i /= 10; - } while (i > 0); - return p + 1; -} - #ifndef __U_BOOT__ static int b_adduint(o_string *o, unsigned int i) { diff --git a/include/common.h b/include/common.h index eb19a44..55f772d 100644 --- a/include/common.h +++ b/include/common.h @@ -702,6 +702,7 @@ voidpanic(const char *fmt, ...) intsprintf(char * buf, const char *fmt, ...) __attribute__ ((format (__printf__, 2, 3))); intvsprintf(char *buf, const char *fmt, va_list args); +char *simple_itoa(ulong i); /* lib/strmhz.c */ char * strmhz(char *buf, unsigned long hz); diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 79dead3..e497a86 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -7,6 +7,8 @@ /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ /* * Wirzenius wrote this portably, Torvalds fucked it up :-) + * + * from hush: simple_itoa() was lifted from boa-0.93.15 */ #include @@ -738,3 +740,17 @@ void __assert_fail(const char *assertion, const char *file, unsigned line, panic("%s:%u: %s: Assertion `%s' failed.", file, line, function, assertion); } + +char *simple_itoa(ulong i) +{ + /* 21 digits plus null terminator, good for 64-bit or smaller ints */ + static char local[22]; + char *p = &local[21]; + + *p-- = '\0'; + do { + *p-- = '0' + i % 10; + i /= 10; + } while (i > 0); + return p + 1; +} -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/8] tftpput: Rename TFTP to TFTPGET
This is a better name for this protocol. Also remove the typedef to keep checkpatch happy, and move zeroing of NetBootFileXferSize a little earlier since TFTPPUT will need to change this. Signed-off-by: Simon Glass --- common/cmd_net.c |8 include/net.h|8 +--- net/net.c| 18 -- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/common/cmd_net.c b/common/cmd_net.c index 872f4a6..f610385 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -28,7 +28,7 @@ #include #include -static int netboot_common (proto_t, cmd_tbl_t *, int , char * const []); +static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -43,7 +43,7 @@ U_BOOT_CMD( int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - return netboot_common (TFTP, cmdtp, argc, argv); + return netboot_common(TFTPGET, cmdtp, argc, argv); } U_BOOT_CMD( @@ -167,8 +167,8 @@ static void netboot_update_env (void) #endif } -static int -netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char * const argv[]) +static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, + char * const argv[]) { char *s; char *end; diff --git a/include/net.h b/include/net.h index d5d37b6..3dfe073 100644 --- a/include/net.h +++ b/include/net.h @@ -347,8 +347,10 @@ extern int NetState; /* Network loop state */ extern int NetRestartWrap; /* Tried all network devices */ -typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP, - TFTPSRV } proto_t; +enum { + BOOTP, RARP, ARP, TFTPGET, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP, + TFTPSRV +}; /* from net/net.c */ extern charBootFile[128]; /* Boot File name */ @@ -374,7 +376,7 @@ extern int NetTimeOffset; /* offset time from UTC */ #endif /* Initialize the network adapter */ -extern int NetLoop(proto_t); +extern int NetLoop(enum proto_t); /* Shutdown adapters and cleanup */ extern voidNetStop(void); diff --git a/net/net.c b/net/net.c index 5e67886..ce07ed6 100644 --- a/net/net.c +++ b/net/net.c @@ -224,7 +224,7 @@ static ulongtimeDelta; /* THE transmit packet */ volatile uchar *NetTxPacket; -static int net_check_prereq(proto_t protocol); +static int net_check_prereq(enum proto_t protocol); static int NetTryCount; @@ -310,8 +310,7 @@ void ArpTimeoutCheck(void) } } -static void -NetInitLoop(proto_t protocol) +static void NetInitLoop(enum proto_t protocol) { static int env_changed_id; bd_t *bd = gd->bd; @@ -340,8 +339,7 @@ NetInitLoop(proto_t protocol) * Main network processing loop. */ -int -NetLoop(proto_t protocol) +int NetLoop(enum proto_t protocol) { bd_t *bd = gd->bd; @@ -405,10 +403,11 @@ restart: case 0: NetDevExists = 1; + NetBootFileXferSize = 0; switch (protocol) { - case TFTP: + case TFTPGET: /* always use ARP to get server ethernet address */ - TftpStart(); + TftpStart(protocol); break; #ifdef CONFIG_CMD_TFTPSRV case TFTPSRV: @@ -470,7 +469,6 @@ restart: break; } - NetBootFileXferSize = 0; break; } @@ -1728,7 +1726,7 @@ NetReceive(volatile uchar *inpkt, int len) /**/ -static int net_check_prereq(proto_t protocol) +static int net_check_prereq(enum proto_t protocol) { switch (protocol) { /* Fall through */ @@ -1759,7 +1757,7 @@ static int net_check_prereq(proto_t protocol) #if defined(CONFIG_CMD_NFS) case NFS: #endif - case TFTP: + case TFTPGET: if (NetServerIP == 0) { puts("*** ERROR: `serverip' not set\n"); return 1; -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/8] tftpput: move common code into separate functions
We want to show block markers on completion of get and put, so move this common code into separate functions. Signed-off-by: Simon Glass --- net/tftp.c | 70 ++- 1 files changed, 40 insertions(+), 30 deletions(-) diff --git a/net/tftp.c b/net/tftp.c index da8eeaa..4ad85a5 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -195,6 +195,42 @@ static void TftpTimeout(void); /**/ +static void show_block_marker(void) +{ + ulong pos = TftpBlock * TftpBlkSize + TftpBlockWrapOffset; + +#ifdef CONFIG_TFTP_TSIZE + if (TftpTsize) { + while (TftpNumchars < + /* TODO: needs to be different for put */ + pos * 50 / TftpTsize) { + putc('#'); + TftpNumchars++; + } + } +#endif + else { + if (((TftpBlock - 1) % 10) == 0) + putc('#'); + else if ((TftpBlock % (10 * HASHES_PER_LINE)) == 0) + puts("\n\t "); + } +} + +/* The TFTP get or put is complete */ +static void tftp_complete(void) +{ +#ifdef CONFIG_TFTP_TSIZE + /* Print hash marks for the last packet received */ + while (TftpTsize && TftpNumchars < 49) { + putc('#'); + TftpNumchars++; + } +#endif + puts("\ndone\n"); + NetState = NETLOOP_SUCCESS; +} + static void TftpSend(void) { @@ -400,21 +436,8 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, TftpBlkSize * TFTP_SEQUENCE_SIZE; printf("\n\t %lu MB received\n\t ", TftpBlockWrapOffset>>20); - } -#ifdef CONFIG_TFTP_TSIZE - else if (TftpTsize) { - while (TftpNumchars < - NetBootFileXferSize * 50 / TftpTsize) { - putc('#'); - TftpNumchars++; - } - } -#endif - else { - if (((TftpBlock - 1) % 10) == 0) - putc('#'); - else if ((TftpBlock % (10 * HASHES_PER_LINE)) == 0) - puts("\n\t "); + } else { + show_block_marker(); } if (TftpState == STATE_SEND_RRQ) @@ -498,21 +521,8 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, } else #endif - if (len < TftpBlkSize) { - /* -* We received the whole thing. Try to -* run it. -*/ -#ifdef CONFIG_TFTP_TSIZE - /* Print hash marks for the last packet received */ - while (TftpTsize && TftpNumchars < 49) { - putc('#'); - TftpNumchars++; - } -#endif - puts("\ndone\n"); - NetState = NETLOOP_SUCCESS; - } + if (len < TftpBlkSize) + tftp_complete(); break; case TFTP_ERROR: -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 7/8] tftpput: implement tftp logic
This adds logic to tftp.c to implement the tftp 'put' command, and updates the README. Signed-off-by: Simon Glass --- README |2 + net/net.c |4 ++ net/tftp.c | 114 +-- 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/README b/README index 7e032a9..8261bfb 100644 --- a/README +++ b/README @@ -784,6 +784,7 @@ The following options need to be configured: CONFIG_CMD_SOURCE "source" command Support CONFIG_CMD_SPI * SPI serial bus support CONFIG_CMD_TFTPSRV * TFTP transfer in server mode + CONFIG_CMD_TFTPPUT * TFTP put command (upload) CONFIG_CMD_TIME * run command and report execution time CONFIG_CMD_USB * USB support CONFIG_CMD_CDP * Cisco Discover Protocol support @@ -3340,6 +3341,7 @@ bootp - boot image via network using BootP/TFTP protocol tftpboot- boot image via network using TFTP protocol and env variables "ipaddr" and "serverip" (and eventually "gatewayip") +tftpput - upload a file via network using TFTP protocol rarpboot- boot image via network using RARP/TFTP protocol diskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd' loads - load S-Record file over serial line diff --git a/net/net.c b/net/net.c index ce07ed6..89596d3 100644 --- a/net/net.c +++ b/net/net.c @@ -406,6 +406,9 @@ restart: NetBootFileXferSize = 0; switch (protocol) { case TFTPGET: +#ifdef CONFIG_CMD_TFTPPUT + case TFTPPUT: +#endif /* always use ARP to get server ethernet address */ TftpStart(protocol); break; @@ -1758,6 +1761,7 @@ static int net_check_prereq(enum proto_t protocol) case NFS: #endif case TFTPGET: + case TFTPPUT: if (NetServerIP == 0) { puts("*** ERROR: `serverip' not set\n"); return 1; diff --git a/net/tftp.c b/net/tftp.c index 3a58e32..02862c6 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -82,6 +82,11 @@ static int TftpTsize; static short TftpNumchars; #endif static int TftpWriting;/* 1 if writing, else 0 */ +#ifdef CONFIG_CMD_TFTPPUT +static int TftpFinalBlock; /* 1 if we have sent the last block */ +#else +#define TftpWriting0 +#endif #define STATE_SEND_RRQ 1 #define STATE_DATA 2 @@ -89,6 +94,7 @@ static intTftpWriting;/* 1 if writing, else 0 */ #define STATE_BAD_MAGIC4 #define STATE_OACK 5 #define STATE_RECV_WRQ 6 +#define STATE_SEND_WRQ 7 /* default TFTP block size */ #define TFTP_BLOCK_SIZE512 @@ -191,6 +197,28 @@ store_block(unsigned block, uchar *src, unsigned len) NetBootFileXferSize = newsize; } +#ifdef CONFIG_CMD_TFTPPUT +/** + * Load the next block from memory to be sent over tftp. + * + * @param blockBlock number to send + * @param dst Destination buffer for data + * @param len Number of bytes in block (this one and every other) + * @return number of bytes loaded + */ +static int load_block(unsigned block, uchar *dst, unsigned len) +{ + ulong offset = (block - 1) * len + TftpBlockWrapOffset; + ulong tosend = len; + + tosend = min(NetBootFileXferSize - offset, tosend); + (void)memcpy(dst, (void *)(save_addr + offset), tosend); + debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__, + block, offset, len, tosend); + return tosend; +} +#endif + static void TftpSend(void); static void TftpTimeout(void); @@ -235,7 +263,7 @@ static void tftp_complete(void) static void TftpSend(void) { - volatile uchar *pkt; + uchar *pkt; volatile uchar *xp; int len = 0; volatile ushort *s; @@ -251,14 +279,15 @@ TftpSend(void) * We will always be sending some sort of packet, so * cobble together the packet headers now. */ - pkt = NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE; + pkt = (uchar *)(NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE); switch (TftpState) { - case STATE_SEND_RRQ: + case STATE_SEND_WRQ: xp = pkt; s = (ushort *)pkt; - *s++ = htons(TFTP_RRQ); + *s++ = htons(TftpState == STATE_SEND_RRQ ? TFTP_RRQ + : TFTP_WRQ); pkt = (uchar *)s; strcpy((char *)pkt, tftp_filename); pkt += strlen(tftp_filename) + 1; @@ -270,8 +299,8 @@ TftpSend(void) debug("send option \"timeout %s\"\n", (char *)pkt); pkt += strlen((char *)pkt) + 1; #ifdef CONFIG_TFTP_TSIZE - memcpy((char *)pkt, "tsize\\0", 8); - pkt += 8; + pkt +=
[U-Boot] [PATCH 6/8] tftpput: add save_addr and save_size global variables
We need something akin to load_addr to handle saving data. Signed-off-by: Simon Glass --- common/cmd_nvedit.c |2 ++ include/common.h|2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index da7028c..30cf8df 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -79,6 +79,8 @@ SPI_FLASH|MG_DISK|NVRAM|MMC} or CONFIG_ENV_IS_NOWHERE #defineMAX_ENV_SIZE(1 << 20) /* 1 MiB */ ulong load_addr = CONFIG_SYS_LOAD_ADDR;/* Default Load Address */ +ulong save_addr; /* Default Save Address */ +ulong save_size; /* Default Save Size (in bytes) */ /* * Table with supported baudrates (defined in config_xyz.h) diff --git a/include/common.h b/include/common.h index 99c2a37..d7382d9 100644 --- a/include/common.h +++ b/include/common.h @@ -278,6 +278,8 @@ void flash_perror (int); intsource (ulong addr, const char *fit_uname); extern ulong load_addr;/* Default Load Address */ +extern ulong save_addr;/* Default Save Address */ +extern ulong save_size;/* Default Save Size */ /* common/cmd_doc.c */ void doc_probe(unsigned long physadr); -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 8/8] tftpput: add tftpput command
This adds a command to start a tftp put transfer. Signed-off-by: Simon Glass --- common/cmd_net.c | 23 +++ include/config_cmd_all.h |1 + 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/common/cmd_net.c b/common/cmd_net.c index f610385..f89a24b 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -52,6 +52,22 @@ U_BOOT_CMD( "[loadAddress] [[hostIPaddr:]bootfilename]" ); +#ifdef CONFIG_CMD_TFTPPUT +int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + int ret; + + ret = netboot_common(TFTPPUT, cmdtp, argc, argv); + return ret; +} + +U_BOOT_CMD( + tftpput,4, 1, do_tftpput, + "TFTP put command, for uploading files to a server", + "Address Size [[hostIPaddr:]filename]" +); +#endif + #ifdef CONFIG_CMD_TFTPSRV static int do_tftpsrv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { @@ -203,6 +219,13 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, break; +#ifdef CONFIG_CMD_TFTPPUT + case 4: + save_addr = strict_strtoul(argv[1], NULL, 16); + save_size = strict_strtoul(argv[2], NULL, 16); + copy_filename(BootFile, argv[3], sizeof(BootFile)); + break; +#endif default: show_boot_progress (-80); return cmd_usage(cmdtp); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 9716f9c..7fa8661 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -82,6 +82,7 @@ #define CONFIG_CMD_SOURCE /* "source" command support */ #define CONFIG_CMD_SPI /* SPI utility */ #define CONFIG_CMD_TERMINAL/* built-in Serial Terminal */ +#define CONFIG_CMD_TFTPPUT /* TFTP upload */ #define CONFIG_CMD_UBI /* UBI Support */ #define CONFIG_CMD_UBIFS /* UBIFS Support*/ #define CONFIG_CMD_UNIVERSE/* Tundra Universe Support */ -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/8] tftpput: support selecting get/put for tftp
TftpStart should support starting either a get or a put. Signed-off-by: Simon Glass --- include/net.h |4 ++-- net/bootp.c |2 +- net/tftp.c|5 +++-- net/tftp.h|2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/net.h b/include/net.h index 3dfe073..2e5a898 100644 --- a/include/net.h +++ b/include/net.h @@ -349,8 +349,8 @@ extern int NetRestartWrap; /* Tried all network devices*/ enum { BOOTP, RARP, ARP, TFTPGET, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP, - TFTPSRV -}; + TFTPSRV, TFTPPUT +} proto_t; /* from net/net.c */ extern charBootFile[128]; /* Boot File name */ diff --git a/net/bootp.c b/net/bootp.c index a003c42..068b037 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -165,7 +165,7 @@ static void auto_load(void) } #endif } - TftpStart(); + TftpStart(TFTPGET); } #if !defined(CONFIG_CMD_DHCP) diff --git a/net/tftp.c b/net/tftp.c index 4ad85a5..3a58e32 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -81,6 +81,7 @@ static intTftpTsize; /* The number of hashes we printed */ static short TftpNumchars; #endif +static int TftpWriting;/* 1 if writing, else 0 */ #define STATE_SEND_RRQ 1 #define STATE_DATA 2 @@ -572,8 +573,7 @@ TftpTimeout(void) } -void -TftpStart(void) +void TftpStart(proto_t protocol) { char *ep; /* Environment pointer */ @@ -648,6 +648,7 @@ TftpStart(void) } putc('\n'); + TftpWriting = (protocol == TFTPPUT); printf("Load address: 0x%lx\n", load_addr); diff --git a/net/tftp.h b/net/tftp.h index 3abdf7b..2d5d594 100644 --- a/net/tftp.h +++ b/net/tftp.h @@ -16,7 +16,7 @@ */ /* tftp.c */ -extern voidTftpStart (void); /* Begin TFTP get */ +void TftpStart(proto_t protocol); /* Begin TFTP get/put */ #ifdef CONFIG_CMD_TFTPSRV extern voidTftpStartServer(void); /* Wait for incoming TFTP put */ -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/8] Add setenv_uint() and setenv_addr()
It seems we put numbers and addresses into environment variables a lot. We should have some functions to do this. Signed-off-by: Simon Glass --- common/cmd_nvedit.c | 29 + include/common.h|2 ++ 2 files changed, 31 insertions(+), 0 deletions(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 101bc49..da7028c 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -377,6 +377,35 @@ int setenv(const char *varname, const char *varvalue) return _do_env_set(0, 3, (char * const *)argv); } +/** + * Set an environment variable to an integer value + * + * @param varname Environmet variable to set + * @param valueValue to set it to + * @return 0 if ok, 1 on error + */ +int setenv_ulong(const char *varname, ulong value) +{ + char *str = simple_itoa(value); + + return setenv(varname, str); +} + +/** + * Set an environment variable to an address in hex + * + * @param varname Environmet variable to set + * @param addr Value to set it to + * @return 0 if ok, 1 on error + */ +int setenv_addr(const char *varname, const void *addr) +{ + char str[17]; + + sprintf(str, "%x", (uintptr_t)addr); + return setenv(varname, str); +} + int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) diff --git a/include/common.h b/include/common.h index 55f772d..99c2a37 100644 --- a/include/common.h +++ b/include/common.h @@ -294,6 +294,8 @@ int inline setenv(const char *, const char *); #else intsetenv (const char *, const char *); #endif /* CONFIG_PPC */ +int setenv_ulong(const char *varname, ulong value); +int setenv_addr(const char *varname, const void *addr); #ifdef CONFIG_ARM # include # include -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/8] Add tftpput command for uploading files over network
The tftpboot command permits reading of files over a network interface using the Trivial FTP protocol. This patch series adds the ability to transfer files the other way. Why is this useful? - Uploading boot time data to a server - Uploading profiling information - Uploading large mounts of data for comparison / checking on a host (e.g. use tftpput and ghex2 instead of the 'md' command) Mostly the existing code can be re-used and I have tried to avoid too much refactoring or cleaning up. The feature is activated by the CONFIG_CMD_TFTPPUT option. This has been very lightly tested on a Seaboard with a USB network adaptor. I don't think it handles block number overflow. Simon Glass (8): Move simple_itoa to vsprintf Add setenv_uint() and setenv_addr() tftpput: Rename TFTP to TFTPGET tftpput: move common code into separate functions tftpput: support selecting get/put for tftp tftpput: add save_addr and save_size global variables tftpput: implement tftp logic tftpput: add tftpput command README |2 + common/cmd_net.c | 31 +++- common/cmd_nvedit.c | 31 common/hush.c| 15 include/common.h |5 + include/config_cmd_all.h |1 + include/net.h|8 +- lib/vsprintf.c | 16 net/bootp.c |2 +- net/net.c| 22 +++--- net/tftp.c | 189 +- net/tftp.h |2 +- 12 files changed, 238 insertions(+), 86 deletions(-) -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RESEND PATCH v3] Add assert() for debug assertions
Hi Wolfgang, On Fri, Oct 21, 2011 at 3:20 PM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message <1315434680-21641-1-git-send-email-...@chromium.org> you wrote: >> assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined. >> This is useful when a condition is an error but a board reset is unlikely >> to fix it, so it is better to soldier on in hope. Assertion failures should >> be caught during development/test. >> >> It turns out that assert() is defined separately in a few places in U-Boot >> with various meanings. This patch cleans up some of these. >> >> Build errors exposed by this change (and defining DEBUG) are also fixed in >> this patch. >> >> Signed-off-by: Simon Glass > ... >> --- a/lib/vsprintf.c >> +++ b/lib/vsprintf.c >> @@ -730,3 +730,11 @@ void panic(const char *fmt, ...) >> while (1) >> ; >> } >> + >> +void __assert_fail(const char *assertion, const char *file, unsigned line, >> + const char *function) >> +{ >> + /* This will not return */ >> + panic("%s:%u: %s: Assertion `%s' failed.", file, line, function, >> + assertion); >> +} > > Can you please #ifdef it so it doesn't get added for the non-debug > case, too? Well I could, but then if someone defines DEBUG in a file they will get a link error I think. Or are you thinking of adding a new CONFIG which *permits* people to use DEBUG? Regards, Simon > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de > The human mind ordinarily operates at only ten percent of its > capacity. The rest is overhead for the operating system. > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 1/9] nds32: add header files support for nds32
Hi Wolfgang, 2011/10/22 Wolfgang Denk : > Dear Macpaul Lin, > >> Changes for v17: > > Applied, thanks. > > Best regards, > > Wolfgang Denk Great Thanks to Wolfgang, Mike, Po-Yu, Greentime, CM Chao and other people contributed to u-boot. -- Best regards, Macpaul Lin ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
On Saturday, October 22, 2011 02:41:54 AM Albert ARIBAUD wrote: > Le 22/10/2011 02:19, Marek Vasut a écrit : > > On Saturday, October 22, 2011 02:04:52 AM Tom Rini wrote: > >> On Fri, Oct 21, 2011 at 4:45 PM, Marek Vasut wrote: > >>> On Saturday, October 22, 2011 01:08:43 AM Albert ARIBAUD wrote: > Le 22/10/2011 00:46, Marek Vasut a écrit : > > On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: > >> Le 22/10/2011 00:00, Marek Vasut a écrit : > >>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: > Hi Marek, > > Le 21/10/2011 22:44, Marek Vasut a écrit : > > On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: > >> This allows the SPL to avoid compiling in the CPU support code. > >> > >> Signed-off-by: Marek Vasut > >> Cc: Stefano Babic > >> Cc: Wolfgang Denk > >> Cc: Detlev Zundel > >> Cc: Scott Wood > >> --- > >> > >> arch/arm/cpu/arm926ejs/Makefile |7 +++ > >> 1 files changed, 7 insertions(+), 0 deletions(-) > >> > >> diff --git a/arch/arm/cpu/arm926ejs/Makefile > >> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 > >> --- a/arch/arm/cpu/arm926ejs/Makefile > >> +++ b/arch/arm/cpu/arm926ejs/Makefile > >> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o > >> > >> START = start.o > >> COBJS = cpu.o > >> > >> +ifdef CONFIG_SPL_BUILD > >> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE > >> +START := > >> +COBJS := > >> +endif > >> +endif > >> + > >> > >> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) > >> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) > >> START := $(addprefix $(obj),$(START)) > > > > Hi Albert, > > > > can we get this applied please? > > I still don't understand what this is supposed to do -- why not > linking this code is required. > > Amicalement, > >>> > >>> Hi Albert, > >>> > >>> I use very different start.S in SPL. And I don't need cpu.o at all. > >> > >> That I understand; but is there a /problem/ in linking cpu.o in? > > > > I suppose it'll be optimized out at link time ? > > That indirectly answers my question: what you want to achieve is > removing dead code. > >>> > >>> The code IS USED in U-Boot, but IS NOT USED in SPL ! > >> > >> Right, but linked and unused code in SPL is (or should be!) thrown > >> away, is what's > >> trying to be driven home right now. If the file is going to go away, > >> and it's compiled > >> thrown away at final link of SPL, lets just ignore that it exists for > >> a little longer, and > >> then it won't. > > > > My distrust towards compiler abilities to optimize such stuff out tells > > me it's better to avoid it even to be compiled in at all. > > Optimizing unused functions is a rather simple and reliable ability in > tolchains. The issue is not really whether the toolchain is able to do > the removal (it is); rather, the issue is whether the linker command > line will cause the removal (it will IMO as long as -gc-sections is > specified). > > Amicalement, So what you suggest is to leave cpu.o compiling and drop only start.S ? Cheers ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] [PATCH 00/39] Rework of the debug() macro
On Saturday, October 22, 2011 02:35:13 AM Albert ARIBAUD wrote: > Hi Marek, > > Le 22/10/2011 02:16, Marek Vasut a écrit : > > This patch series reworks the debug() and debugX() macro in > > include/common.h to be compatible with GCC 4.6. > > > > This series needs further discussion: > > * Some files suffer size growth with gcc4.2, why ? > > > >- Possibility is that the GCC4.2 is incapable to optimize code out so > >deep > > > > * Does this change break any platforms? Compile tested on PowerPC. > > > >- Please run MAKEALL on your platforms to test this. > > Any git branch we could pull and rebase on our trees rather than am'ing > 39 patches one by one? Please try: git://git.denx.de/u-boot-marex.git , "debug" branch. Cheers ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
Le 22/10/2011 02:19, Marek Vasut a écrit : > On Saturday, October 22, 2011 02:04:52 AM Tom Rini wrote: >> On Fri, Oct 21, 2011 at 4:45 PM, Marek Vasut wrote: >>> On Saturday, October 22, 2011 01:08:43 AM Albert ARIBAUD wrote: Le 22/10/2011 00:46, Marek Vasut a écrit : > On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: >> Le 22/10/2011 00:00, Marek Vasut a écrit : >>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: Hi Marek, Le 21/10/2011 22:44, Marek Vasut a écrit : > On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: >> This allows the SPL to avoid compiling in the CPU support code. >> >> Signed-off-by: Marek Vasut >> Cc: Stefano Babic >> Cc: Wolfgang Denk >> Cc: Detlev Zundel >> Cc: Scott Wood >> --- >> >> arch/arm/cpu/arm926ejs/Makefile |7 +++ >> 1 files changed, 7 insertions(+), 0 deletions(-) >> >> diff --git a/arch/arm/cpu/arm926ejs/Makefile >> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 >> --- a/arch/arm/cpu/arm926ejs/Makefile >> +++ b/arch/arm/cpu/arm926ejs/Makefile >> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o >> >> START = start.o >> COBJS = cpu.o >> >> +ifdef CONFIG_SPL_BUILD >> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE >> +START := >> +COBJS := >> +endif >> +endif >> + >> >> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) >> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) >> START := $(addprefix $(obj),$(START)) > > Hi Albert, > > can we get this applied please? I still don't understand what this is supposed to do -- why not linking this code is required. Amicalement, >>> >>> Hi Albert, >>> >>> I use very different start.S in SPL. And I don't need cpu.o at all. >> >> That I understand; but is there a /problem/ in linking cpu.o in? > > I suppose it'll be optimized out at link time ? That indirectly answers my question: what you want to achieve is removing dead code. >>> >>> The code IS USED in U-Boot, but IS NOT USED in SPL ! >> >> Right, but linked and unused code in SPL is (or should be!) thrown >> away, is what's >> trying to be driven home right now. If the file is going to go away, >> and it's compiled >> thrown away at final link of SPL, lets just ignore that it exists for >> a little longer, and >> then it won't. > > My distrust towards compiler abilities to optimize such stuff out tells me > it's > better to avoid it even to be compiled in at all. Optimizing unused functions is a rather simple and reliable ability in tolchains. The issue is not really whether the toolchain is able to do the removal (it is); rather, the issue is whether the linker command line will cause the removal (it will IMO as long as -gc-sections is specified). Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] [PATCH 00/39] Rework of the debug() macro
Hi Marek, Le 22/10/2011 02:16, Marek Vasut a écrit : > This patch series reworks the debug() and debugX() macro in include/common.h > to > be compatible with GCC 4.6. > > This series needs further discussion: > * Some files suffer size growth with gcc4.2, why ? >- Possibility is that the GCC4.2 is incapable to optimize code out so deep > * Does this change break any platforms? Compile tested on PowerPC. >- Please run MAKEALL on your platforms to test this. Any git branch we could pull and rebase on our trees rather than am'ing 39 patches one by one? Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [WIKI] changes to "Custodian Git Trees"
All, I have modified http://www.denx.de/wiki/U-Boot/CustodianGitTrees to reflect the layered repository ad also to simplify the custodian operations description ; not having a local uboot branch anymore, and fetching repos rather than pulling them, should avoid the accidental merges that happen (ir)regularly. Comment (or direct editing) welcome. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
On Saturday, October 22, 2011 02:04:52 AM Tom Rini wrote: > On Fri, Oct 21, 2011 at 4:45 PM, Marek Vasut wrote: > > On Saturday, October 22, 2011 01:08:43 AM Albert ARIBAUD wrote: > >> Le 22/10/2011 00:46, Marek Vasut a écrit : > >> > On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: > >> >> Le 22/10/2011 00:00, Marek Vasut a écrit : > >> >>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: > >> Hi Marek, > >> > >> Le 21/10/2011 22:44, Marek Vasut a écrit : > >> > On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: > >> >> This allows the SPL to avoid compiling in the CPU support code. > >> >> > >> >> Signed-off-by: Marek Vasut > >> >> Cc: Stefano Babic > >> >> Cc: Wolfgang Denk > >> >> Cc: Detlev Zundel > >> >> Cc: Scott Wood > >> >> --- > >> >> > >> >> arch/arm/cpu/arm926ejs/Makefile |7 +++ > >> >> 1 files changed, 7 insertions(+), 0 deletions(-) > >> >> > >> >> diff --git a/arch/arm/cpu/arm926ejs/Makefile > >> >> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 > >> >> --- a/arch/arm/cpu/arm926ejs/Makefile > >> >> +++ b/arch/arm/cpu/arm926ejs/Makefile > >> >> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o > >> >> > >> >> START = start.o > >> >> COBJS = cpu.o > >> >> > >> >> +ifdef CONFIG_SPL_BUILD > >> >> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE > >> >> +START := > >> >> +COBJS := > >> >> +endif > >> >> +endif > >> >> + > >> >> > >> >> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) > >> >> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) > >> >> START := $(addprefix $(obj),$(START)) > >> > > >> > Hi Albert, > >> > > >> > can we get this applied please? > >> > >> I still don't understand what this is supposed to do -- why not > >> linking this code is required. > >> > >> Amicalement, > >> >>> > >> >>> Hi Albert, > >> >>> > >> >>> I use very different start.S in SPL. And I don't need cpu.o at all. > >> >> > >> >> That I understand; but is there a /problem/ in linking cpu.o in? > >> > > >> > I suppose it'll be optimized out at link time ? > >> > >> That indirectly answers my question: what you want to achieve is > >> removing dead code. > > > > The code IS USED in U-Boot, but IS NOT USED in SPL ! > > Right, but linked and unused code in SPL is (or should be!) thrown > away, is what's > trying to be driven home right now. If the file is going to go away, > and it's compiled > thrown away at final link of SPL, lets just ignore that it exists for > a little longer, and > then it won't. My distrust towards compiler abilities to optimize such stuff out tells me it's better to avoid it even to be compiled in at all. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 39/39] GCC4.6: Add macros to mv_gen_reg.h
interrupts.c: In function 'interrupt_init_cpu': interrupts.c:40: error: 'ETHERNET0_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:40: error: (Each undeclared identifier is reported only once interrupts.c:40: error: for each function it appears in.) interrupts.c:40: error: 'ETHERNET1_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:40: error: 'ETHERNET2_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:44: error: 'ETHERNET0_INTERRUPT_MASK_REGISTER' undeclared (first use in this function) interrupts.c:44: error: 'ETHERNET1_INTERRUPT_MASK_REGISTER' undeclared (first use in this function) interrupts.c:44: error: 'ETHERNET2_INTERRUPT_MASK_REGISTER' undeclared (first use in this function) Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/Marvell/include/mv_gen_reg.h |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/board/Marvell/include/mv_gen_reg.h b/board/Marvell/include/mv_gen_reg.h index 03fcd88..008185e 100644 --- a/board/Marvell/include/mv_gen_reg.h +++ b/board/Marvell/include/mv_gen_reg.h @@ -1864,6 +1864,14 @@ #define ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(port)(0x3500 + (port<<10)) #define ETH_DA_FILTER_UNICAST_TABLE_BASE(port) (0x3600 + (port<<10)) +/* Compat with interrupts.c */ +#define ETHERNET0_INTERRUPT_CAUSE_REGISTER ETH_INTERRUPT_CAUSE_REG(0) +#define ETHERNET1_INTERRUPT_CAUSE_REGISTER ETH_INTERRUPT_CAUSE_REG(1) +#define ETHERNET2_INTERRUPT_CAUSE_REGISTER ETH_INTERRUPT_CAUSE_REG(2) + +#define ETHERNET0_INTERRUPT_MASK_REGISTER ETH_INTERRUPT_MASK_REG(0) +#define ETHERNET1_INTERRUPT_MASK_REGISTER ETH_INTERRUPT_MASK_REG(1) +#define ETHERNET2_INTERRUPT_MASK_REGISTER ETH_INTERRUPT_MASK_REG(2) /* Ethernet GT64260 */ /* -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 38/39] GCC4.6: Squash GTREADREG related errors
interrupts.c: In function 'interrupt_init_cpu': interrupts.c:37: warning: implicit declaration of function 'GTREGREAD' interrupts.c:37: error: 'LOW_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:37: error: (Each undeclared identifier is reported only once interrupts.c:37: error: for each function it appears in.) interrupts.c:37: error: 'HIGH_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:40: error: 'ETHERNET0_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:40: error: 'ETHERNET1_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:40: error: 'ETHERNET2_INTERRUPT_CAUSE_REGISTER' undeclared (first use in this function) interrupts.c:44: error: 'ETHERNET0_INTERRUPT_MASK_REGISTER' undeclared (first use in this function) interrupts.c:44: error: 'ETHERNET1_INTERRUPT_MASK_REGISTER' undeclared (first use in this function) interrupts.c:44: error: 'ETHERNET2_INTERRUPT_MASK_REGISTER' undeclared (first use in this function) Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- include/configs/PCIPPC2.h |4 include/configs/PCIPPC6.h |4 include/configs/mpc7448hpc2.h |4 include/configs/p3mx.h|4 include/configs/ppmc7xx.h |4 5 files changed, 20 insertions(+), 0 deletions(-) diff --git a/include/configs/PCIPPC2.h b/include/configs/PCIPPC2.h index fb485b0..77cedc0 100644 --- a/include/configs/PCIPPC2.h +++ b/include/configs/PCIPPC2.h @@ -55,6 +55,10 @@ #define CONFIG_PREBOOT "" #define CONFIG_BOOTDELAY 5 +#ifndef __ASSEMBLY__ +#include +#endif + /* * BOOTP options */ diff --git a/include/configs/PCIPPC6.h b/include/configs/PCIPPC6.h index 16d6450..a8d20ca 100644 --- a/include/configs/PCIPPC6.h +++ b/include/configs/PCIPPC6.h @@ -55,6 +55,10 @@ #define CONFIG_PREBOOT "" #define CONFIG_BOOTDELAY 5 +#ifndef __ASSEMBLY__ +#include +#endif + /* * BOOTP options */ diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h index 700dcda..8a91c91 100644 --- a/include/configs/mpc7448hpc2.h +++ b/include/configs/mpc7448hpc2.h @@ -54,6 +54,10 @@ #undef CONFIG_ECC /* disable ECC support */ +#ifndef __ASSEMBLY__ +#include +#endif + /* Board-specific Initialization Functions to be called */ #define CONFIG_SYS_BOARD_ASM_INIT #define CONFIG_BOARD_EARLY_INIT_F diff --git a/include/configs/p3mx.h b/include/configs/p3mx.h index 94a6992..e44009e 100644 --- a/include/configs/p3mx.h +++ b/include/configs/p3mx.h @@ -447,4 +447,8 @@ #define L2_ENABLE (L2_INIT | L2CR_L2E) +#ifndef __ASSEMBLY__ +#include <../board/Marvell/include/core.h> +#endif + #endif /* __CONFIG_H */ diff --git a/include/configs/ppmc7xx.h b/include/configs/ppmc7xx.h index d3c8990..4ceee17 100644 --- a/include/configs/ppmc7xx.h +++ b/include/configs/ppmc7xx.h @@ -51,6 +51,10 @@ #defineCONFIG_SYS_TEXT_BASE0xFFF0 +#ifndef __ASSEMBLY__ +#include +#endif + /* * Monitor configuration * -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 37/39] RFT GCC4.6: Fix muas3001 and IDS8247
The boards suffer from the following error due to undefined configuration variables: Configuring for IDS8247 board... ether_fcc.c:75: error: 'CONFIG_SYS_CMXFCR_MASK1' undeclared here (not in a function) ether_fcc.c:76: error: 'CONFIG_SYS_CMXFCR_VALUE1' undeclared here (not in a function) Signed-off-by: Marek Vasut Cc: Heiko Schocher Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- include/configs/IDS8247.h |4 include/configs/muas3001.h |4 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/include/configs/IDS8247.h b/include/configs/IDS8247.h index 8552250..bc26bd7 100644 --- a/include/configs/IDS8247.h +++ b/include/configs/IDS8247.h @@ -147,6 +147,10 @@ #defineCONFIG_ETHER_INDEX 1 /* which SCC/FCC channel for ethernet */ #define CONFIG_ETHER_ON_FCC1 #define FCC_ENET +#define CONFIG_SYS_CMXFCR_MASK1\ + (CMXFCR_FC1 | CMXFCR_RF1CS_MSK | CMXFCR_TF1CS_MSK) +#define CONFIG_SYS_CMXFCR_VALUE1 \ + (CMXFCR_RF1CS_CLK11 | CMXFCR_TF1CS_CLK12) /* * - Rx-CLK is CLK10 diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h index 8b3022b..e21dea3 100644 --- a/include/configs/muas3001.h +++ b/include/configs/muas3001.h @@ -78,6 +78,10 @@ #define CONFIG_ETHER_ON_FCC1 #define CONFIG_HAS_ETH0 #define FCC_ENET +#define CONFIG_SYS_CMXFCR_MASK1\ + (CMXFCR_FC1 | CMXFCR_RF1CS_MSK | CMXFCR_TF1CS_MSK) +#define CONFIG_SYS_CMXFCR_VALUE1 \ + (CMXFCR_RF1CS_CLK11 | CMXFCR_TF1CS_CLK12) /* * - Rx-CLK is CLK11 -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 36/39] GCC4.6: Squash error in cpc45/pd67290.c
pd67290.c: In function 'cirrus_set_opts': pd67290.c:282: error: 'buf' undeclared (first use in this function) pd67290.c:282: error: (Each undeclared identifier is reported only once pd67290.c:282: error: for each function it appears in.) Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/cpc45/pd67290.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/board/cpc45/pd67290.c b/board/cpc45/pd67290.c index 0d8ef23..815e4ba 100644 --- a/board/cpc45/pd67290.c +++ b/board/cpc45/pd67290.c @@ -225,11 +225,7 @@ static u_int cirrus_set_opts (socket_info_t * s) { cirrus_state_t *p = &s->c_state; u_int mask = 0x; -#if DEBUG - char buf[200]; - - memset (buf, 0, 200); -#endif + char buf[200] = {0}; if (has_ring == -1) has_ring = 1; -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 35/39] GCC4.6: Squash error in pcmcia/i82365.c
i82365.c: In function 'cirrus_set_opts': i82365.c:329: error: 'buf' undeclared (first use in this function) i82365.c:329: error: (Each undeclared identifier is reported only once i82365.c:329: error: for each function it appears in.) Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/pcmcia/i82365.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 1bcb3a5..1cde83a 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -272,11 +272,7 @@ static u_int cirrus_set_opts (socket_info_t * s) { cirrus_state_t *p = &s->c_state; u_int mask = 0x; -#if DEBUG - char buf[200]; - - memset (buf, 0, 200); -#endif + char buf[200] = {0}; if (has_ring == -1) has_ring = 1; -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 34/39] GCC4.6: Squash warnings in PPChameleonEVB/flash.c
flash.c: In function 'flash_init': flash.c:54: warning: format '%08X' expects type 'unsigned int', but argument 4 has type 'struct flash_info_t *' Signed-off-by: Marek Vasut --- board/dave/PPChameleonEVB/flash.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/board/dave/PPChameleonEVB/flash.c b/board/dave/PPChameleonEVB/flash.c index 2e1a9ab..3d5b20d 100644 --- a/board/dave/PPChameleonEVB/flash.c +++ b/board/dave/PPChameleonEVB/flash.c @@ -51,7 +51,8 @@ unsigned long flash_init (void) int size_val = 0; debug("[%s, %d] Entering ...\n", __FUNCTION__, __LINE__); - debug("[%s, %d] flash_info = 0x%08X ...\n", __FUNCTION__, __LINE__, flash_info); + debug("[%s, %d] flash_info = 0x%p ...\n", __func__, __LINE__, + flash_info); /* Init: no FLASHes known */ for (i=0; ihttp://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 33/39] GCC4.6: Squash warnings in r360mpi/flash.c
flash.c: In function 'flash_get_size': flash.c:222: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'int' flash.c:238: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/r360mpi/flash.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/r360mpi/flash.c b/board/r360mpi/flash.c index 45cccf7..26ec11d 100644 --- a/board/r360mpi/flash.c +++ b/board/r360mpi/flash.c @@ -219,7 +219,7 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info) value = addr[0]; - debug ("Manuf. ID @ 0x%08lx: 0x%08lx\n", (ulong)addr, value); + debug("Manuf. ID @ 0x%08lx: 0x%08x\n", (ulong)addr, value); switch (value) { case (FPW) INTEL_MANUFACT: @@ -235,7 +235,7 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info) value = addr[1];/* device ID*/ - debug ("Device ID @ 0x%08lx: 0x%08lx\n", (ulong)(&addr[1]), value); + debug("Device ID @ 0x%08lx: 0x%08x\n", (ulong)(&addr[1]), value); switch (value) { case (FPW) INTEL_ID_28F320J3A: -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 32/39] GCC4.6: Squash warnings in mpc86xx/interrupts.c
interrupts.c: In function 'interrupt_init_cpu': interrupts.c:62: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' interrupts.c:69: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile uint *' interrupts.c:72: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile uint *' interrupts.c:75: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile uint *' interrupts.c:79: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile uint *' interrupts.c:83: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile uint *' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/mpc86xx/interrupts.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c index 14821f4..aff1f6d 100644 --- a/arch/powerpc/cpu/mpc86xx/interrupts.c +++ b/arch/powerpc/cpu/mpc86xx/interrupts.c @@ -59,28 +59,28 @@ int interrupt_init_cpu(unsigned long *decrementer_count) pic->gcr = MPC86xx_PICGCR_MODE; *decrementer_count = get_tbclk() / CONFIG_SYS_HZ; - debug("interrupt init: tbclk() = %d MHz, decrementer_count = %ld\n", + debug("interrupt init: tbclk() = %ld MHz, decrementer_count = %ld\n", (get_tbclk() / 100), *decrementer_count); #ifdef CONFIG_INTERRUPTS pic->iivpr1 = 0x810001; /* 50220 enable mcm interrupts */ - debug("iivpr1@%x = %x\n", &pic->iivpr1, pic->iivpr1); + debug("iivpr1@%p = %x\n", &pic->iivpr1, pic->iivpr1); pic->iivpr2 = 0x810002; /* 50240 enable ddr interrupts */ - debug("iivpr2@%x = %x\n", &pic->iivpr2, pic->iivpr2); + debug("iivpr2@%p = %x\n", &pic->iivpr2, pic->iivpr2); pic->iivpr3 = 0x810003; /* 50260 enable lbc interrupts */ - debug("iivpr3@%x = %x\n", &pic->iivpr3, pic->iivpr3); + debug("iivpr3@%p = %x\n", &pic->iivpr3, pic->iivpr3); #if defined(CONFIG_PCI1) || defined(CONFIG_PCIE1) pic->iivpr8 = 0x810008; /* enable pcie1 interrupts */ - debug("iivpr8@%x = %x\n", &pic->iivpr8, pic->iivpr8); + debug("iivpr8@%p = %x\n", &pic->iivpr8, pic->iivpr8); #endif #if defined(CONFIG_PCI2) || defined(CONFIG_PCIE2) pic->iivpr9 = 0x810009; /* enable pcie2 interrupts */ - debug("iivpr9@%x = %x\n", &pic->iivpr9, pic->iivpr9); + debug("iivpr9@%p = %x\n", &pic->iivpr9, pic->iivpr9); #endif pic->ctpr = 0; /* 40080 clear current task priority register */ -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 31/39] GCC4.6: Squash warnings in serial_xuartlite.c
serial_xuartlite.c: In function 'uartlite_serial_putc': serial_xuartlite.c:60: warning: initialization discards qualifiers from pointer target type serial_xuartlite.c: In function 'uartlite_serial_getc': serial_xuartlite.c:78: warning: initialization discards qualifiers from pointer target type serial_xuartlite.c: In function 'uartlite_serial_tstc': serial_xuartlite.c:87: warning: initialization discards qualifiers from pointer target type Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/serial/serial_xuartlite.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 2dc6bd1..3a38f9e 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -40,7 +40,7 @@ struct uartlite { unsigned int status; }; -static const struct uartlite *userial_ports[4] = { +static struct uartlite *userial_ports[4] = { #ifdef XILINX_UARTLITE_BASEADDR [0] = (struct uartlite *)XILINX_UARTLITE_BASEADDR, #endif -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 30/39] GCC4.6: Squash undefined variable in cmd_mtdparts.c
Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- common/cmd_mtdparts.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c index 2c2e4e0..b7c833b 100644 --- a/common/cmd_mtdparts.c +++ b/common/cmd_mtdparts.c @@ -839,9 +839,7 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_ const char *mtd_id; unsigned int mtd_id_len; const char *p; -#ifdef DEBUG const char *pend; -#endif LIST_HEAD(tmp_list); struct list_head *entry, *n; u16 num_parts; -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 29/39] GCC4.6: Squash warnings in tqm8xx_pcmcia.c
tqm8xx_pcmcia.c: In function 'power_off': tqm8xx_pcmcia.c:46: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast tqm8xx_pcmcia.c: In function 'power_on_5_0': tqm8xx_pcmcia.c:52: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast tqm8xx_pcmcia.c: In function 'power_on_3_3': tqm8xx_pcmcia.c:58: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/pcmcia/tqm8xx_pcmcia.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/pcmcia/tqm8xx_pcmcia.c b/drivers/pcmcia/tqm8xx_pcmcia.c index 859cbe0..dda7d37 100644 --- a/drivers/pcmcia/tqm8xx_pcmcia.c +++ b/drivers/pcmcia/tqm8xx_pcmcia.c @@ -43,19 +43,28 @@ static inline void power_config(int slot) {} static inline void power_off(int slot) { - out_be32(PCMCIA_CTRL, 0); + volatile unsigned __iomem *addr; + addr = (volatile unsigned __iomem *)PCMCIA_CTRL; + + out_be32(addr, 0); } static inline void power_on_5_0(int slot) { + volatile unsigned __iomem *addr; + addr = (volatile unsigned __iomem *)PCMCIA_CTRL; + /* Enable 5V Vccout */ - out_be32(PCMCIA_CTRL, 2); + out_be32(addr, 2); } static inline void power_on_3_3(int slot) { + volatile unsigned __iomem *addr; + addr = (volatile unsigned __iomem *)PCMCIA_CTRL; + /* Enable 3.3V Vccout */ - out_be32(PCMCIA_CTRL, 1); + out_be32(addr, 1); } #else -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 28/39] GCC4.6: Squash warnings in sata_sil3114.c
sata_sil3114.c: In function 'sata_identify': sata_sil3114.c:174: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'lbaint_t' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/block/sata_sil3114.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/block/sata_sil3114.c b/drivers/block/sata_sil3114.c index d43064e..1e60636 100644 --- a/drivers/block/sata_sil3114.c +++ b/drivers/block/sata_sil3114.c @@ -171,7 +171,7 @@ static void sata_identify (int num, int dev) sata_dev_desc[devno].removable = 0; sata_dev_desc[devno].lba = (u32) n_sectors; - debug ("lba=0x%x\n", sata_dev_desc[devno].lba); + debug("lba=0x%lx\n", sata_dev_desc[devno].lba); #ifdef CONFIG_LBA48 if (iobuf[83] & (1 << 10)) { -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 27/39] GCC4.6: Squash warnings in pmc405de.c
pmc405de.c: In function 'do_painit': pmc405de.c:444: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'phys_size_t' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/esd/pmc405de/pmc405de.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/board/esd/pmc405de/pmc405de.c b/board/esd/pmc405de/pmc405de.c index c266ebe..a60809a 100644 --- a/board/esd/pmc405de/pmc405de.c +++ b/board/esd/pmc405de/pmc405de.c @@ -441,7 +441,7 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ param = base - (pram << 10); printf("PARAM: @%08x\n", param); - debug("memsize=0x%08x, base=0x%08x\n", gd->bd->bi_memsize, base); + debug("memsize=0x%08x, base=0x%08x\n", (u32)gd->bd->bi_memsize, base); /* clear entire PA ram */ memset((void*)param, 0, (pram << 10)); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 26/39] GCC4.6: Squash warnings in fsl_pci_init.c
fsl_pci_init.c: In function 'fsl_pci_init': fsl_pci_init.c:308: warning: format '%08x' expects type 'unsigned int', but argument 6 has type 'long unsigned int' fsl_pci_init.c:347: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile u32 *' fsl_pci_init.c: In function 'fsl_pci_init': fsl_pci_init.c:308: warning: format '%016llx' expects type 'long long unsigned int', but argument 4 has type 'pci_addr_t' fsl_pci_init.c:308: warning: format '%016llx' expects type 'long long unsigned int', but argument 5 has type 'pci_size_t' fsl_pci_init.c:308: warning: format '%08x' expects type 'unsigned int', but argument 6 has type 'long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/pci/fsl_pci_init.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 7f601d4..bff1314 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -305,10 +305,10 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) inbound = fsl_pci_setup_inbound_windows(hose, out_lo, pcie_cap, pi); for (r = 0; r < hose->region_count; r++) - debug("PCI reg:%d %016llx:%016llx %016llx %08x\n", r, + debug("PCI reg:%d %016llx:%016llx %016llx %08lx\n", r, (u64)hose->regions[r].phys_start, - hose->regions[r].bus_start, - hose->regions[r].size, + (u64)hose->regions[r].bus_start, + (u64)hose->regions[r].size, hose->regions[r].flags); pci_register_hose(hose); @@ -344,7 +344,7 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) setbits_be32(&pci->pdb_stat, 0x0800); (void) in_be32(&pci->pdb_stat); udelay(100); - debug(" Asserting PCIe reset @%x = %x\n", + debug(" Asserting PCIe reset @%p = %x\n", &pci->pdb_stat, in_be32(&pci->pdb_stat)); /* clear PCIe reset */ clrbits_be32(&pci->pdb_stat, 0x0800); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 25/39] GCC4.6: Squash warnings in fsl_espi.c
fsl_espi.c: In function 'spi_setup_slave': fsl_espi.c:100: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' fsl_espi.c: In function 'spi_xfer': fsl_espi.c:237: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'const void *' fsl_espi.c:237: warning: format '%08x' expects type 'unsigned int', but argument 7 has type 'void *' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/spi/fsl_espi.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index f872cd8..a1ebd33 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -97,8 +97,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, pm = spibrg / (max_hz * 16 * 2); if (pm > 16) { pm = 16; - debug("Requested speed is too low: %d Hz, " - "%d Hz is used.\n", max_hz, spibrg / (32 * 16)); + debug("Requested speed is too low: %d Hz, %ld Hz " + "is used.\n", max_hz, spibrg / (32 * 16)); } } else pm = spibrg / (max_hz * 2); @@ -234,7 +234,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out, break; } - debug("spi_xfer: slave %u:%u dout %08X(%08x) din %08X(%08x) len %u\n", + debug("spi_xfer: slave %u:%u dout %08X(%p) din %08X(%p) len %u\n", slave->bus, slave->cs, *(uint *) dout, dout, *(uint *) din, din, len); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 24/39] GCC4.6: Squash warnings in ddr[123]_dimm_params.c
ddr1_dimm_params.c: In function 'compute_ranksize': ddr1_dimm_params.c:44: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long long unsigned int' ddr2_dimm_params.c: In function 'compute_ranksize': ddr2_dimm_params.c:43: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long long unsigned int' ddr3_dimm_params.c: In function 'compute_ranksize': ddr3_dimm_params.c:74: warning: format '%16lx' expects type 'long unsigned int', but argument 2 has type 'long long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c |2 +- arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c |2 +- arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c index 9184764..376be2f 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c @@ -41,7 +41,7 @@ compute_ranksize(unsigned int mem_type, unsigned char row_dens) /* Bottom 2 bits up to the top. */ bsize = ((row_dens >> 2) | ((row_dens & 3) << 6)); bsize <<= 24ULL; - debug("DDR: DDR I rank density = 0x%08x\n", bsize); + debug("DDR: DDR I rank density = 0x%16llx\n", bsize); return bsize; } diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c index b565e33..f637f3d 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c @@ -40,7 +40,7 @@ compute_ranksize(unsigned int mem_type, unsigned char row_dens) /* Bottom 5 bits up to the top. */ bsize = ((row_dens >> 5) | ((row_dens & 31) << 3)); bsize <<= 27ULL; - debug("DDR: DDR II rank density = 0x%08x\n", bsize); + debug("DDR: DDR II rank density = 0x%16llx\n", bsize); return bsize; } diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c index 838cebe..ffb503a 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c @@ -71,7 +71,7 @@ compute_ranksize(const ddr3_spd_eeprom_t *spd) bsize = 1ULL << (nbit_sdram_cap_bsize - 3 + nbit_primary_bus_width - nbit_sdram_width); - debug("DDR: DDR III rank density = 0x%16lx\n", bsize); + debug("DDR: DDR III rank density = 0x%16llx\n", bsize); return bsize; } -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 17/39] GCC4.6: Squash warnings in 44x_spd_ddr.c
44x_spd_ddr.c: In function 'program_tr0': 44x_spd_ddr.c:823: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int' 44x_spd_ddr.c: In function 'program_tr1': 44x_spd_ddr.c:1054: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int' 44x_spd_ddr.c: In function 'program_bxcr': 44x_spd_ddr.c:1127: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' 44x_spd_ddr.c:1196: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' 44x_spd_ddr.c:1196: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' 44x_spd_ddr.c:1196: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' 44x_spd_ddr.c:1196: warning: format '%d' expects type 'int', but argument 5 has type 'long unsigned int' 44x_spd_ddr.c:1242: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c index ec7291f..e05daf2 100644 --- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c +++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c @@ -820,7 +820,7 @@ static void program_tr0(unsigned long *dimm_populated, break; } - debug("tr0: %x\n", tr0); + debug("tr0: %lx\n", tr0); mtsdram(SDRAM0_TR0, tr0); } @@ -1051,7 +1051,7 @@ static void program_tr1(void) } tr1 |= SDRAM_TR1_RDCT_ENCODE(rdclt_average); - debug("tr1: %x\n", tr1); + debug("tr1: %lx\n", tr1); /* * program SDRAM Timing Register 1 TR1 @@ -1124,7 +1124,7 @@ static unsigned long program_bxcr(unsigned long *dimm_populated, num_col_addr = spd_read(iic0_dimm_addr[dimm_num], 4); num_banks= spd_read(iic0_dimm_addr[dimm_num], 5); bank_size_id = spd_read(iic0_dimm_addr[dimm_num], 31); - debug("DIMM%d: row=%d col=%d banks=%d\n", dimm_num, + debug("DIMM%ld: row=%d col=%d banks=%d\n", dimm_num, num_row_addr, num_col_addr, num_banks); /* @@ -1193,9 +1193,11 @@ static unsigned long program_bxcr(unsigned long *dimm_populated, bank_parms[ctrl_bank_num[dimm_num]+i].bank_size_bytes = (4 << 20) * bank_size_id; bank_parms[ctrl_bank_num[dimm_num]+i].cr = cr; - debug("DIMM%d-bank %d (SDRAM0_B%dCR): bank_size_bytes=%d\n", - dimm_num, i, ctrl_bank_num[dimm_num]+i, - bank_parms[ctrl_bank_num[dimm_num]+i].bank_size_bytes); + debug("DIMM%ld-bank %ld (SDRAM0_B%ldCR): " + "bank_size_bytes=%ld\n", + dimm_num, i, + ctrl_bank_num[dimm_num] + i, + bank_parms[ctrl_bank_num[dimm_num] + i].bank_size_bytes); } } } @@ -1239,7 +1241,8 @@ static unsigned long program_bxcr(unsigned long *dimm_populated, bank_parms[sorted_bank_num[bx_cr_num]].cr; mtdcr(SDRAM0_CFGDATA, temp); bank_base_addr += bank_parms[sorted_bank_num[bx_cr_num]].bank_size_bytes; - debug("SDRAM0_B%dCR=0x%08lx\n", sorted_bank_num[bx_cr_num], temp); + debug("SDRAM0_B%ldCR=0x%08lx\n", + sorted_bank_num[bx_cr_num], temp); } } -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 16/39] GCC4.6: Squash warning in jedec_flash.c
jedec_flash.c: In function 'fill_info': jedec_flash.c:393: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'ulong' jedec_flash.c:393: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'ulong' jedec_flash.c:402: warning: format '%d' expects type 'int', but argument 2 has type 'ulong' jedec_flash.c:402: warning: format '%d' expects type 'int', but argument 3 has type 'ulong' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger Cc: Scott Wood --- drivers/mtd/jedec_flash.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/jedec_flash.c b/drivers/mtd/jedec_flash.c index da8c9b1..36d30c3 100644 --- a/drivers/mtd/jedec_flash.c +++ b/drivers/mtd/jedec_flash.c @@ -390,7 +390,8 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je debug("unlock address index %d\n", uaddr_idx); info->addr_unlock1 = unlock_addrs[uaddr_idx].addr1; info->addr_unlock2 = unlock_addrs[uaddr_idx].addr2; - debug("unlock addresses are 0x%x/0x%x\n", info->addr_unlock1, info->addr_unlock2); + debug("unlock addresses are 0x%lx/0x%lx\n", + info->addr_unlock1, info->addr_unlock2); sect_cnt = 0; total_size = 0; @@ -399,7 +400,7 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je ulong erase_region_count = (jedec_entry->regions[i] & 0xff) + 1; total_size += erase_region_size * erase_region_count; - debug ("erase_region_count = %d erase_region_size = %d\n", + debug("erase_region_count = %ld erase_region_size = %ld\n", erase_region_count, erase_region_size); for (j = 0; j < erase_region_count; j++) { if (sect_cnt >= CONFIG_SYS_MAX_FLASH_SECT) { -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 10/39] GCC4.6: Squash warning in cfi_flash.c
cfi_flash.c: In function 'flash_protect_default': cfi_flash.c:2152: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong' cfi_flash.c:2152: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger Cc: Scott Wood --- drivers/mtd/cfi_flash.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index ac91dfd..5494bcf 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2149,7 +2149,7 @@ void flash_protect_default(void) #if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) { - debug("autoprotecting from %08x to %08x\n", + debug("autoprotecting from %08lx to %08lx\n", apl[i].start, apl[i].start + apl[i].size - 1); flash_protect(FLAG_PROTECT_SET, apl[i].start, -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 12/39] GCC4.6: Squash warnings in denali_spd_ddr2.c
denali_spd_ddr2.c: In function 'get_spd_info': denali_spd_ddr2.c:363: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'check_frequency': denali_spd_ddr2.c:390: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'get_dimm_size': denali_spd_ddr2.c:473: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:474: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:475: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:476: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_03': denali_spd_ddr2.c:571: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:604: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:604: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' denali_spd_ddr2.c:643: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:644: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:645: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:646: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:676: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_04': denali_spd_ddr2.c:731: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:733: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:735: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_05': denali_spd_ddr2.c:772: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:774: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_06': denali_spd_ddr2.c:831: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:833: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_11': denali_spd_ddr2.c:860: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_26': denali_spd_ddr2.c:931: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c:933: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_27': denali_spd_ddr2.c:944: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_43': denali_spd_ddr2.c:978: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_spd_ddr2.c: In function 'program_ddr0_44': denali_spd_ddr2.c:1006: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c | 52 ++-- 1 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c index c35b113..ce769a7 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c @@ -360,7 +360,7 @@ static void get_spd_info(unsigned long dimm_ranks[], printf("Install at least one DDR2 DIMM.\n\n"); spd_ddr_init_hang(); } - debug("Total number of ranks = %d\n", *ranks); + debug("Total number of ranks = %ld\n", *ranks); } /*-- @@ -387,7 +387,7 @@ static void check_frequency(unsigned long *dimm_ranks, if (dimm_ranks[dimm_num]) { cycle_time = get_tcyc(spd_read(iic0_dimm_addr[dimm_num], 9)); - debug("cycle_time=%d ps\n", cycle_time); + debug("cycle_time=%ld ps\n", cycle_time); if (cycle_time > (calc_cycle_time + 10)) { /* @@ -470,10 +470,10 @@ static void get_dimm_size(unsigned long dimm_ranks[], } } } - debug("Number of rows = %d\n", *rows); - debug("Number of c
[U-Boot] [PATCH 11/39] GCC4.6: Squash warnings in denali_data_eye.c
denali_data_eye.c: In function 'denali_core_search_data_eye':denali_spd_ddr2.c:646: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_data_eye.c:320: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'u32' denali_data_eye.c:330: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'u32' denali_spd_ddr2.c:676: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' denali_data_eye.c:340: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'u32' denali_data_eye.c:350: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'u32' denali_data_eye.c:360: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'u32' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/ppc4xx/denali_data_eye.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/cpu/ppc4xx/denali_data_eye.c b/arch/powerpc/cpu/ppc4xx/denali_data_eye.c index 9bba0ca..19b65be 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_data_eye.c +++ b/arch/powerpc/cpu/ppc4xx/denali_data_eye.c @@ -317,7 +317,7 @@ void denali_core_search_data_eye(void) val = (mfdcr(ddrcfgd) & ~DDR0_09_WR_DQS_SHIFT_MASK) | DDR0_09_WR_DQS_SHIFT_ENCODE(wr_dqs_shift); mtdcr(ddrcfgd, val); - debug("DDR0_09=0x%08lx\n", val); + debug("DDR0_09=0x%08x\n", val); /* ---+ * Set 'dqs_out_shift' = wr_dqs_shift + 32 @@ -327,7 +327,7 @@ void denali_core_search_data_eye(void) val = (mfdcr(ddrcfgd) & ~DDR0_22_DQS_OUT_SHIFT_MASK) | DDR0_22_DQS_OUT_SHIFT_ENCODE(dqs_out_shift); mtdcr(ddrcfgd, val); - debug("DDR0_22=0x%08lx\n", val); + debug("DDR0_22=0x%08x\n", val); /* ---+ * Set 'dll_dqs_delay_X'. @@ -337,7 +337,7 @@ void denali_core_search_data_eye(void) val = (mfdcr(ddrcfgd) & ~DDR0_17_DLL_DQS_DELAY_0_MASK) | DDR0_17_DLL_DQS_DELAY_0_ENCODE(dll_dqs_delay_X); mtdcr(ddrcfgd, val); - debug("DDR0_17=0x%08lx\n", val); + debug("DDR0_17=0x%08x\n", val); /* dll_dqs_delay_1 to dll_dqs_delay_4 */ mtdcr(ddrcfga, DDR0_18); @@ -347,7 +347,7 @@ void denali_core_search_data_eye(void) | DDR0_18_DLL_DQS_DELAY_2_ENCODE(dll_dqs_delay_X) | DDR0_18_DLL_DQS_DELAY_1_ENCODE(dll_dqs_delay_X); mtdcr(ddrcfgd, val); - debug("DDR0_18=0x%08lx\n", val); + debug("DDR0_18=0x%08x\n", val); /* dll_dqs_delay_5 to dll_dqs_delay_8 */ mtdcr(ddrcfga, DDR0_19); @@ -357,7 +357,7 @@ void denali_core_search_data_eye(void) | DDR0_19_DLL_DQS_DELAY_6_ENCODE(dll_dqs_delay_X) | DDR0_19_DLL_DQS_DELAY_5_ENCODE(dll_dqs_delay_X); mtdcr(ddrcfgd, val); - debug("DDR0_19=0x%08lx\n", val); + debug("DDR0_19=0x%08x\n", val); /* ---+ * Assert 'start' parameter. -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 23/39] GCC4.6: Use dst instead of l2srbar in cpu_early_init.c
cpu_init_early.c: In function 'cpu_init_early_f': cpu_init_early.c:74: warning: 'l2srbar' may be used uninitialized in this function Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/mpc85xx/cpu_init_early.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c index 4ef3c9a..091af7c 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c @@ -71,7 +71,7 @@ void cpu_init_early_f(void) #endif #if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399) && !defined(CONFIG_SYS_RAMBOOT) ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR; - u32 *l2srbar, *dst, *src; + u32 *dst, *src; void (*setup_ifc_sram)(void); #endif @@ -137,7 +137,7 @@ void cpu_init_early_f(void) dst = (u32 *) SRAM_BASE_ADDR; src = (u32 *) setup_ifc; for (i = 0; i < 1024; i++) - *l2srbar++ = *src++; + *dst++ = *src++; setup_ifc_sram(); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 18/39] GCC4.6: Squash warnings in 4xx_enet.c
4xx_enet.c: In function 'ppc_4xx_eth_init': 4xx_enet.c:1352: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'volatile struct mal_desc_t *' 4xx_enet.c:1352: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'volatile struct mal_desc_t *' 4xx_enet.c:1365: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int' 4xx_enet.c:1376: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/net/4xx_enet.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 9ab5c80..8013ad9 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -1349,7 +1349,7 @@ get_speed: hw_p->rx_phys = bd_cached + MAL_TX_DESC_SIZE; hw_p->tx = (mal_desc_t *)(bd_uncached); hw_p->rx = (mal_desc_t *)(bd_uncached + MAL_TX_DESC_SIZE); - debug("hw_p->tx=%08x, hw_p->rx=%08x\n", hw_p->tx, hw_p->rx); + debug("hw_p->tx=%p, hw_p->rx=%p\n", hw_p->tx, hw_p->rx); } for (i = 0; i < NUM_TX_BUFF; i++) { @@ -1362,7 +1362,7 @@ get_speed: if ((NUM_TX_BUFF - 1) == i) hw_p->tx[i].ctrl |= MAL_TX_CTRL_WRAP; hw_p->tx_run[i] = -1; - debug("TX_BUFF %d @ 0x%08lx\n", i, (u32)hw_p->tx[i].data_ptr); + debug("TX_BUFF %d @ 0x%08x\n", i, (u32)hw_p->tx[i].data_ptr); } for (i = 0; i < NUM_RX_BUFF; i++) { @@ -1373,7 +1373,7 @@ get_speed: hw_p->rx[i].ctrl |= MAL_RX_CTRL_WRAP; hw_p->rx[i].ctrl |= MAL_RX_CTRL_EMPTY | MAL_RX_CTRL_INTR; hw_p->rx_ready[i] = -1; - debug("RX_BUFF %d @ 0x%08lx\n", i, (u32)hw_p->rx[i].data_ptr); + debug("RX_BUFF %d @ 0x%08x\n", i, (u32)hw_p->rx[i].data_ptr); } reg = 0x; -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 20/39] GCC4.6: Squash warnings in 4xx_pcie.c
4xx_pcie.c: In function 'pcie_read_config': 4xx_pcie.c:268: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'volatile unsigned char *' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/ppc4xx/4xx_pcie.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/cpu/ppc4xx/4xx_pcie.c b/arch/powerpc/cpu/ppc4xx/4xx_pcie.c index b76890e..a87e93b 100644 --- a/arch/powerpc/cpu/ppc4xx/4xx_pcie.c +++ b/arch/powerpc/cpu/ppc4xx/4xx_pcie.c @@ -265,7 +265,8 @@ static int pcie_read_config(struct pci_controller *hose, unsigned int devfn, */ pcie_dmer_disable (); - debug("%s: cfg_data=%08x offset=%08x\n", __func__, hose->cfg_data, offset); + debug("%s: cfg_data=%p offset=%08x\n", __func__, + hose->cfg_data, offset); switch (len) { case 1: *val = in_8(hose->cfg_data + offset); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 22/39] GCC4.6: Squash warning in cmd_pmc440.c
cmd_pmc440.c: In function 'do_painit': cmd_pmc440.c:371: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'phys_size_t' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/esd/pmc440/cmd_pmc440.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c index 200d7ee..0202876 100644 --- a/board/esd/pmc440/cmd_pmc440.c +++ b/board/esd/pmc440/cmd_pmc440.c @@ -368,7 +368,7 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ param = base - (pram << 10); printf("PARAM: @%08x\n", param); - debug("memsize=0x%08x, base=0x%08x\n", gd->bd->bi_memsize, base); + debug("memsize=0x%08x, base=0x%08x\n", (u32)gd->bd->bi_memsize, base); /* clear entire PA ram */ memset((void*)param, 0, (pram << 10)); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 21/39] GCC4.6: Squash warnings in ahci.c
ahci.c: In function 'ahci_port_start': ahci.c:401: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct ahci_cmd_hdr *' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/block/ahci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c index 64f52bb..015b341 100644 --- a/drivers/block/ahci.c +++ b/drivers/block/ahci.c @@ -398,7 +398,7 @@ static int ahci_port_start(u8 port) * 32 bytes each in size */ pp->cmd_slot = (struct ahci_cmd_hdr *)mem; - debug("cmd_slot = 0x%x\n", pp->cmd_slot); + debug("cmd_slot = %p\n", pp->cmd_slot); mem += (AHCI_CMD_SLOT_SZ + 224); /* -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 19/39] GCC4.6: Squash warnings in 4xx_ibm_ddr2_autocalib.c
4xx_ibm_ddr2_autocalib.c: In function 'DQS_calibration_methodB': 4xx_ibm_ddr2_autocalib.c:910: warning: format '%08X' expects type 'unsigned int', but argument 2 has type 'ulong' 4xx_ibm_ddr2_autocalib.c:911: warning: format '%08X' expects type 'unsigned int', but argument 2 has type 'ulong' 4xx_ibm_ddr2_autocalib.c: In function 'DQS_autocalibration': 4xx_ibm_ddr2_autocalib.c:1217: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong' 4xx_ibm_ddr2_autocalib.c:1230: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong' Signed-off-by: Marek Vasut --- arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c index b909fca..4b8e65a 100644 --- a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c +++ b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c @@ -907,8 +907,8 @@ static u32 DQS_calibration_methodB(struct ddrautocal *cal) mtsdram(SDRAM_RQDC, rqdc_reg); mtsdram(SDRAM_RFDC, rfdc_reg); - debug("RQDC: 0x%08X\n", rqdc_reg); - debug("RFDC: 0x%08X\n", rfdc_reg); + debug("RQDC: 0x%08lX\n", rqdc_reg); + debug("RFDC: 0x%08lX\n", rfdc_reg); /* if something passed, then return the size of the largest window */ if (passed != 0) { @@ -1214,7 +1214,7 @@ u32 DQS_autocalibration(void) SDRAM_RQDC_RQFD_ENCODE(tcal.autocal.rqfd)); mfsdram(SDRAM_RQDC, rqdc_reg); - debug("*** best_result: read value SDRAM_RQDC 0x%08x\n", + debug("*** best_result: read value SDRAM_RQDC 0x%08lx\n", rqdc_reg); #if defined(CONFIG_DDR_RFDC_FIXED) @@ -1227,7 +1227,7 @@ u32 DQS_autocalibration(void) #endif /* CONFIG_DDR_RFDC_FIXED */ mfsdram(SDRAM_RFDC, rfdc_reg); - debug("*** best_result: read value SDRAM_RFDC 0x%08x\n", + debug("*** best_result: read value SDRAM_RFDC 0x%08lx\n", rfdc_reg); mfsdram(SDRAM_RDCC, val); debug("*** SDRAM_RDCC 0x%08x\n", val); -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 13/39] GCC4.6: Squash warnings in diu.c
diu.c: In function 'diu_set_pixel_clock': diu.c:77: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'u32' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/freescale/p1022ds/diu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/board/freescale/p1022ds/diu.c b/board/freescale/p1022ds/diu.c index cef81ce..d5428ea 100644 --- a/board/freescale/p1022ds/diu.c +++ b/board/freescale/p1022ds/diu.c @@ -74,7 +74,7 @@ void diu_set_pixel_clock(unsigned int pixclock) temp = 10 / pixclock; temp *= 1000; pixval = speed_ccb / temp; - debug("DIU pixval = %lu\n", pixval); + debug("DIU pixval = %u\n", pixval); /* Modify PXCLK in GUTS CLKDVDR */ temp = in_be32(&gur->clkdvdr) & 0x2000; -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 15/39] GCC4.6: Squash warnings in tqm834x.c
tqm834x.c: In function 'initdram': tqm834x.c:126: warning: format '%d' expects type 'int', but argument 3 has type 'long int' tqm834x.c: In function 'set_cs_bounds': tqm834x.c:336: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long int' tqm834x.c:336: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int' tqm834x.c: In function 'set_cs_config': tqm834x.c:354: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/tqc/tqm834x/tqm834x.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index 260e392..7af8b4c 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -123,7 +123,7 @@ phys_size_t initdram (int board_type) (long *)(CONFIG_SYS_DDR_BASE + size)); size += bank_size; - debug("DDR Bank%d size: %d MiB\n\n", cs, bank_size >> 20); + debug("DDR Bank%d size: %ld MiB\n\n", cs, bank_size >> 20); /* exit if less than one bank */ if(size < DDR_MAX_SIZE_PER_CS) break; @@ -333,7 +333,7 @@ static long int get_ddr_bank_size(short cs, long *base) */ static void set_cs_bounds(short cs, long base, long size) { - debug("Setting bounds %08x, %08x for cs %d\n", base, size, cs); + debug("Setting bounds %08lx, %08lx for cs %d\n", base, size, cs); if(size == 0){ im->ddr.csbnds[cs].csbnds = 0x; } else { @@ -351,7 +351,7 @@ static void set_cs_bounds(short cs, long base, long size) */ static void set_cs_config(short cs, long config) { - debug("Setting config %08x for cs %d\n", config, cs); + debug("Setting config %08lx for cs %d\n", config, cs); im->ddr.cs_config[cs] = config; SYNC; } -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 14/39] GCC4.6: Squash warnings in mpc8610hpcd.c
mpc8610hpcd.c: In function 'misc_init_r': mpc8610hpcd.c:79: warning: format '%02lx' expects type 'long unsigned int', but argument 2 has type 'int' mpc8610hpcd.c:86: warning: format '%02lx' expects type 'long unsigned int', but argument 2 has type 'int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/freescale/mpc8610hpcd/mpc8610hpcd.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index 1854e27..5b3b560 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -76,14 +76,14 @@ int misc_init_r(void) /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x08, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n",tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); tmp_val = 0x10; i2c_write(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n",tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); return 0; } -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 09/39] GCC4.6: Squash warning in cfb_console.c
cfb_console.c: In function 'video_display_bitmap': cfb_console.c:1148: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' cfb_console.c:1148: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- drivers/video/cfb_console.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 3a93b64..f590250 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1145,7 +1145,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y) colors = le32_to_cpu(bmp->header.colors_used); compression = le32_to_cpu(bmp->header.compression); - debug("Display-bmp: %d x %d with %d colors\n", + debug("Display-bmp: %ld x %ld with %d colors\n", width, height, colors); if (compression != BMP_BI_RGB -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 07/39] PowerPC: Squash warning in mpc512x serial.c
serial.c: In function 'serial_setbrg_dev': serial.c:143: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- arch/powerpc/cpu/mpc512x/serial.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/cpu/mpc512x/serial.c b/arch/powerpc/cpu/mpc512x/serial.c index 5ee9cef..7c53346 100644 --- a/arch/powerpc/cpu/mpc512x/serial.c +++ b/arch/powerpc/cpu/mpc512x/serial.c @@ -140,7 +140,7 @@ void serial_setbrg_dev(unsigned int idx) if (br_env) baudrate = simple_strtoul(br_env, NULL, 10); - debug("%s: idx %d, baudrate %d\n", __func__, idx, baudrate); + debug("%s: idx %d, baudrate %ld\n", __func__, idx, baudrate); } /* calculate divisor for setting PSC CTUR and CTLR registers */ -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 08/39] GCC4.6: Squash warning in mpc5121ads.c
mpc5121ads.c: In function 'misc_init_r': mpc5121ads.c:256: warning: format '%02lx' expects type 'long unsigned int', but argument 2 has type 'int' mpc5121ads.c:263: warning: format '%02lx' expects type 'long unsigned int', but argument 2 has type 'int' Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- board/freescale/mpc5121ads/mpc5121ads.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c index b356a47..97eeab3 100644 --- a/board/freescale/mpc5121ads/mpc5121ads.c +++ b/board/freescale/mpc5121ads/mpc5121ads.c @@ -253,14 +253,14 @@ int misc_init_r(void) /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x08, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n", tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); tmp_val = 0x10; i2c_write(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n", tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); return 0; } -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 03/39] GCC4.6: Squash warning in cmd_ide.c
cmd_ide.c: In function ‘ide_read’: cmd_ide.c:1227:2: warning: format ‘%LX’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘lbaint_t’ [-Wformat] Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- common/cmd_ide.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/common/cmd_ide.c b/common/cmd_ide.c index da5189c..74e6504 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -1224,7 +1224,7 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer) lba48 = 1; } #endif - debug ("ide_read dev %d start %LX, blocks %lX buffer at %lX\n", + debug("ide_read dev %d start %lX, blocks %lX buffer at %lX\n", device, blknr, blkcnt, (ulong)buffer); ide_led (DEVICE_LED(device), 1);/* LED on */ -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 04/39] GCC4.6: Squash warning in cmd_date.c
cmd_date.c: In function ‘do_date’: cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used [-Wunused-but-set-variable] Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- include/i2c.h | 32 +++- 1 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/i2c.h b/include/i2c.h index 8ceb4c8..ee31034 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -46,16 +46,16 @@ */ #define I2C_RXTX_LEN 128 /* maximum tx/rx buffer length */ -#if defined(CONFIG_I2C_MULTI_BUS) -#if !defined(CONFIG_SYS_MAX_I2C_BUS) -#define CONFIG_SYS_MAX_I2C_BUS 2 -#endif -#define I2C_GET_BUS() i2c_get_bus_num() -#define I2C_SET_BUS(a) i2c_set_bus_num(a) +#ifdef CONFIG_I2C_MULTI_BUS +#defineMAX_I2C_BUS 2 +#defineI2C_MULTI_BUS 1 #else -#define CONFIG_SYS_MAX_I2C_BUS 1 -#define I2C_GET_BUS() 0 -#define I2C_SET_BUS(a) +#defineMAX_I2C_BUS 1 +#defineI2C_MULTI_BUS 0 +#endif + +#if !defined(CONFIG_SYS_MAX_I2C_BUS) +#define CONFIG_SYS_MAX_I2C_BUS MAX_I2C_BUS #endif /* define the I2C bus number for RTC and DTT if not already done */ @@ -236,4 +236,18 @@ int i2c_set_bus_speed(unsigned int); unsigned int i2c_get_bus_speed(void); +/* NOTE: These two functions MUST be always_inline to avoid code growth! */ +static inline unsigned int I2C_GET_BUS(void) __attribute__((always_inline)); +static inline unsigned int I2C_GET_BUS(void) +{ + return I2C_MULTI_BUS ? i2c_get_bus_num() : 0; +} + +static inline void I2C_SET_BUS(unsigned int bus) __attribute__((always_inline)); +static inline void I2C_SET_BUS(unsigned int bus) +{ + if (I2C_MULTI_BUS) + i2c_set_bus_num(bus); +} + #endif /* _I2C_H_ */ -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 06/39] GCC4.6: Squash subsequent warnings in usb_storage.c
usb_storage.c: In function ‘us_one_transfer’: usb_storage.c:377:7: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat] usb_storage.c:389:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat] usb_storage.c:394:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat] usb_storage.c: In function ‘usb_stor_BBB_reset’: usb_storage.c:442:2: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c:448:2: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c:454:2: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c: In function ‘usb_stor_CB_reset’: usb_storage.c:482:2: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c: In function ‘usb_stor_CB_comdat’: usb_storage.c:572:3: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c:584:4: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c: In function ‘usb_stor_BBB_transport’: usb_storage.c:782:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c: In function ‘usb_stor_CB_transport’: usb_storage.c:807:2: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat] usb_storage.c:830:3: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat] usb_storage.c:857:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat] Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger Cc: Remy Bohmer --- common/usb_storage.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) NOTE: Checkpatch issue here would need much deeper rework of the usb_storage.c, please bear with it. Remy, can you take care of this please? ;-) diff --git a/common/usb_storage.c b/common/usb_storage.c index eb9a30e..d665a87 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -373,7 +373,7 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length) usb_clear_halt(us->pusb_dev, pipe); us->pusb_dev->status = stat; if (this_xfer == partial) { - USB_STOR_PRINTF("bulk transferred with error %X, but data ok\n", us->pusb_dev->status); + USB_STOR_PRINTF("bulk transferred with error %lX, but data ok\n", us->pusb_dev->status); return 0; } else @@ -385,12 +385,12 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length) } USB_STOR_PRINTF("bulk transferred with error"); if (this_xfer == partial) { - USB_STOR_PRINTF(" %d, but data ok\n", + USB_STOR_PRINTF(" %ld, but data ok\n", us->pusb_dev->status); return 0; } /* if our try counter reaches 0, bail out */ - USB_STOR_PRINTF(" %d, data %d\n", + USB_STOR_PRINTF(" %ld, data %d\n", us->pusb_dev->status, partial); if (!maxtry--) return result; @@ -438,19 +438,19 @@ static int usb_stor_BBB_reset(struct us_data *us) /* long wait for reset */ wait_ms(150); - USB_STOR_PRINTF("BBB_reset result %d: status %X reset\n", result, + USB_STOR_PRINTF("BBB_reset result %d: status %lX reset\n", result, us->pusb_dev->status); pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in); result = usb_clear_halt(us->pusb_dev, pipe); /* long wait for reset */ wait_ms(150); - USB_STOR_PRINTF("BBB_reset result %d: status %X clearing IN endpoint\n", + USB_STOR_PRINTF("BBB_reset result %d: status %lX clearing IN endpoint\n", result,
[U-Boot] [PATCH 01/39] DEBUG: Fix debug macros
The current implementation of debug doesn't play well with GCC4.6. This implementation also fixes GCC4.6 complaints about unused variables while maintaining code size. Signed-off-by: Mike Frysinger Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass --- include/common.h | 20 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/common.h b/include/common.h index eb19a44..c3b23551 100644 --- a/include/common.h +++ b/include/common.h @@ -116,20 +116,24 @@ typedef volatile unsigned charvu_char; #include #include -#ifdef DEBUG -#define debug(fmt,args...) printf (fmt ,##args) -#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); -#else -#define debug(fmt,args...) -#define debugX(level,fmt,args...) -#endif /* DEBUG */ - #ifdef DEBUG # define _DEBUG 1 #else # define _DEBUG 0 #endif +#define debug_cond(cond, fmt, args...) \ + do {\ + if (cond) \ + printf(fmt, ##args);\ + } while (0) + +#define debug(fmt, args...)\ + debug_cond(_DEBUG, fmt, ##args) + +#define debugX(level, fmt, args...)\ + debug_cond((_DEBUG && DEBUG >= (level)), fmt, ##args) + /* * An assertion is run-time check done in debug mode only. If DEBUG is not * defined then it is skipped. If DEBUG is defined and the assertion fails, -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 05/39] GCC4.6: Squash warning in usb_storage.c
usb_storage.c: In function ‘usb_stor_CB_reset’: usb_storage.c:466:6: warning: variable ‘result’ set but not used [-Wunused-but-set-variable] Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- common/usb_storage.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index 16667f3..eb9a30e 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -56,16 +56,17 @@ #include #include -#undef USB_STOR_DEBUG #undef BBB_COMDAT_TRACE #undef BBB_XPORT_TRACE #ifdef USB_STOR_DEBUG -#define USB_STOR_PRINTF(fmt, args...) printf(fmt , ##args) +#define USB_BLK_DEBUG 1 #else -#define USB_STOR_PRINTF(fmt, args...) +#defineUSB_BLK_DEBUG 0 #endif +#define USB_STOR_PRINTF(fmt, args...) debug_cond(USB_BLK_DEBUG, fmt, ##args) + #include /* direction table -- this indicates the direction of the data * transfer for each command code -- a 1 indicates input -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC] [PATCH 00/39] Rework of the debug() macro
This patch series reworks the debug() and debugX() macro in include/common.h to be compatible with GCC 4.6. This series needs further discussion: * Some files suffer size growth with gcc4.2, why ? - Possibility is that the GCC4.2 is incapable to optimize code out so deep * Does this change break any platforms? Compile tested on PowerPC. - Please run MAKEALL on your platforms to test this. Marek Vasut (39): DEBUG: Fix debug macros GCC4.6: Squash warnings in common/usb.c GCC4.6: Squash warning in cmd_ide.c GCC4.6: Squash warning in cmd_date.c GCC4.6: Squash warning in usb_storage.c GCC4.6: Squash subsequent warnings in usb_storage.c PowerPC: Squash warning in mpc512x serial.c GCC4.6: Squash warning in mpc5121ads.c GCC4.6: Squash warning in cfb_console.c GCC4.6: Squash warning in cfi_flash.c GCC4.6: Squash warnings in denali_data_eye.c GCC4.6: Squash warnings in denali_spd_ddr2.c GCC4.6: Squash warnings in diu.c GCC4.6: Squash warnings in mpc8610hpcd.c GCC4.6: Squash warnings in tqm834x.c GCC4.6: Squash warning in jedec_flash.c GCC4.6: Squash warnings in 44x_spd_ddr.c GCC4.6: Squash warnings in 4xx_enet.c GCC4.6: Squash warnings in 4xx_ibm_ddr2_autocalib.c GCC4.6: Squash warnings in 4xx_pcie.c GCC4.6: Squash warnings in ahci.c GCC4.6: Squash warning in cmd_pmc440.c GCC4.6: Use dst instead of l2srbar in cpu_early_init.c GCC4.6: Squash warnings in ddr[123]_dimm_params.c GCC4.6: Squash warnings in fsl_espi.c GCC4.6: Squash warnings in fsl_pci_init.c GCC4.6: Squash warnings in pmc405de.c GCC4.6: Squash warnings in sata_sil3114.c GCC4.6: Squash warnings in tqm8xx_pcmcia.c GCC4.6: Squash undefined variable in cmd_mtdparts.c GCC4.6: Squash warnings in serial_xuartlite.c GCC4.6: Squash warnings in mpc86xx/interrupts.c GCC4.6: Squash warnings in r360mpi/flash.c GCC4.6: Squash warnings in PPChameleonEVB/flash.c GCC4.6: Squash error in pcmcia/i82365.c GCC4.6: Squash error in cpc45/pd67290.c RFT GCC4.6: Fix muas3001 and IDS8247 GCC4.6: Squash GTREADREG related errors GCC4.6: Add macros to mv_gen_reg.h arch/powerpc/cpu/mpc512x/serial.c|2 +- arch/powerpc/cpu/mpc85xx/cpu_init_early.c|4 +- arch/powerpc/cpu/mpc86xx/interrupts.c| 12 +++--- arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c |2 +- arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c |2 +- arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |2 +- arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c| 17 --- arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c |8 ++-- arch/powerpc/cpu/ppc4xx/4xx_pcie.c |3 +- arch/powerpc/cpu/ppc4xx/denali_data_eye.c| 10 ++-- arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c| 52 +++--- board/Marvell/include/mv_gen_reg.h |8 +++ board/cpc45/pd67290.c|6 +-- board/dave/PPChameleonEVB/flash.c|3 +- board/esd/pmc405de/pmc405de.c|2 +- board/esd/pmc440/cmd_pmc440.c|2 +- board/freescale/mpc5121ads/mpc5121ads.c |4 +- board/freescale/mpc8610hpcd/mpc8610hpcd.c|4 +- board/freescale/p1022ds/diu.c|2 +- board/r360mpi/flash.c|4 +- board/tqc/tqm834x/tqm834x.c |6 +- common/cmd_ide.c |2 +- common/cmd_mtdparts.c|2 - common/usb.c | 21 +++-- common/usb_storage.c | 33 +++--- drivers/block/ahci.c |2 +- drivers/block/sata_sil3114.c |2 +- drivers/mtd/cfi_flash.c |2 +- drivers/mtd/jedec_flash.c|5 +- drivers/net/4xx_enet.c |6 +- drivers/pci/fsl_pci_init.c |8 ++-- drivers/pcmcia/i82365.c |6 +-- drivers/pcmcia/tqm8xx_pcmcia.c | 15 +- drivers/serial/serial_xuartlite.c|2 +- drivers/spi/fsl_espi.c |6 +- drivers/video/cfb_console.c |2 +- include/common.h | 20 +--- include/configs/IDS8247.h|4 ++ include/configs/PCIPPC2.h|4 ++ include/configs/PCIPPC6.h|4 ++ include/configs/mpc7448hpc2.h|4 ++ include/configs/muas3001.h |4 ++ include/configs/p3mx.h |4 ++ include/configs/ppmc7xx.h|4 ++ include/i2c.h| 32 ++ 45 files changed, 201 insertions(+), 148 deletions(-) Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger -
[U-Boot] [PATCH 02/39] GCC4.6: Squash warnings in common/usb.c
usb.c: In function ‘usb_parse_config’: usb.c:331:17: warning: variable ‘ch’ set but not used [-Wunused-but-set-variable] usb.c: In function ‘usb_hub_port_connect_change’: usb.c:1123:29: warning: variable ‘portchange’ set but not used [-Wunused-but-set-variable] usb.c: In function ‘usb_hub_configure’: usb.c:1183:25: warning: variable ‘hubsts’ set but not used [-Wunused-but-set-variable] Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- common/usb.c | 21 +++-- 1 files changed, 7 insertions(+), 14 deletions(-) diff --git a/common/usb.c b/common/usb.c index 2cd50db..bed5116 100644 --- a/common/usb.c +++ b/common/usb.c @@ -56,16 +56,16 @@ #endif #ifdef DEBUG -#define USB_DEBUG -#define USB_HUB_DEBUG -#endif - -#ifdef USB_DEBUG -#defineUSB_PRINTF(fmt, args...)printf(fmt , ##args) +#define USB_DEBUG 1 +#define USB_HUB_DEBUG 1 #else -#define USB_PRINTF(fmt, args...) +#define USB_DEBUG 0 +#define USB_HUB_DEBUG 0 #endif +#define USB_PRINTF(fmt, args...) debug_cond(USB_DEBUG, fmt, ##args) +#define USB_HUB_PRINTF(fmt, args...) debug_cond(USB_HUB_DEBUG, fmt, ##args) + #define USB_BUFSIZ 512 static struct usb_device usb_dev[USB_MAX_DEVICE]; @@ -968,13 +968,6 @@ void usb_scan_devices(void) * Probes device for being a hub and configurate it */ -#ifdef USB_HUB_DEBUG -#defineUSB_HUB_PRINTF(fmt, args...)printf(fmt , ##args) -#else -#define USB_HUB_PRINTF(fmt, args...) -#endif - - static struct usb_hub_device hub_dev[USB_MAX_HUB]; static int usb_hub_index; -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
On Fri, Oct 21, 2011 at 4:45 PM, Marek Vasut wrote: > On Saturday, October 22, 2011 01:08:43 AM Albert ARIBAUD wrote: >> Le 22/10/2011 00:46, Marek Vasut a écrit : >> > On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: >> >> Le 22/10/2011 00:00, Marek Vasut a écrit : >> >>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: >> Hi Marek, >> >> Le 21/10/2011 22:44, Marek Vasut a écrit : >> > On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: >> >> This allows the SPL to avoid compiling in the CPU support code. >> >> >> >> Signed-off-by: Marek Vasut >> >> Cc: Stefano Babic >> >> Cc: Wolfgang Denk >> >> Cc: Detlev Zundel >> >> Cc: Scott Wood >> >> --- >> >> >> >> arch/arm/cpu/arm926ejs/Makefile | 7 +++ >> >> 1 files changed, 7 insertions(+), 0 deletions(-) >> >> >> >> diff --git a/arch/arm/cpu/arm926ejs/Makefile >> >> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 >> >> --- a/arch/arm/cpu/arm926ejs/Makefile >> >> +++ b/arch/arm/cpu/arm926ejs/Makefile >> >> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o >> >> >> >> START = start.o >> >> COBJS = cpu.o >> >> >> >> +ifdef CONFIG_SPL_BUILD >> >> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE >> >> +START := >> >> +COBJS := >> >> +endif >> >> +endif >> >> + >> >> >> >> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) >> >> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) >> >> START := $(addprefix $(obj),$(START)) >> > >> > Hi Albert, >> > >> > can we get this applied please? >> >> I still don't understand what this is supposed to do -- why not >> linking this code is required. >> >> Amicalement, >> >>> >> >>> Hi Albert, >> >>> >> >>> I use very different start.S in SPL. And I don't need cpu.o at all. >> >> >> >> That I understand; but is there a /problem/ in linking cpu.o in? >> > >> > I suppose it'll be optimized out at link time ? >> >> That indirectly answers my question: what you want to achieve is >> removing dead code. > > The code IS USED in U-Boot, but IS NOT USED in SPL ! Right, but linked and unused code in SPL is (or should be!) thrown away, is what's trying to be driven home right now. If the file is going to go away, and it's compiled thrown away at final link of SPL, lets just ignore that it exists for a little longer, and then it won't. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/5 v1] integrator: do not test first part of the memory
Le 17/10/2011 13:57, Linus Walleij a écrit : > Hi Arnaud, > > On Sun, Oct 16, 2011 at 5:51 PM, Albert ARIBAUD > wrote: >> Le 18/09/2011 09:52, Linus Walleij a écrit : >>> >>> When booting from Flash, the Integrator remaps its flash memory >>> from 0x2400 to 0x, and starts executing it at >>> 0x. This ROM thus hides the RAM underneath and first >>> 0x4 bytes of the memory cannot be tested by get_ram_size(). >>> So let's test from 0x4 to the end of detected memory >>> instead. >> >> Is this masking of RAM by FLASH a hardware thing that cannot be avoided? >> Can't the U-Boot startup code somehow remap the FLASH elsewhere, and then >> proceed to really test the whole RAM? > > Well, it is unmapped in board_init() but that is post-RAM-test. > > The reason I cannot unmapp it in dram_init() is that at this point > U-Boot is running from flash and has not relocated itself (it wants to test > RAM before relocating of course) and the flash it is running from is > exactly that which is in the way of the RAM test. > > So on integrator, the flash memory remaps itself to address 0x > when booting from flash, and U-Boot has text base 0x in > this case, and is running in flash relative 0x. > > If it would remap the flash at this point it would unmap itself, > and crash. > > This way of having the flash containing U-Boot remap itself over the > system RAM seems to be uncommon, but I'd share the problem with > anyone else trying to do something similar I guess. There is a technique for remapping running code memory, which relies on the mapping controller being able to map the same device twice: usually you start with one window already defined for the boot device, then you create another window where you want the device to end up, then you jump to that new address, then at that new address you can unmap the original window. I sort of did that for orion5x, for a slightly different reason -- see orion5x_config_adr_windows() in cpu.c. Otherwise, I don't suppose there is static RAM that the FLASH code could use as a pivot? If there was, you could boot from flash @ 'bad' location, copy a flash-remapping routine into SRAM, jump to it, once remapped, the routine jumps to flash@ 'good' location and then you can test the whole RAM. > Yours, > Linus Walleij Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
On Saturday, October 22, 2011 01:08:43 AM Albert ARIBAUD wrote: > Le 22/10/2011 00:46, Marek Vasut a écrit : > > On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: > >> Le 22/10/2011 00:00, Marek Vasut a écrit : > >>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: > Hi Marek, > > Le 21/10/2011 22:44, Marek Vasut a écrit : > > On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: > >> This allows the SPL to avoid compiling in the CPU support code. > >> > >> Signed-off-by: Marek Vasut > >> Cc: Stefano Babic > >> Cc: Wolfgang Denk > >> Cc: Detlev Zundel > >> Cc: Scott Wood > >> --- > >> > >> arch/arm/cpu/arm926ejs/Makefile |7 +++ > >> 1 files changed, 7 insertions(+), 0 deletions(-) > >> > >> diff --git a/arch/arm/cpu/arm926ejs/Makefile > >> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 > >> --- a/arch/arm/cpu/arm926ejs/Makefile > >> +++ b/arch/arm/cpu/arm926ejs/Makefile > >> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o > >> > >> START = start.o > >> COBJS = cpu.o > >> > >> +ifdef CONFIG_SPL_BUILD > >> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE > >> +START := > >> +COBJS := > >> +endif > >> +endif > >> + > >> > >> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) > >> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) > >> START := $(addprefix $(obj),$(START)) > > > > Hi Albert, > > > > can we get this applied please? > > I still don't understand what this is supposed to do -- why not > linking this code is required. > > Amicalement, > >>> > >>> Hi Albert, > >>> > >>> I use very different start.S in SPL. And I don't need cpu.o at all. > >> > >> That I understand; but is there a /problem/ in linking cpu.o in? > > > > I suppose it'll be optimized out at link time ? > > That indirectly answers my question: what you want to achieve is > removing dead code. The code IS USED in U-Boot, but IS NOT USED in SPL ! > > Now, about your question, you can check this if you build the board you > intend to apply this to, and do an objdump of the generated SPL: you'll > see if the cpu.o functions are present or not. > > (my point being that if cpu.o is to disappear because its functions are > either useless or should move elsewhere, then the interest of a patch > making cpu.o optional is short-lived.) I just prodded Hong about his cache patches. > > > Cheers > > Amicalement, ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support
Hi Vladimir, Le 18/10/2011 17:55, Vladimir Zapolskiy a écrit : > This change adds initial support for NXP LPC32x0 SoC series. > > Signed-off-by: Vladimir Zapolskiy > --- > Changes from v2 to v3: > * checkpatch.pl reports zero errors and warnings > > Changes from v1 to v2: > * BIT(n) and SBF(s, v) macro are not used anymore > * removed NS16550 and 14-clock UART definitions from uart.h > * added devices.c file, which contains standard UART preinitialization routine > * added get_serial_clock() function, it returns actual frequency of UART clock > * __udelay() realization is simplified, no need of interrupt handling As it stands, this is dead code until some board uses it; I imagine you have board waiting for this support. Can you submit the SoC and board code as a patch set? This way, it will be obvious for all that the SoC code in this patch has actual use. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] Small refactor to remove duplicate serial code
Dear Simon Glass, In message you wrote: > > I really should update some patches in patchwork, as that might be > causing you some difficulty. But I have lost my password. Do you know > of any way to recover it? Send email to JK and ask him to change / reset it. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de He had been eight years upon a project for extracting sunbeams out of cucumbers, which were to be put in vials hermetically sealed, and let out to warm the air in raw inclement summers.- Jonathan Swift _Gulliver's Travels_ ``A Voyage to Laputa, etc.'' ch. 5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] hwmon: Provide dtt_init()
Dear Dirk Eibach, In message <1318584192-3472-1-git-send-email-eib...@gdsys.de> you wrote: > Our boards rely on dtt for initialization of fan hardware. > dtt_init() was implemented to be called form board specific code. > > Signed-off-by: Dirk Eibach > --- > common/cmd_dtt.c | 42 +- > include/dtt.h|1 + > 2 files changed, 34 insertions(+), 9 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Die Freiheit des Menschen liegt nicht darin, dass er tun kann, was er will, sondern darin, dass er nicht tun muss, was er nicht will. -- Jean-Jacques Rousseau ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] common: cosmetic: CONFIG_BOOTFILE checkpatch compliance
Dear Joe Hershberger, In message <1318547028-20535-2-git-send-email-joe.hershber...@ni.com> you wrote: > Remove MK_STR from places that consume CONFIG_BOOTFILE to force all > definitions to be string literals. > > Signed-off-by: Joe Hershberger > Cc: Joe Hershberger > Cc: Wolfgang Denk > --- > common/env_common.c |2 +- > common/env_embedded.c|2 +- > doc/README.usb |2 +- > include/configs/MPC8313ERDB.h|2 +- > include/configs/MPC8323ERDB.h|2 +- > include/configs/MPC8349EMDS.h|2 +- > include/configs/MPC8349ITX.h |2 +- > include/configs/MPC8360ERDK.h|2 +- > include/configs/MPC837XERDB.h|2 +- > include/configs/MPC8536DS.h |2 +- > include/configs/MPC8540ADS.h |2 +- > include/configs/MPC8541CDS.h |2 +- > include/configs/MPC8544DS.h |2 +- > include/configs/MPC8548CDS.h |2 +- > include/configs/MPC8555CDS.h |2 +- > include/configs/MPC8560ADS.h |2 +- > include/configs/MPC8568MDS.h |2 +- > include/configs/MPC8569MDS.h |2 +- > include/configs/MPC8572DS.h |2 +- > include/configs/MPC8610HPCD.h|2 +- > include/configs/MPC8641HPCN.h|2 +- > include/configs/P1010RDB.h |2 +- > include/configs/P1022DS.h|2 +- > include/configs/P1023RDS.h |2 +- > include/configs/P1_P2_RDB.h |2 +- > include/configs/P2020DS.h|2 +- > include/configs/P2041RDB.h |2 +- > include/configs/RPXlite_DW.h |2 +- > include/configs/SBC8540.h|2 +- > include/configs/SIMPC8313.h |2 +- > include/configs/am3517_crane.h |2 +- > include/configs/am3517_evm.h |2 +- > include/configs/aria.h |2 +- > include/configs/corenet_ds.h |2 +- > include/configs/debris.h |2 +- > include/configs/gr_cpci_ax2000.h |2 +- > include/configs/gr_ep2s60.h |2 +- > include/configs/gr_xc3s_1500.h |2 +- > include/configs/grsim.h |2 +- > include/configs/grsim_leon2.h|2 +- > include/configs/idmr.h |2 +- > include/configs/inka4x0.h|2 +- > include/configs/mecp5123.h |2 +- > include/configs/mpc5121ads.h |2 +- > include/configs/mpc7448hpc2.h|2 +- > include/configs/mpr2.h |2 +- > include/configs/ms7720se.h |2 +- > include/configs/omap3_evm.h |2 +- > include/configs/p1_p2_rdb_pc.h |2 +- > include/configs/sbc8349.h|2 +- > include/configs/sbc8548.h|2 +- > include/configs/sbc8560.h|2 +- > include/configs/sbc8641d.h |2 +- > include/configs/stxgp3.h |2 +- > include/configs/stxssa.h |2 +- > include/configs/vme8349.h|2 +- > tools/env/fw_env.c |2 +- > 57 files changed, 57 insertions(+), 57 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Why can you only have two doors on a chicken coop? If it had four it would be a chicken sedan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] common: cosmetic: CONFIG_ROOTPATH checkpatch compliance
Dear Joe Hershberger, In message <1318547028-20535-1-git-send-email-joe.hershber...@ni.com> you wrote: > Remove MK_STR from places that consume CONFIG_ROOTPATH to force all > definitions to be string literals. > > Signed-off-by: Joe Hershberger > Cc: Joe Hershberger > Cc: Wolfgang Denk > --- > common/env_common.c |2 +- > common/env_embedded.c |2 +- > include/configs/DB64360.h |2 +- > include/configs/DB64460.h |2 +- > include/configs/MPC8313ERDB.h |2 +- > include/configs/MPC8323ERDB.h |2 +- > include/configs/MPC8349EMDS.h |2 +- > include/configs/MPC8349ITX.h |4 ++-- > include/configs/MPC8360ERDK.h |2 +- > include/configs/MPC837XERDB.h |2 +- > include/configs/MPC8536DS.h |2 +- > include/configs/MPC8540ADS.h |2 +- > include/configs/MPC8541CDS.h |2 +- > include/configs/MPC8544DS.h |2 +- > include/configs/MPC8548CDS.h |2 +- > include/configs/MPC8555CDS.h |2 +- > include/configs/MPC8560ADS.h |2 +- > include/configs/MPC8568MDS.h |2 +- > include/configs/MPC8569MDS.h |2 +- > include/configs/MPC8572DS.h |2 +- > include/configs/MPC8610HPCD.h |2 +- > include/configs/MPC8641HPCN.h |2 +- > include/configs/P1010RDB.h|2 +- > include/configs/P1022DS.h |2 +- > include/configs/P1_P2_RDB.h |2 +- > include/configs/P2020DS.h |2 +- > include/configs/P2041RDB.h|2 +- > include/configs/PN62.h|2 +- > include/configs/RPXlite_DW.h |2 +- > include/configs/RRvision.h|2 +- > include/configs/SBC8540.h |2 +- > include/configs/SIMPC8313.h |2 +- > include/configs/aria.h|2 +- > include/configs/bct-brettl2.h |2 +- > include/configs/bf537-minotaur.h |2 +- > include/configs/bf537-srv1.h |2 +- > include/configs/bfin_adi_common.h |2 +- > include/configs/blackstamp.h |2 +- > include/configs/blackvme.h|2 +- > include/configs/corenet_ds.h |2 +- > include/configs/debris.h |2 +- > include/configs/dnp5370.h |2 +- > include/configs/gr_cpci_ax2000.h |2 +- > include/configs/gr_ep2s60.h |2 +- > include/configs/gr_xc3s_1500.h|2 +- > include/configs/grsim.h |2 +- > include/configs/grsim_leon2.h |2 +- > include/configs/idmr.h|2 +- > include/configs/inka4x0.h |2 +- > include/configs/mecp5123.h|2 +- > include/configs/mpc5121ads.h |2 +- > include/configs/p1_p2_rdb_pc.h|2 +- > include/configs/pm9263.h |2 +- > include/configs/quantum.h |2 +- > include/configs/sbc8349.h |2 +- > include/configs/sbc8548.h |2 +- > include/configs/sbc8560.h |2 +- > include/configs/sbc8641d.h|2 +- > include/configs/stxgp3.h |2 +- > include/configs/stxssa.h |2 +- > include/configs/vme8349.h |2 +- > tools/env/fw_env.c|2 +- > 62 files changed, 63 insertions(+), 63 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Every revolutionary idea - in science, politics, art, or whatever - evokes three stages of reaction in a hearer: 1. It is completely impossible - don't waste my time. 2. It is possible, but it is not worth doing. 3. I said it was a good idea all along. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] autoconf.mk.dep: use target cflags, not host
Dear Mike Frysinger, In message <1318484880-12910-1-git-send-email-vap...@gentoo.org> you wrote: > The current autoconf.mk.dep rule uses the host cflags when executing the > target compiler (which includes target header files). We don't want to > mix the target compiler and host compiler flags, so change it to CFLAGS. > Otherwise we get things like -pedantic which the U-Boot source code does > not build with. > > Signed-off-by: Mike Frysinger > --- > Makefile |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de CONSUMER NOTICE: Because of the "Uncertainty Principle," It Is Impossible for the Consumer to Find Out at the Same Time Both Precisely Where This Product Is and How Fast It Is Moving. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] build: force migration away from $(AR)
Dear Mike Frysinger, In message <1318483520-2035-2-git-send-email-vap...@gentoo.org> you wrote: > People keep adding new code that still uses $(AR) instead of > $(cmd_link_o_target), so turn it into a build time error. > > We still use $(AR) locally, but we don't use $(ARFLAGS). > > Signed-off-by: Mike Frysinger > --- > config.mk |8 +++- > 1 files changed, 3 insertions(+), 5 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Conceptual integrity in turn dictates that the design must proceed from one mind, or from a very small number of agreeing resonant minds. - Frederick Brooks Jr., "The Mythical Man Month" ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2 v2] build: add missing $(AR)->$(cmd_link_o_target) update
Dear Mike Frysinger, In message <1318951817-28006-1-git-send-email-vap...@gentoo.org> you wrote: > Seems people fixed their files to use libfoo.o, but didn't actually > update the creation targets to use $(cmd_link_o_target). Update the > rest of the Makefile's found with grep. > > Signed-off-by: Mike Frysinger > --- > v2 > - fixup new sandbox makefile too > > arch/arm/cpu/arm926ejs/armada100/Makefile |2 +- > arch/arm/cpu/arm926ejs/pantheon/Makefile |2 +- > arch/arm/cpu/armv7/tegra2/Makefile|2 +- > board/Marvell/aspenite/Makefile |2 +- > board/Marvell/dkb/Makefile|2 +- > board/Marvell/gplugd/Makefile |2 +- > board/cm_t35/Makefile |2 +- > board/davinci/ea20/Makefile |2 +- > board/freescale/p1023rds/Makefile |2 +- > board/matrix_vision/mergerbox/Makefile|2 +- > board/nvidia/harmony/Makefile |2 +- > board/nvidia/seaboard/Makefile|2 +- > board/samsung/origen/Makefile |2 +- > board/samsung/smdkv310/Makefile |2 +- > board/sandbox/sandbox/Makefile|2 +- > board/shmin/Makefile |2 +- > 16 files changed, 16 insertions(+), 16 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Where there's no emotion, there's no motive for violence. -- Spock, "Dagger of the Mind", stardate 2715.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] consolidate mdelay by providing a common function for all users
Dear Anatolij Gustschin, In message <1318422699-9394-1-git-send-email-ag...@denx.de> you wrote: > There are several mdelay() definitions in the driver and > board code. Remove them all and provide a common mdelay() > in lib/time.c. > > Signed-off-by: Anatolij Gustschin > --- > arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c |1 - > arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c |1 - > arch/powerpc/cpu/mpc5xxx/usb_ohci.c |1 - > arch/powerpc/cpu/ppc4xx/usb_ohci.c|1 - > arch/powerpc/include/asm/4xx_pcie.h |8 > board/amcc/taishan/lcd.c |2 -- > board/freescale/mx35pdk/mx35pdk.c |2 -- > board/karo/tx25/tx25.c|6 -- > board/linkstation/hwctl.c |2 -- > drivers/block/fsl_sata.c |7 --- > drivers/block/ftide020.c |2 -- > drivers/net/e1000.c |1 - > drivers/net/ftgmac100.c |2 -- > drivers/net/ne2000.c |1 - > drivers/net/ne2000_base.c |1 - > drivers/net/smc911x.c |2 -- > drivers/usb/host/ohci-hcd.c |1 - > drivers/usb/host/sl811-hcd.c |2 -- > include/common.h |1 + > lib/time.c|6 ++ > 20 files changed, 7 insertions(+), 43 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de ... Jesus cried with a loud voice: Lazarus, come forth; the bug hath been found and thy program runneth. And he that was dead came forth... -- John 11:43-44 [version 2.0?] ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 REPOST 1/3] [COSMETIC] checkpatch whitespace cleanups
Dear Stephen Warren, In message <1318972311-673-1-git-send-email-swar...@nvidia.com> you wrote: > This avoids the following checkpatch warning in later patches: > > ERROR: "(foo*)" should be "(foo *)" > ERROR: space required before the open brace '{' > ERROR: space prohibited before that close parenthesis ')' > ERROR: spaces required around that '||' (ctx:WxV) > WARNING: space prohibited between function name and open parenthesis '(' > WARNING: line over 80 characters > > This fixes all the white-space warnings/errors in my subsequent patch, > and within this current patch. A number of other checkpatch warnings > and errors are still present in this patch itself, but are beyond simple > whitespace fixes, so are not solved by this patch. > > v2: New patch > > Signed-off-by: Stephen Warren > --- > common/cmd_bootm.c| 547 --- > common/cmd_ximg.c | 72 ++-- > common/image.c| 1187 > ++--- > common/lynxkdi.c | 34 +- > include/image.h | 230 +- > tools/default_image.c | 56 ++-- > 6 files changed, 1101 insertions(+), 1025 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de When it is incorrect, it is, at least *authoritatively* incorrect. - Hitchiker's Guide To The Galaxy ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] am335x: Drop board_sysinfo struct
Hi Tom, Le 22/10/2011 00:23, Tom Rini a écrit : > This isn't used presumably should be a typedef if needed later. Note: IIUC, typedefs are frowned upon in U-Boot. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
Le 22/10/2011 00:46, Marek Vasut a écrit : > On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: >> Le 22/10/2011 00:00, Marek Vasut a écrit : >>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: Hi Marek, Le 21/10/2011 22:44, Marek Vasut a écrit : > On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: >> This allows the SPL to avoid compiling in the CPU support code. >> >> Signed-off-by: Marek Vasut >> Cc: Stefano Babic >> Cc: Wolfgang Denk >> Cc: Detlev Zundel >> Cc: Scott Wood >> --- >> >> arch/arm/cpu/arm926ejs/Makefile |7 +++ >> 1 files changed, 7 insertions(+), 0 deletions(-) >> >> diff --git a/arch/arm/cpu/arm926ejs/Makefile >> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 >> --- a/arch/arm/cpu/arm926ejs/Makefile >> +++ b/arch/arm/cpu/arm926ejs/Makefile >> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o >> >> START= start.o >> COBJS= cpu.o >> >> +ifdef CONFIG_SPL_BUILD >> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE >> +START := >> +COBJS := >> +endif >> +endif >> + >> >> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) >> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) >> START:= $(addprefix $(obj),$(START)) > > Hi Albert, > > can we get this applied please? I still don't understand what this is supposed to do -- why not linking this code is required. Amicalement, >>> >>> Hi Albert, >>> >>> I use very different start.S in SPL. And I don't need cpu.o at all. >> >> That I understand; but is there a /problem/ in linking cpu.o in? > > I suppose it'll be optimized out at link time ? That indirectly answers my question: what you want to achieve is removing dead code. Now, about your question, you can check this if you build the board you intend to apply this to, and do an objdump of the generated SPL: you'll see if the cpu.o functions are present or not. (my point being that if cpu.o is to disappear because its functions are either useless or should move elsewhere, then the interest of a patch making cpu.o optional is short-lived.) > Cheers Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/4] macb: initial support for Cadence GEM
Dear Dave Aldridge, In message <1318251753-23604-1-git-send-email-fovs...@gmail.com> you wrote: > The Cadence GEM is based on the MACB Ethernet controller but has a few > small changes with regards to register and bitfield placement. This > patch detects the presence of a GEM by reading the module ID register > and setting a flag appropriately. > > This handles the new HW address, USRIO and hash register base register > locations in GEM. > > Signed-off-by: Dave Aldridge ... > --- a/drivers/net/macb.h > +++ b/drivers/net/macb.h > @@ -71,6 +71,15 @@ > #define MACB_TPQ 0x00bc > #define MACB_USRIO 0x00c0 > #define MACB_WOL 0x00c4 > +#define MACB_MID 0x00fc > + > +/* GEM register offsets. */ > +#define GEM_NCFGR0x0004 > +#define GEM_USRIO0x000c > +#define GEM_HRB 0x0080 > +#define GEM_HRT 0x0084 > +#define GEM_SA1B 0x0088 > +#define GEM_SA1T 0x008C NAK. > /* Register access macros */ > #define macb_readl(port,reg) \ > readl((port)->regs + MACB_##reg) > #define macb_writel(port,reg,value) \ > writel((value), (port)->regs + MACB_##reg) > +#define gem_readl(port, reg) \ > + __raw_readl((port)->regs + GEM_##reg) > +#define gem_writel(port, reg, value) \ > + __raw_writel((value), (port)->regs + GEM_##reg) NAK. We don't allow regoister accesses through base address + offset notation any more. Please use a C struct instead. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Today is the yesterday you worried about tomorrow. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4] drivers: add the support for Silicon Image SATA controller
Dear b29...@freescale.com, In message <1318051618-18957-1-git-send-email-b29...@freescale.com> you wrote: > From: Tang Yuantian > > Add the Silicon Image series PCI Express to > Serial ATA controller support, including Sil3132, > Sil3131 and Sil3124. > The SATA controller can be used to load kernel. > > The features list: > - Supports 1-lane 2.5 Gbit/s PCI Express > - Supports one/two/four independent Serial ATA channels > - Supports Serial ATA Generation 2 transfer rate of 3.0 Gbit/s > - Supports LBA28 and LBA48 > > Signed-off-by: Tang Yuantian > Signed-off-by: Aaron Williams > Tested-by: Lan Chunhe > --- > git tree: git://git.denx.de/u-boot.git > branch: master > Test platform:P1022DS, P4080DS > V4: > - fix checkpatch warning: > WARNING: externs should be avoided in .c files > #90: FILE: drivers/block/sata_sil.c:37: > +extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; > V3: > - remove __IOMEM > - remove force cast > V2: > - add virt_to_bus to translate address > - fix some issues > > drivers/block/Makefile |1 + > drivers/block/sata_sil.c | 722 > ++ > drivers/block/sata_sil.h | 229 +++ > include/pci_ids.h|5 + > 4 files changed, 957 insertions(+), 0 deletions(-) > create mode 100644 drivers/block/sata_sil.c > create mode 100644 drivers/block/sata_sil.h Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de In C we had to code our own bugs, in C++ we can inherit them. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND] FAT: Add FAT write feature
Dear Donggeun Kim, In message <1317973947-1312-1-git-send-email-dg77@samsung.com> you wrote: > In some cases, saving data in RAM as a file with FAT format is required. > This patch allows the file to be written in FAT formatted partition. > > The usage is similar with reading a file. > First, fat_register_device function is called before file_fat_write function > in order to set target partition. > Then, file_fat_write function is invoked with desired file name, > start ram address for writing data, and file size. > > Signed-off-by: Donggeun Kim > Signed-off-by: Kyungmin Park > --- > fs/fat/Makefile|1 + > fs/fat/fat.c |2 + > fs/fat/fat_write.c | 1091 > > include/fat.h |3 + > 4 files changed, 1097 insertions(+), 0 deletions(-) > create mode 100644 fs/fat/fat_write.c > > diff --git a/fs/fat/Makefile b/fs/fat/Makefile > index 93b6f07..9635d36 100644 > --- a/fs/fat/Makefile > +++ b/fs/fat/Makefile > @@ -25,6 +25,7 @@ LIB = $(obj)libfat.o > > AOBJS= > COBJS-$(CONFIG_CMD_FAT) := fat.o > +COBJS-$(CONFIG_FAT_WRITE):= fat_write.o Can ypu please document this new CONFIG_FAT_WRITE option in the README? Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "A complex system that works is invariably found to have evolved from a simple system that worked." - John Gall, _Systemantics_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 9/9] doc/README: documents and readme for NDS32 arch
Dear Macpaul Lin, In message <1319092871-28135-9-git-send-email-macp...@andestech.com> you wrote: > Documents and READMEs for NDS32 architecture. > It patch also provides usage of SoC AG101 and board ADP-AG101. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v10: > - The patch of documentation was not included. > Changes for v11: > - Add the documents of NDS32, ag101, N1213. > Changes for v12-v16: > - No change. > Changes for v17: > - Fix README (update only). > > README| 24 ++-- > doc/README.N1213 | 55 > doc/README.NDS32 | 41 +++ > doc/README.ag101 | 74 > + > doc/README.standalone |1 + > 5 files changed, 192 insertions(+), 3 deletions(-) > create mode 100644 doc/README.N1213 > create mode 100644 doc/README.NDS32 > create mode 100644 doc/README.ag101 Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It is more rational to sacrifice one life than six. -- Spock, "The Galileo Seven", stardate 2822.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 8/9] adp-ag101: add board adp-ag101 support
Dear Macpaul Lin, In message <1319092871-28135-8-git-send-email-macp...@andestech.com> you wrote: > Add evaluation board "adp-ag101" configuration file adp-ag101.h. > Add adp-ag101.c board config and related settings. > Add board adp-ag101 into boards.cfg > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v4: > - code clean up > Changes for v5-v6: > - Refine the definitions and parameters about CLK, > AHB controller, SDRAM controller, Static memory controllers. > - Add APB_CLK, AHB_CLK, SYS_CLK definitions for backward compatible. > - ftahbc010: > - Update include path of ftahbc010. > - ftsdmc021: > - Update include path of ftsdmc021. > - ftsmc020: > - Update include path of ftsmc020. > - ftwdt010: > - Fix WDT define and update include path. > - Fix ftwdt010 for hardware reset. > - ftpmu010: > - Remove duplicate PMU definitions. > - Add related configurations. > - Fix MAX malloc len and fix saveenv. > - clean up. > Changes for v7: > - clean up. > - Move CONFIG_SYS_TEXT_BASE from board/config.mk. > - Fix Makefile and remove config.mk > Changes for v8: > - No change. > Changes for v9: > - Fix because other boards has been added into boards.cfg and > broken this patch. > Changes for v10: > - adp-ag101.h >- Fix lines over 80 characters. >- Fix for introducing gen-asm-offset. >- Add mmc support for FTSDC010 SD/MMC Controller. >- fix flash init. >- fix ftsmc010 configuraion for flash probing. >- Add SP_INIT related configurations for supporting relocation. >- Fix CONFIG_TEXT_BASE for relocation. >- Add CONFIG_MEM_REMAP for some hardware boards and non-OS application. > - adp-ag101.c >- Clean up for braces according to Wolfgang's suggestion. >- Add mmc support for FTSDC010 SD/MMC Controller. >- fix dram init(), made this more simpler. > Changes for v11: > - No change. > Changes for v12: > - adp-ag101.h >- fix address when enable CONFIG_SKIP_LOWLEVEL_INIT > Changes for v13: > - board/AndesTech/adp-ag101/Makefile: remove unused clean and distclean. > Changes for v14: > - No change. > Changes for v15: > - adp-ag101.h: drop NET_MULTI > - Makefile: clean up Makefile > Changes for v16: > - No change. > Changes for v17: > - Fix boards.cfg (update only). > > MAINTAINERS | 11 + > MAKEALL |6 + > board/AndesTech/adp-ag101/Makefile| 44 > board/AndesTech/adp-ag101/adp-ag101.c | 89 +++ > boards.cfg|1 + > include/configs/adp-ag101.h | 406 > + > 6 files changed, 557 insertions(+), 0 deletions(-) > create mode 100644 board/AndesTech/adp-ag101/Makefile > create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c > create mode 100644 include/configs/adp-ag101.h Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "'Tis true, 'tis pity, and pity 'tis 'tis true." - Poloniouius, in Willie the Shake's _Hamlet, Prince of Darkness_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 7/9] nds32: common bdinfo, bootm, image support
Dear Macpaul Lin, In message <1319092871-28135-7-git-send-email-macp...@andestech.com> you wrote: > Add support of NDS32 to common commands bdinfo, bootm, and image format. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v6: > - Code clean up > Changes for v7-v9: > - No Change. > Changes for v10: > - fix up according to the changes in master tree. > Changes for v11: > - No Change. > Changes for v12: > - remove seldom used bi_env parameter. > Changes for v13-v14: > - No change. > Changes for v15: > - cmd_bootm.c and image.h > - Fix for new image.h according to Mike's Contribute. > Changes for v16: > - No change. > Changes for v17: > - Fix for Sandbox added in. > > common/cmd_bdinfo.c | 25 + > common/image.c |1 + > include/image.h |1 + > 3 files changed, 27 insertions(+), 0 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "There is nothing so deadly as not to hold up to people the opportunity to do great and wonderful things, if we wish to stimulate them in an active way." - Dr. Harold Urey, Nobel Laureate in chemistry ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 6/9] nds32: standalone support
Dear Macpaul Lin, In message <1319092871-28135-6-git-send-email-macp...@andestech.com> you wrote: > Add standalone program related support for nds32 architecture. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v6: > - code clean up. > Changes for v7-v11: > - No change. > Changes for v12: > - clean up for linker script. > Changes for v13-v15: > - No change. > Changes for v16: > - x86-testapp.c: fix line over 80 characters. > Changes for v17: > - No change. > > examples/standalone/nds32.lds | 56 > + > examples/standalone/stubs.c | 17 ++- > examples/standalone/x86-testapp.c | 13 > 3 files changed, 85 insertions(+), 1 deletions(-) > create mode 100644 examples/standalone/nds32.lds Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de He'd been wrong, there _was_ a light at the end of the tunnel, and it was a flamethrower. - Terry Pratchett, _Mort_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 5/9] nds32/lib: add generic funcs in NDS32 lib
Dear Macpaul Lin, In message <1319092871-28135-5-git-send-email-macp...@andestech.com> you wrote: > Add Makefile, board.c, interrupts.c and bootm.c functions > to nds32 architecture. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v4: > - code clean up and formatting style. > Changes for v5-v6: > - board.c >- Do some clean up and add code >- Remove display banner which hasn't support. >- Add ftpmu010 related power management unit code. >- Remove useless LED related code. >- Move SDRAM init to board sepecific files. (ex. adp-ag101.c) >- Remove CONFIG_SOFT_I2C which hasn't been support. >- Remove CONFIG_FSL_ESDHC which hasn't been support. >- clean up. > Changes for v7: > - clean up. > - move single file patch arch/nds32/config.mk to this commit. > - interrupts.c refine origin interrupt enable and disable. > Changes for v8: > - interrups.c: fix up for new ptraces.h. > Changes for v9: > - support CONFIG_STANDALONE_LOAD_ADDR in config.mk > Changes for v10: > - config.mk: >- add -fpie flag. >- replace -ffixed-8 to -ffixed-10. >- add -mrelax and --gc-sections to LDFLAG > - board.c: >- fix lib/board.c for relocation. >- fix dram init for relocation. > Changes for v11: > - arch/nds32/lib/Makefile >- replace $(AR) $(call cmd_link_o_target,...) > Changes for v12: > - config.mk >- remove $(SRCTREE)/$(CPUDIR)/u-boot.lds > - board.c: >- remove obsolelte version_string. >- remove declaration "extern __bss_end" which is not need. >- replace sizeof(gd_t) and sizeof(bd_t) to > GENERATED_GBL_DATA_SIZE and GENERATED_BD_INFO_SIZE >- add memset to board info (bd) >- remove compiler optimization barrier which is not need. > Changes for v13: > - board.c: remove unused CONFIG_IDENT_STRING. > - arch/nds32/lib/Makefile: remove unused clean and distclean. > Changes for v14: > - No change. > Changes for v15: > - lib/board.c: >- remove duplicate pci init >- drop NET_MULTI > Changes for v16-v17: > - No changes. > > arch/nds32/config.mk| 35 > arch/nds32/lib/Makefile | 46 + > arch/nds32/lib/board.c | 439 > +++ > arch/nds32/lib/bootm.c | 241 > arch/nds32/lib/interrupts.c | 129 + > 5 files changed, 890 insertions(+), 0 deletions(-) > create mode 100644 arch/nds32/config.mk > create mode 100644 arch/nds32/lib/Makefile > create mode 100644 arch/nds32/lib/board.c > create mode 100644 arch/nds32/lib/bootm.c > create mode 100644 arch/nds32/lib/interrupts.c Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de When all else fails, read the instructions. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Porting lpc313x support up to current u-boot
On Fri, Oct 21, 2011 at 5:16 PM, Albert ARIBAUD wrote: > Hi Jon, > > Le 16/10/2011 22:07, jonsm...@gmail.com a écrit : >> >> On Sat, Oct 15, 2011 at 11:37 PM, jonsm...@gmail.com >> wrote: >>> >>> I'm porting the lpc313x uboot located here, up to current uboot. It >>> is based on U-boot.2009.11.1 >>> http://git.lpclinux.com/?p=uboot-2009.11-lpc313x.git;a=summary >>> >>> What do I do with the cpu directory? >>> >>> http://git.lpclinux.com/?p=uboot-2009.11-lpc313x.git;a=tree;f=cpu/lpc313x;h=5cc2c80b1ef75c729abff5ecbcaaef6c49f181b1;hb=HEAD >>> It has a lds file in it containing symbols needs by init.c >> >> If I move the lpc313x directory under the arm926ejs directory which >> also contains a linker script, what is the normal procedure for >> reconciling the two scripts? > > You should not need any lds besides the one for arm926ejs, and using another > script would probably break a lot of things -- relocation, to begin with -- > and anyway it would probably not build clean. I've been making some progress. The out of tree lpc31xx uboot code has it's own implementation of a SPL (secondary program loader). That why the lds file is complicated. I've slowly been trying to comprehend the current uboot SPL support and to convert the NXP code over to the that model. I'm making progress. The SPL hardware model for the lpc31xx is a little different than the current uboot model. The lpc31xx has 32KB of SRAM to work with and a ROM that can IPL from seven different sources. The existing SPL implementations are trying to fit into 4KB instead of 32KB. Since I have a lot more memory I can keep the NXP code that autodetects the boot flash type for example. > > Amicalement, > -- > Albert. > -- Jon Smirl jonsm...@gmail.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 4/9] nds32/ag101: cpu and init funcs of SoC ag101
Dear Macpaul Lin, In message <1319092871-28135-4-git-send-email-macp...@andestech.com> you wrote: > SoC ag101 is the first chip using NDS32 N1213 cpu core. > Add header file of device offset support for SoC ag101. > Add main function of SoC ag101 based on NDS32 n1213 core. > Add lowlevel_init.S and other periphal related code. > > This version of lowlevel_init.S also replace hardcode value > by MARCO defines from the GPL version andesboot for better > code quality. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v4: > - Code clean up. > Changes for v5-v6: > - Split watchdog.S from lowlevel_init.S. > - Fix hardware reset by using watchdog reset in do_reset() in cpu.c. >- reset_cpu was remove inside do_reset(). > - lowlevel_init.S >- Change hard code value into MARCO definitions. >- ftsmc010 > - Fix FTSMC020_TPR_AT2 from 1 to 3 (0xff3ff) >- ftsdmc021 > - Fix hardcoded address of CR1, CR2, TR1, TR2, BANK0 registers. > - Fix the default configuration value of FTSDMC and FTSMC controller. >- Remove some ftpmu010 and flash probe code to C functions. > Changes for v7: > - clean up. > Changes for v8-v9: > - No change. > Changes for v10: > - asm-offset.c: file added for ag101 use only. > - ag101/Makefile: add gen-asm-offset support to ag101 for lowlevel_init.S. > - Makefile: add gen-asm-offset support for NDS32 based core and SoCs. > - cpu.c: remove unused cpu_init(). > - lowlevel_init.S >- Introduce SoC specific gen-asm-offset.h to lowlevel_init.S >- Replace routings by macros to made code much easier to understand. >- Add debug LED support. >- Add CONFIG_MEM_REMAP for those boards must do memort remapping. > Changes for v11: > - arch/nds32/cpu/n1213/ag101/Makefile >- replace $(AR) $(call cmd_link_o_target,...) > Changes for v12: > - Simplify the commit log about the part of lowlevel_init.S. > Changes for v13: > - arch/nds32/cpu/n1213/ag101/Makefile: remove unused gen-asm-offset. > - Makefile: remove unused gen-asm-offset because merged asm-offsets. > Changes for v14: > - lowlevel_init.S: fix include path of > Changes for v15: > - fix sleep delay. > Changes for v16: > - arch/nds32/include/asm/arch-ag101/ag101.h: fix lines over 80 characters > - arch/nds32/cpu/n1213/ag101/lowlevel_init.S: fix lines over 80 characters > - arch/nds32/cpu/n1213/ag101/timer.c: fix line over 80 characters > Changes for v17: > - No changes. > > arch/nds32/cpu/n1213/ag101/Makefile| 58 +++ > arch/nds32/cpu/n1213/ag101/asm-offsets.c | 43 + > arch/nds32/cpu/n1213/ag101/cpu.c | 200 +++ > arch/nds32/cpu/n1213/ag101/lowlevel_init.S | 238 > > arch/nds32/cpu/n1213/ag101/timer.c | 205 > arch/nds32/cpu/n1213/ag101/watchdog.S | 48 ++ > arch/nds32/include/asm/arch-ag101/ag101.h | 103 > 7 files changed, 895 insertions(+), 0 deletions(-) > create mode 100644 arch/nds32/cpu/n1213/ag101/Makefile > create mode 100644 arch/nds32/cpu/n1213/ag101/asm-offsets.c > create mode 100644 arch/nds32/cpu/n1213/ag101/cpu.c > create mode 100644 arch/nds32/cpu/n1213/ag101/lowlevel_init.S > create mode 100644 arch/nds32/cpu/n1213/ag101/timer.c > create mode 100644 arch/nds32/cpu/n1213/ag101/watchdog.S > create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "I didn't know it was impossible when I did it." ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 3/9] nds32/core N1213: NDS32 N12 core family N1213
Dear Macpaul Lin, In message <1319092871-28135-3-git-send-email-macp...@andestech.com> you wrote: > Add N1213 cpu core (N12 Core family) support for NDS32 arch. > This patch includes start.S for the initialize procedure of N1213. > > Start procedure: > start.S will start up the N1213 CPU core at first, > then jump to SoC dependent "lowlevel_init.S" and > "watchdog.S" to configure peripheral devices. > > Signed-off-by: Macpaul Lin > Signed-off-by: Greentime Hu > --- > Changes for v1 to v6: > - Style clean up and reorganize code > Changes for v7-v9: > - No Change. > Changes for v10: > - start.S of N1213 CPU has been rewrote for relocation support. > - u-boot.lds: >- Add got and *(.got.plt) section for support GCC 4 toolchain >- Modified for relocation implementation. > Changes for v11: > - arch/nds32/cpu/n1213/Makefile >- replace $(AR) $(call cmd_link_o_target,...) > Changes for v12: > - u-boot.lds >- Remove the 0x base address in linker script. > The base address of the binary will be determined by CONFIG_SYS_TEXT_BASE > - Remove the CPU features in commit log and add to README in later patches. > Changes for v13-v14: > - No change. > Changes for v15: > - start.S: fix exception vector aligment (add setivb in reset vector). > Changes for v16: > - start.S: remove lines over 80 characters. > Changes for v17: > - Fix a space ident warning which checkpatch doesn't found. > > arch/nds32/cpu/n1213/Makefile | 50 > arch/nds32/cpu/n1213/start.S| 529 > +++ > arch/nds32/cpu/n1213/u-boot.lds | 70 + > 3 files changed, 649 insertions(+), 0 deletions(-) > create mode 100644 arch/nds32/cpu/n1213/Makefile > create mode 100644 arch/nds32/cpu/n1213/start.S > create mode 100644 arch/nds32/cpu/n1213/u-boot.lds Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de All he had was nothing, but that was something, and now it had been taken away. - Terry Pratchett, _Sourcery_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 2/9] nds32: add NDS32 support into common header file
Dear Macpaul Lin, In message <1319092871-28135-2-git-send-email-macp...@andestech.com> you wrote: > Add NDS32 support into common header file. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v7: > - No change > Changes for v8: > - Fix the patch according to dependency of x86's Fix > Changes for v9-v16: > - No change > Changes for v17: > - Fix for arch Sandbox has been committed. > > include/common.h |4 > 1 files changed, 4 insertions(+), 0 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons several minutes ago. We don't need no stinkin' tactical nukes. (By the way, do you have change for 10 million people?) - lwall ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v17 1/9] nds32: add header files support for nds32
Dear Macpaul Lin, In message <1319092871-28135-1-git-send-email-macp...@andestech.com> you wrote: > Add generic header files support for nds32 architecture. > Cache, ptregs, data type and other definitions are included. > > Signed-off-by: Macpaul Lin > --- > Changes for v1-v4: > - Code cleanup and style formatting. > Changes for v5-v6: > - This patch also updated the following changes against the > change after master tree (v2010.12-rc1). > - fix upper case definitions in cache.h > - Support GD_FLG_ENV_READY and env_buf vars in nds32 global_data.h. > - Add readsb, writesb functions into io.h. > Changes for v7: > - clean up > - volatile: >- types.h > - remove typedef volatile unsigned char vuchar; > - remove typedef volatile unsigned long vulong; > - remove typedef volatile unsigned short vushort; >- u-boot.h: remove bd_info_ext bi_ext >- bitops.h: add accessor function to bit operation with volatile var. >- system.h: add system.h for local_irq operation with flag. > Changes for v8: > - ptrace.h: rewrite the pt_reg structure, and merge ptregs.h. > - ptregs.h: removed > Changes for v9: > - No change. > Changes for v10: > - macro.h: add writel and setbf macros > - u-boot-nds32.h: >- Remove obsolete andesboot_* symbols for relocation. >- Add _bss_*_offset symbols for relocation. > - config.h: add manual relocation support as default. > Changes for v11: > - unaligned.h: replace asm/unaligned.h with asm-generic/unaligned.h > Changes for v12: > - remove no used memory.h > - remove seldom used bi_env parameter > - u-boot-nds32.h: >- remove duplicate timer_init() > Changes for v13-v14: > - No change. > Changes for v15: > - u-boot.h: fix for new image.h according to Mike's contribution. > Changes for v16: > - asm/io.h: >- fix line over 80 characters. >- remove volatiles for __arch_getb > - asm/bitops.h: remove volatiles for inline __set_bit() > - asm/global_data.h: fix line over 80 characters. > Changes for v17: > - No Change. > > arch/nds32/include/asm/bitops.h | 186 +++ > arch/nds32/include/asm/byteorder.h| 36 +++ > arch/nds32/include/asm/cache.h| 54 + > arch/nds32/include/asm/config.h | 28 +++ > arch/nds32/include/asm/global_data.h | 89 +++ > arch/nds32/include/asm/io.h | 412 > + > arch/nds32/include/asm/mach-types.h | 29 +++ > arch/nds32/include/asm/macro.h| 96 > arch/nds32/include/asm/posix_types.h | 84 +++ > arch/nds32/include/asm/processor.h| 25 ++ > arch/nds32/include/asm/ptrace.h | 88 +++ > arch/nds32/include/asm/string.h | 57 + > arch/nds32/include/asm/system.h | 88 +++ > arch/nds32/include/asm/types.h| 63 + > arch/nds32/include/asm/u-boot-nds32.h | 51 > arch/nds32/include/asm/u-boot.h | 63 + > arch/nds32/include/asm/unaligned.h|1 + > 17 files changed, 1450 insertions(+), 0 deletions(-) > create mode 100644 arch/nds32/include/asm/bitops.h > create mode 100644 arch/nds32/include/asm/byteorder.h > create mode 100644 arch/nds32/include/asm/cache.h > create mode 100644 arch/nds32/include/asm/config.h > create mode 100644 arch/nds32/include/asm/global_data.h > create mode 100644 arch/nds32/include/asm/io.h > create mode 100644 arch/nds32/include/asm/mach-types.h > create mode 100644 arch/nds32/include/asm/macro.h > create mode 100644 arch/nds32/include/asm/posix_types.h > create mode 100644 arch/nds32/include/asm/processor.h > create mode 100644 arch/nds32/include/asm/ptrace.h > create mode 100644 arch/nds32/include/asm/string.h > create mode 100644 arch/nds32/include/asm/system.h > create mode 100644 arch/nds32/include/asm/types.h > create mode 100644 arch/nds32/include/asm/u-boot-nds32.h > create mode 100644 arch/nds32/include/asm/u-boot.h > create mode 100644 arch/nds32/include/asm/unaligned.h Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "Open the pod bay doors, HAL."- Dave Bowman, 2001 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd_bdinfo: replace print_str() with print_mhz()
Dear Timur Tabi, In message <1317852487-12499-1-git-send-email-ti...@freescale.com> you wrote: > The print_str() helper function for cmd_bdinfo can print any string, but it > is only used to print MHz values. Replace it with print_mhz() that takes > a number and converts it to a string internally. > > Signed-off-by: Timur Tabi > --- > > This patch applies on top of "powerpc/85xx: don't display address map size > (32-bit vs. 36-bit) during boot". > > I've only tested this on PowerPC. > > common/cmd_bdinfo.c | 72 -- > 1 files changed, 35 insertions(+), 37 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de 8) Use common sense in routing cable. Avoid wrapping coax around sources of strong electric or magnetic fields. Do not wrap the cable around flourescent light ballasts or cyclotrons, for example. - Ethernet Headstart Product, Information and Installation Guide, Bell Technologies, pg. 11 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote: > Le 22/10/2011 00:00, Marek Vasut a écrit : > > On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote: > >> Hi Marek, > >> > >> Le 21/10/2011 22:44, Marek Vasut a écrit : > >>> On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote: > This allows the SPL to avoid compiling in the CPU support code. > > Signed-off-by: Marek Vasut > Cc: Stefano Babic > Cc: Wolfgang Denk > Cc: Detlev Zundel > Cc: Scott Wood > --- > > arch/arm/cpu/arm926ejs/Makefile |7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/cpu/arm926ejs/Makefile > b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644 > --- a/arch/arm/cpu/arm926ejs/Makefile > +++ b/arch/arm/cpu/arm926ejs/Makefile > @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o > > START = start.o > COBJS = cpu.o > > +ifdef CONFIG_SPL_BUILD > +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE > +START := > +COBJS := > +endif > +endif > + > > SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) > OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) > START := $(addprefix $(obj),$(START)) > >>> > >>> Hi Albert, > >>> > >>> can we get this applied please? > >> > >> I still don't understand what this is supposed to do -- why not linking > >> this code is required. > >> > >> Amicalement, > > > > Hi Albert, > > > > I use very different start.S in SPL. And I don't need cpu.o at all. > > That I understand; but is there a /problem/ in linking cpu.o in? I suppose it'll be optimized out at link time ? Cheers ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 13/17 V4] iMX28: Add support for DENX M28EVK board
This contains support for the following components: - DUART - MMC - Both FEC interfaces - NAND - I2C (RTC, EEPROM) - SPI (FLASH) Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- MAINTAINERS|1 + board/denx/m28evk/Makefile | 49 board/denx/m28evk/m28evk.c | 195 ++ boards.cfg |1 + include/configs/m28evk.h | 282 5 files changed, 528 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.h V2: Use scrub -y instead of scrub.quiet in the scripts. V3: Use CONFIG_ENV_RANGE V4: Configure the RAM size to 128MB for V1.1 module diff --git a/MAINTAINERS b/MAINTAINERS index bb95e6d..12c9e96 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -841,6 +841,7 @@ Marek Vasut palmtc xscale/pxa vpac270 xscale/pxa zipitz2 xscale/pxa + m28evk i.MX28 efikamx i.MX51 efikasb i.MX51 diff --git a/board/denx/m28evk/Makefile b/board/denx/m28evk/Makefile new file mode 100644 index 000..4037199 --- /dev/null +++ b/board/denx/m28evk/Makefile @@ -0,0 +1,49 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := m28evk.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c new file mode 100644 index 000..118e222 --- /dev/null +++ b/board/denx/m28evk/m28evk.c @@ -0,0 +1,195 @@ +/* + * DENX M28 module + * + * Copyright (C) 2011 Marek Vasut + * on behalf of DENX Software Engineering GmbH + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +/* + * Functions + */ +int board_early_init_f(void) +{ + /* IO0 clock at 480MHz */ + mx28_set_ioclk(MXC_IOCLK0, 48); + /* IO1 clock at 480MHz */ + mx28_set_ioclk(MXC_IOCLK1, 48); + + /* SSP0 clock at 96MHz */ + mx28_set_sspclk(MXC_SSPCLK0, 96000, 0); + /* SSP2 clock at 96MHz */ + mx28_set_sspclk(MXC_SSPCLK2, 96000, 0); + + return 0; +} + +int board_init(void) +{ + /* Adress of boot parameters */ + gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; + + return 0; +} + +int dram_init(void) +{ + /* dram_init must store complete ramsize in gd->ram_size */ + gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); + return 0; +} + +#ifdef CONFIG_CMD_MMC +static int m28_mmc_wp(int id) +{ + if (id != 0) { + printf("MXS MMC: Invalid card selected (card id = %d)\n", id); + return 1; + } + + return
[U-Boot] [PATCH 11/17 RESEND V2] iMX28: Add image header generator tool
This tool can now generate proper image for "BootStream" files. NOTE: This tool now works only for NAND. Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- tools/.gitignore |1 + tools/Makefile |6 + tools/mxsboot.c | 684 ++ 3 files changed, 691 insertions(+), 0 deletions(-) create mode 100644 tools/mxsboot.c V2: Add missing .gitignore entry diff --git a/tools/.gitignore b/tools/.gitignore index 07f21a3..98a5c78 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -4,6 +4,7 @@ /img2srec /mkimage /mpc86x_clk +/mxsboot /ncb /ncp /ubsha1 diff --git a/tools/Makefile b/tools/Makefile index fc741d3..2caac78 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -67,6 +67,7 @@ BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX) BIN_FILES-y += mkimage$(SFX) +BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) @@ -90,6 +91,7 @@ NOPED_OBJ_FILES-y += kwbimage.o NOPED_OBJ_FILES-y += imximage.o NOPED_OBJ_FILES-y += omapimage.o NOPED_OBJ_FILES-y += mkimage.o +OBJ_FILES-$(CONFIG_MX28) += mxsboot.o OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o NOPED_OBJ_FILES-y += os_support.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o @@ -204,6 +206,10 @@ $(obj)mpc86x_clk$(SFX):$(obj)mpc86x_clk.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ +$(obj)mxsboot$(SFX): $(obj)mxsboot.o + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + $(obj)ncb$(SFX): $(obj)ncb.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ diff --git a/tools/mxsboot.c b/tools/mxsboot.c new file mode 100644 index 000..176753d --- /dev/null +++ b/tools/mxsboot.c @@ -0,0 +1,684 @@ +/* + * Freescale i.MX28 image generator + * + * Copyright (C) 2011 Marek Vasut + * on behalf of DENX Software Engineering GmbH + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include + +#include "compiler.h" + +/* + * Default BCB layout. + * + * TWEAK this if you have blown any OCOTP fuses. + */ +#defineSTRIDE_PAGES64 +#defineSTRIDE_COUNT4 + +/* + * Layout for 256Mb big NAND with 2048b page size, 64b OOB size and + * 128kb erase size. + * + * TWEAK this if you have different kind of NAND chip. + */ +uint32_t nand_writesize = 2048; +uint32_t nand_oobsize = 64; +uint32_t nand_erasesize = 128 * 1024; + +/* + * Sector on which the SigmaTel boot partition (0x53) starts. + */ +uint32_t sd_sector = 2048; + +/* + * Each of the U-Boot bootstreams is at maximum 1MB big. + * + * TWEAK this if, for some wild reason, you need to boot bigger image. + */ +#defineMAX_BOOTSTREAM_SIZE (1 * 1024 * 1024) + +/* i.MX28 NAND controller-specific constants. DO NOT TWEAK! */ +#defineMXS_NAND_DMA_DESCRIPTOR_COUNT 4 +#defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE 512 +#defineMXS_NAND_METADATA_SIZE 10 +#defineMXS_NAND_COMMAND_BUFFER_SIZE32 + +struct mx28_nand_fcb { + uint32_tchecksum; + uint32_tfingerprint; + uint32_tversion; + struct { + uint8_t data_setup; + uint8_t data_hold; + uint8_t address_setup; + uint8_t dsample_time; + uint8_t nand_timing_state; + uint8_t rea; + uint8_t rloh; + uint8_t rhoh; + } timing; + uint32_tpage_data_size; + uint32_ttotal_page_size; + uint32_tsectors_per_block; + uint32_tnumber_of_nands;/* Ignored */ + uint32_ttotal_internal_die; /* Ignored */ + uint32_tcell_t
[U-Boot] [PATCH 16/17] iMX28: Fix ARM vector handling
This patch introduces proper ARM vector handling for i.MX28 CPU. This issue wasn't addressed because the interrupts weren't enabled on any ARMv5 core, therefore the issue wasn't noticed earlier. In previous implementation, the vectoring code used by i.MX28 CPU when an exception happened was that of the SPL. With this change, the branch target when an exception happens can be reconfigured by U-Boot. Signed-off-by: Marek Vasut --- arch/arm/cpu/arm926ejs/mx28/mx28.c | 22 +++ board/denx/m28evk/start.S | 264 +++- include/configs/m28evk.h |1 + 3 files changed, 74 insertions(+), 213 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c index e990f3c..088c019 100644 --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c @@ -35,6 +35,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + /* 1 second delay should be plenty of time for block reset. */ #defineRESET_MAX_TIMEOUT 100 @@ -116,11 +118,31 @@ int mx28_reset_block(struct mx28_register *reg) return 0; } +void mx28_fixup_vt(uint32_t start_addr) +{ + uint32_t *vt = (uint32_t *)0x20; + int i; + + for (i = 0; i < 8; i++) + vt[i] = start_addr + (4 * i); +} + +#ifdef CONFIG_ARCH_MISC_INIT +int arch_misc_init(void) +{ + mx28_fixup_vt(gd->relocaddr); + return 0; +} +#endif + #ifdef CONFIG_ARCH_CPU_INIT int arch_cpu_init(void) { struct mx28_clkctrl_regs *clkctrl_regs = (struct mx28_clkctrl_regs *)MXS_CLKCTRL_BASE; + extern uint32_t _start; + + mx28_fixup_vt((uint32_t)&_start); /* * Enable NAND clock diff --git a/board/denx/m28evk/start.S b/board/denx/m28evk/start.S index cf67599..94696d6 100644 --- a/board/denx/m28evk/start.S +++ b/board/denx/m28evk/start.S @@ -58,54 +58,58 @@ .globl _start _start: b reset -#ifdef CONFIG_SPL_BUILD -/* No exception handlers in preloader */ - ldr pc, _hang - ldr pc, _hang - ldr pc, _hang - ldr pc, _hang - b reset - ldr pc, _hang - ldr pc, _hang + b undefined_instruction + b software_interrupt + b prefetch_abort + b data_abort + b not_used + b irq + b fiq -_hang: - .word do_hang -/* pad to 64 byte boundary */ - .word 0x12345678 - .word 0x12345678 - .word 0x12345678 - .word 0x12345678 - .word 0x12345678 - .word 0x12345678 - .word 0x12345678 -#else - ldr pc, _undefined_instruction - ldr pc, _software_interrupt - ldr pc, _prefetch_abort - ldr pc, _data_abort - ldr pc, _not_used - ldr pc, _irq - ldr pc, _fiq +/* + * Vector table, located at address 0x20. + * This table allows the code running AFTER SPL, the U-Boot, to install it's + * interrupt handlers here. The problem is that the U-Boot is loaded into RAM, + * including it's interrupt vectoring table and the table at 0x0 is still the + * SPLs. So if interrupt happens in U-Boot, the SPLs interrupt vectoring table + * is still used. + */ +_vt_reset: + .word _reset +_vt_undefined_instruction: + .word _hang +_vt_software_interrupt: + .word _hang +_vt_prefetch_abort: + .word _hang +_vt_data_abort: + .word _hang +_vt_not_used: + .word _reset +_vt_irq: + .word _hang +_vt_fiq: + .word _hang -_undefined_instruction: - .word undefined_instruction -_software_interrupt: - .word software_interrupt -_prefetch_abort: - .word prefetch_abort -_data_abort: - .word data_abort -_not_used: - .word not_used -_irq: - .word irq -_fiq: - .word fiq +reset: + ldr pc, _vt_reset +undefined_instruction: + ldr pc, _vt_undefined_instruction +software_interrupt: + ldr pc, _vt_software_interrupt +prefetch_abort: + ldr pc, _vt_prefetch_abort +data_abort: + ldr pc, _vt_data_abort +not_used: + ldr pc, _vt_not_used +irq: + ldr pc, _vt_irq +fiq: + ldr pc, _vt_fiq -#endif /* CONFIG_SPL_BUILD */ .balignl 16,0xdeadbeef - /* * * @@ -162,7 +166,7 @@ IRQ_STACK_START_IN: * the actual reset code */ -reset: +_reset: /* * Store all registers on old stack pointer, this will allow us later to * return to the BootROM and let the BootROM load U-Boot into RAM. @@ -220,177 +224,11 @@ cpu_init_crit: mcr p15, 0, r0, c1, c0, 0 mov pc, lr /* back to my caller */ -#endif /* CONFIG_SKIP_LOWLEVEL_INIT */ - -#ifndef CONFIG_SPL_BUILD -/* - * - * - * Interrupt handling - *
[U-Boot] [PATCH 15/17 RESEND] M28: Add doc/README.m28 documentation
Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- doc/README.m28 | 223 1 files changed, 223 insertions(+), 0 deletions(-) create mode 100644 doc/README.m28 diff --git a/doc/README.m28 b/doc/README.m28 new file mode 100644 index 000..b749ce0 --- /dev/null +++ b/doc/README.m28 @@ -0,0 +1,223 @@ +DENX M28EVK +=== + +This document describes the DENX M28/M28EVK U-Boot port. This document mostly +covers topics related to making the module/board bootable. + +Terminology +--- + +The dollar symbol ($) introduces a snipped of shell code. This shall be typed +into the unix command prompt in U-Boot source code root directory. + +The (=>) introduces a snipped of code that should by typed into U-Boot command +prompt. + +Contents + + +0) Files of the M28/M28EVK port +1) Prerequisites +2) Compiling U-Boot for M28 +3) Installation of U-Boot for M28EVK to SD card +4) Installation of U-Boot for M28 to NAND flash + +0) Files of the M28/M28EVK port +--- + +arch/arm/cpu/arm926ejs/mx28/ - The CPU support code for the Freescale i.MX28 +arch/arm/include/asm/arch-mx28/- Header files for the Freescale i.MX28 +board/denx/m28evk/ - M28EVK board specific files +include/configs/m28evk.h - M28EVK configuration file + +1) Prerequisites + + +To make the M28 module or the M28 module or M28EVK board bootable, some tools +are necessary. The first one is the "elftosb" tool distributed by Freescale +Semiconductor. The other tool is the "mxsboot" tool found in U-Boot source tree. + +Firstly, obtain the elftosb archive from the following location: + + http://foss.doredevelopment.dk/mirrors/imx/elftosb-10.12.01.tar.gz + +We use a $VER variable here to denote the current version. At the time of +writing of this document, that is "10.12.01". To obtain the file from command +line, use: + + $ VER="10.12.01" + $ wget http://foss.doredevelopment.dk/mirrors/imx/elftosb-${VER}.tar.gz + +Extract the file: + + $ tar xzf elftosb-${VER}.tar.gz + +Compile the file. We need to manually tell the linker to use also libm: + + $ cd elftosb-${VER}/ + $ make LIBS="-lstdc++ -lm" elftosb + +Optionally, remove debugging symbols from elftosb: + + $ strip bld/linux/elftosb + +Finally, install the "elftosb" binary. The "install" target is missing, so just +copy the binary by hand: + + $ sudo cp bld/linux/elftosb /usr/local/bin/ + +Make sure the "elftosb" binary can be found in your $PATH, in this case this +means "/usr/local/bin/" has to be in your $PATH. + +2) Compiling U-Boot for M28 +--- + +Compiling the U-Boot for M28 is straightforward and done as compiling U-Boot +for any other ARM device. For cross-compiler setup, please refer to ELDK5.0 +documentation. First, clean up the source code: + + $ make mrproper + +Next, configure U-Boot for M28EVK: + + $ make m28evk_config + +Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special +type of file, which the i.MX28 CPU can boot. This is handled by the following +command: + + $ make u-boot.sb + +HINT: To speed-up the build process, you can add -j, where N is number of + compiler instances that'll run in parallel. + +The code produces "u-boot.sb" file. This file needs to be augmented with a +proper header to allow successful boot from SD or NAND. Adding the header is +discussed in the following chapters. + +3) Installation of U-Boot for M28EVK to SD card +--- + +To boot an M28 from SD, set the boot mode DIP switches according to i.MX28 +manual chapter 12.2.1 (Table 12-2), PORT=SSP0, SD/MMC master on SSP0, 3.3V. + +An SD card the i.MX28 CPU can use to boot U-Boot must contain a DOS partition +table, which in turn carries a partition of special type and which contains a +special header. The rest of partitions in the DOS partition table can be used +by the user. + +To prepare such partition, use your favourite partitioning tool. The partition +must have the following parameters: + + * Start sector .. sector 2048 + * Partition size at least 1024 kb + * Partition type 0x53 (sometimes "OnTrack DM6 Aux3") + +For example in Linux fdisk, the sequence for a clear card is the following: + + * o . create a clear partition table + * n . create new partition + * p . primary partition + * 1 . first partition + * 2048 .. first sector is 2048 + * +1M ... make the partition 1Mb big + * t 1 ... change first partition ID + * 53 change the ID to 0x53 (OnTrack DM6 Aux3) + * + * w . write partition table to disk + +The p
[U-Boot] [PATCH 17/17] M28: Add memory detection into SPL
This code allows the DDR DRAM size to be detected at runtime. The RAM size is stored into two scratch registers, from which it is then fetched in U-Boot. Signed-off-by: Marek Vasut --- board/denx/m28evk/Makefile |7 ++- board/denx/m28evk/m28evk.c | 18 -- board/denx/m28evk/mem_init.c | 27 +++ include/configs/m28evk.h |2 +- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/board/denx/m28evk/Makefile b/board/denx/m28evk/Makefile index 953143a..7bafff5 100644 --- a/board/denx/m28evk/Makefile +++ b/board/denx/m28evk/Makefile @@ -30,7 +30,7 @@ COBJS := m28evk.o endif ifdef CONFIG_SPL_BUILD -COBJS := mem_init.o mmc_boot.o power_init.o +COBJS := mem_init.o mmc_boot.o power_init.o memsize.o endif SRCS := $(COBJS:.o=.c) @@ -47,6 +47,11 @@ clean: distclean: clean rm -f $(LIB) core *.bak .depend +ifdef CONFIG_SPL_BUILD +memsize.c: + ln -sf $(TOPDIR)/common/memsize.c $@ +endif + # # defines $(obj).depend target diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c index 118e222..168ceeb 100644 --- a/board/denx/m28evk/m28evk.c +++ b/board/denx/m28evk/m28evk.c @@ -63,10 +63,24 @@ int board_init(void) return 0; } +#defineHW_DIGCTRL_SCRATCH0 0x8001c280 +#defineHW_DIGCTRL_SCRATCH1 0x8001c290 int dram_init(void) { - /* dram_init must store complete ramsize in gd->ram_size */ - gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); + uint32_t sz[2]; + + sz[0] = readl(HW_DIGCTRL_SCRATCH0); + sz[1] = readl(HW_DIGCTRL_SCRATCH1); + + if (sz[0] != sz[1]) { + printf("MX28:\n" + "Error, the RAM size in HW_DIGCTRL_SCRATCH0 and\n" + "HW_DIGCTRL_SCRATCH1 is not the same. Please\n" + "verify these two registers contain valid RAM size!\n"); + hang(); + } + + gd->ram_size = sz[0]; return 0; } diff --git a/board/denx/m28evk/mem_init.c b/board/denx/m28evk/mem_init.c index 066fe0d..17d1f9b 100644 --- a/board/denx/m28evk/mem_init.c +++ b/board/denx/m28evk/mem_init.c @@ -165,6 +165,31 @@ void mx28_mem_setup_vddd(void) &power_regs->hw_power_vdddctrl); } +#defineHW_DIGCTRL_SCRATCH0 0x8001c280 +#defineHW_DIGCTRL_SCRATCH1 0x8001c290 +void data_abort_memdetect_handler(void) __attribute__((naked)); +void data_abort_memdetect_handler(void) +{ + asm volatile("subs pc, r14, #4"); +} + +void mx28_mem_get_size(void) +{ + uint32_t sz, da; + uint32_t *vt = (uint32_t *)0x20; + + /* Replace the DABT handler. */ + da = vt[4]; + vt[4] = (uint32_t)&data_abort_memdetect_handler; + + sz = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); + writel(sz, HW_DIGCTRL_SCRATCH0); + writel(sz, HW_DIGCTRL_SCRATCH1); + + /* Restore the old DABT handler. */ + vt[4] = da; +} + void mx28_mem_init(void) { struct mx28_clkctrl_regs *clkctrl_regs = @@ -210,4 +235,6 @@ void mx28_mem_init(void) early_delay(1); mx28_mem_setup_cpu_and_hbus(); + + mx28_mem_get_size(); } diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h index 381b01e..c8b0cf5 100644 --- a/include/configs/m28evk.h +++ b/include/configs/m28evk.h @@ -81,7 +81,7 @@ */ #defineCONFIG_NR_DRAM_BANKS1 /* 2 banks of DRAM */ #definePHYS_SDRAM_10x4000 /* Base address */ -#definePHYS_SDRAM_1_SIZE 0x0800 /* 128 MB */ +#definePHYS_SDRAM_1_SIZE 0x4000 /* Max 1 GB RAM */ #defineCONFIG_STACKSIZE0x0001 /* 128 KB stack */ #defineCONFIG_SYS_MALLOC_LEN 0x0040 /* 4 MB for malloc */ #defineCONFIG_SYS_GBL_DATA_SIZE128 /* Initial data */ -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 12/17 V3] iMX28: Add u-boot.sb target to Makefile
Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- .gitignore |1 + Makefile |5 + 2 files changed, 6 insertions(+), 0 deletions(-) V2: Add missing .gitignore entry V3: Use $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd instead of board/denx/m28evk/u-boot.bd path in Makefile diff --git a/.gitignore b/.gitignore index 320d21e..00fd360 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ /u-boot.dis /u-boot.lds /u-boot.ubl +/u-boot.sb # # Generated files diff --git a/Makefile b/Makefile index e9a153c..c1b1265 100644 --- a/Makefile +++ b/Makefile @@ -403,6 +403,10 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin + elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \ + -o $(obj)u-boot.sb + ifeq ($(CONFIG_SANDBOX),y) GEN_UBOOT = \ cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \ @@ -973,6 +977,7 @@ clobber:clean @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.imx @rm -f $(obj)u-boot.ubl + @rm -f $(obj)u-boot.sb @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 08/17 RESEND] iMX28: Add APBH DMA driver
Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- arch/arm/include/asm/arch-mx28/dma.h | 170 +++ arch/arm/include/asm/arch-mx28/imx-regs.h |1 + arch/arm/include/asm/arch-mx28/regs-apbh.h | 466 +++ drivers/dma/Makefile |1 + drivers/dma/apbh_dma.c | 691 5 files changed, 1329 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-mx28/dma.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-apbh.h create mode 100644 drivers/dma/apbh_dma.c diff --git a/arch/arm/include/asm/arch-mx28/dma.h b/arch/arm/include/asm/arch-mx28/dma.h new file mode 100644 index 000..7061e7c --- /dev/null +++ b/arch/arm/include/asm/arch-mx28/dma.h @@ -0,0 +1,170 @@ +/* + * Freescale i.MX28 APBH DMA + * + * Copyright (C) 2011 Marek Vasut + * on behalf of DENX Software Engineering GmbH + * + * Based on code from LTIB: + * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __DMA_H__ +#define __DMA_H__ + +#include + +#ifndefCONFIG_ARCH_DMA_PIO_WORDS +#defineDMA_PIO_WORDS 15 +#else +#defineDMA_PIO_WORDS CONFIG_ARCH_DMA_PIO_WORDS +#endif + +#define MXS_DMA_ALIGNMENT 32 + +/* + * MXS DMA channels + */ +enum { + MXS_DMA_CHANNEL_AHB_APBH_SSP0 = 0, + MXS_DMA_CHANNEL_AHB_APBH_SSP1, + MXS_DMA_CHANNEL_AHB_APBH_SSP2, + MXS_DMA_CHANNEL_AHB_APBH_SSP3, + MXS_DMA_CHANNEL_AHB_APBH_GPMI0, + MXS_DMA_CHANNEL_AHB_APBH_GPMI1, + MXS_DMA_CHANNEL_AHB_APBH_GPMI2, + MXS_DMA_CHANNEL_AHB_APBH_GPMI3, + MXS_DMA_CHANNEL_AHB_APBH_GPMI4, + MXS_DMA_CHANNEL_AHB_APBH_GPMI5, + MXS_DMA_CHANNEL_AHB_APBH_GPMI6, + MXS_DMA_CHANNEL_AHB_APBH_GPMI7, + MXS_DMA_CHANNEL_AHB_APBH_SSP, + MXS_MAX_DMA_CHANNELS, +}; + +/* + * MXS DMA hardware command. + * + * This structure describes the in-memory layout of an entire DMA command, + * including space for the maximum number of PIO accesses. See the appropriate + * reference manual for a detailed description of what these fields mean to the + * DMA hardware. + */ +#defineMXS_DMA_DESC_COMMAND_MASK 0x3 +#defineMXS_DMA_DESC_COMMAND_OFFSET 0 +#defineMXS_DMA_DESC_COMMAND_NO_DMAXFER 0x0 +#defineMXS_DMA_DESC_COMMAND_DMA_WRITE 0x1 +#defineMXS_DMA_DESC_COMMAND_DMA_READ 0x2 +#defineMXS_DMA_DESC_COMMAND_DMA_SENSE 0x3 +#defineMXS_DMA_DESC_CHAIN (1 << 2) +#defineMXS_DMA_DESC_IRQ(1 << 3) +#defineMXS_DMA_DESC_NAND_LOCK (1 << 4) +#defineMXS_DMA_DESC_NAND_WAIT_4_READY (1 << 5) +#defineMXS_DMA_DESC_DEC_SEM(1 << 6) +#defineMXS_DMA_DESC_WAIT4END (1 << 7) +#defineMXS_DMA_DESC_HALT_ON_TERMINATE (1 << 8) +#defineMXS_DMA_DESC_TERMINATE_FLUSH(1 << 9) +#defineMXS_DMA_DESC_PIO_WORDS_MASK (0xf << 12) +#defineMXS_DMA_DESC_PIO_WORDS_OFFSET 12 +#defineMXS_DMA_DESC_BYTES_MASK (0x << 16) +#defineMXS_DMA_DESC_BYTES_OFFSET 16 + +struct mxs_dma_cmd { + unsigned long next; + unsigned long data; + union { + dma_addr_t address; + unsigned long alternate; + }; + unsigned long pio_words[DMA_PIO_WORDS]; +}; + +/* + * MXS DMA command descriptor. + * + * This structure incorporates an MXS DMA hardware command structure, along + * with metadata. + */ +#defineMXS_DMA_DESC_FIRST (1 << 0) +#defineMXS_DMA_DESC_LAST (1 << 1) +#defineMXS_DMA_DESC_READY (1 << 31) + +struct mxs_dma_desc { + struct mxs_dma_cmd cmd; + unsigned intflags; + dma_addr_t address; + void*buffer; + struct list_headnode; +}; + +/** + * MXS DMA channel + * + * This structure represents a single DMA channel. The MXS platform code + * maintains an array of these structures to represent every DMA channel in the + * system (see mxs_dma_channels). + */ +#defineMXS_DMA_FLAGS_IDLE 0 +#
[U-Boot] [PATCH 10/17 RESEND] iMX28: Add driver for internal RTC
Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- drivers/rtc/Makefile |1 + drivers/rtc/mxsrtc.c | 86 ++ 2 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/mxsrtc.c diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index df440c6..391071e 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -57,6 +57,7 @@ COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o COBJS-$(CONFIG_RTC_MV) += mvrtc.o +COBJS-$(CONFIG_RTC_MXS) += mxsrtc.o COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o COBJS-$(CONFIG_RTC_PL031) += pl031.o COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o diff --git a/drivers/rtc/mxsrtc.c b/drivers/rtc/mxsrtc.c new file mode 100644 index 000..5beb1a0 --- /dev/null +++ b/drivers/rtc/mxsrtc.c @@ -0,0 +1,86 @@ +/* + * Freescale i.MX28 RTC Driver + * + * Copyright (C) 2011 Marek Vasut + * on behalf of DENX Software Engineering GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include +#include +#include + +#defineMXS_RTC_MAX_TIMEOUT 100 + +/* Set time in seconds since 1970-01-01 */ +int mxs_rtc_set_time(uint32_t secs) +{ + struct mx28_rtc_regs *rtc_regs = (struct mx28_rtc_regs *)MXS_RTC_BASE; + int ret; + + writel(secs, &rtc_regs->hw_rtc_seconds); + + /* +* The 0x80 here means seconds were copied to analog. This information +* is taken from the linux kernel driver for the STMP37xx RTC since +* documentation doesn't mention it. +*/ + ret = mx28_wait_mask_clr(&rtc_regs->hw_rtc_stat_reg, + 0x80 << RTC_STAT_STALE_REGS_OFFSET, MXS_RTC_MAX_TIMEOUT); + + if (ret) + printf("MXS RTC: Timeout waiting for update\n"); + + return ret; +} + +int rtc_get(struct rtc_time *time) +{ + struct mx28_rtc_regs *rtc_regs = (struct mx28_rtc_regs *)MXS_RTC_BASE; + uint32_t secs; + + secs = readl(&rtc_regs->hw_rtc_seconds); + to_tm(secs, time); + + return 0; +} + +int rtc_set(struct rtc_time *time) +{ + uint32_t secs; + + secs = mktime(time->tm_year, time->tm_mon, time->tm_mday, + time->tm_hour, time->tm_min, time->tm_sec); + + return mxs_rtc_set_time(secs); +} + +void rtc_reset(void) +{ + struct mx28_rtc_regs *rtc_regs = (struct mx28_rtc_regs *)MXS_RTC_BASE; + int ret; + + /* Set time to 1970-01-01 */ + mxs_rtc_set_time(0); + + /* Reset the RTC block */ + ret = mx28_reset_block(&rtc_regs->hw_rtc_ctrl_reg); + if (ret) + printf("MXS RTC: Block reset timeout\n"); +} -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 09/17 RESEND V5] iMX28: Add GPMI NAND driver
Signed-off-by: Marek Vasut Cc: Scott Wood Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel Acked-By: Scott Wood --- drivers/mtd/nand/Makefile |1 + drivers/mtd/nand/mxs_nand.c | 1118 +++ 2 files changed, 1119 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c V2: Update comments, drop inlines V3: Fix descriptor reclamation loop V4: Trim bogus comments V5: Remove redundant mxs_nand_aux_size() function (gcc 4.6 finding) diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index 1eeba5c..a6c746b 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -51,6 +51,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c new file mode 100644 index 000..ce2a326 --- /dev/null +++ b/drivers/mtd/nand/mxs_nand.c @@ -0,0 +1,1118 @@ +/* + * Freescale i.MX28 NAND flash driver + * + * Copyright (C) 2011 Marek Vasut + * on behalf of DENX Software Engineering GmbH + * + * Based on code from LTIB: + * Freescale GPMI NFC NAND Flash Driver + * + * Copyright (C) 2010 Freescale Semiconductor, Inc. + * Copyright (C) 2008 Embedded Alley Solutions, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#defineMXS_NAND_DMA_DESCRIPTOR_COUNT 4 + +#defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE 512 +#defineMXS_NAND_METADATA_SIZE 10 + +#defineMXS_NAND_COMMAND_BUFFER_SIZE32 + +#defineMXS_NAND_BCH_TIMEOUT1 + +struct mxs_nand_info { + int cur_chip; + + uint32_tcmd_queue_len; + + uint8_t *cmd_buf; + uint8_t *data_buf; + uint8_t *oob_buf; + + uint8_t marking_block_bad; + uint8_t raw_oob_mode; + + /* Functions with altered behaviour */ + int (*hooked_read_oob)(struct mtd_info *mtd, + loff_t from, struct mtd_oob_ops *ops); + int (*hooked_write_oob)(struct mtd_info *mtd, + loff_t to, struct mtd_oob_ops *ops); + int (*hooked_block_markbad)(struct mtd_info *mtd, + loff_t ofs); + + /* DMA descriptors */ + struct mxs_dma_desc **desc; + uint32_tdesc_index; +}; + +struct nand_ecclayout fake_ecc_layout; + +static struct mxs_dma_desc *mxs_nand_get_dma_desc(struct mxs_nand_info *info) +{ + struct mxs_dma_desc *desc; + + if (info->desc_index >= MXS_NAND_DMA_DESCRIPTOR_COUNT) { + printf("MXS NAND: Too many DMA descriptors requested\n"); + return NULL; + } + + desc = info->desc[info->desc_index]; + info->desc_index++; + + return desc; +} + +static void mxs_nand_return_dma_descs(struct mxs_nand_info *info) +{ + int i; + struct mxs_dma_desc *desc; + + for (i = 0; i < info->desc_index; i++) { + desc = info->desc[i]; + memset(desc, 0, sizeof(struct mxs_dma_desc)); + desc->address = (dma_addr_t)desc; + } + + info->desc_index = 0; +} + +static uint32_t mxs_nand_ecc_chunk_cnt(uint32_t page_data_size) +{ + return page_data_size / MXS_NAND_CHUNK_DATA_CHUNK_SIZE; +} + +static uint32_t mxs_nand_ecc_size_in_bits(uint32_t ecc_strength) +{ + return ecc_strength * 13; +} + +static uint32_t mxs_nand_aux_status_offset(void) +{ + return (MXS_NAND_METADATA_SIZE + 0x3) & ~0x3; +} + +static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size, + uint32_t page_oob_size) +{ + if (page_data_size == 2048) + return 8; + + if (page_data_size == 4096) { + if (pag