[U-Boot] CONFIG_SYS_FDT_PAD: Why do we need this?
In boot_relocate_fdt() [1] we increase the size of the loaded fdt by a predefined, hard coded CONFIG_SYS_FDT_PAD. The basic idea seem to be to create some space for adding additional information later, like the bootargs. I wonder why we have to do this by a hard coded, predefined value (which is most probably always to large)? Why can't we increase 'totalsize' in the fdt_header just if we add anything? Individually by the size of the element added, at runtime? E.g. by anything like [2]? I debugged a system were #define CONFIG_SYS_FDT_PAD 0x3000 was used. These 0x3000 are added to totalsize before something is added at all. Then, if an element is added, always the whole 0x3000 bytes have to be memmoved additionally. And in the end only ~0x100 additional space was really needed. Best regards Dirk [1] http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=common/image.c;h=8c644b7dacdc9b7a196a5238f4dc5d94bd615d07;hb=HEAD#l1285 [2] static int _fdt_splice_struct(void *fdt, void *p, int oldlen, int newlen) { int delta = newlen - oldlen; int err; if ((err = _fdt_splice(fdt, p, oldlen, newlen))) return err; fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta); fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta); + fdt_set_totalsize(fdt, fdt_totalsize(fdt) + delta); return 0; } in http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=lib/libfdt/fdt_rw.c;h=5c27a677e3536ed7320ee399113666975e5d545b;hb=HEAD#l127 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2] i.MX6: mx6q_sabrelite: add SATA bindings
On 24/03/2012 22:01, Eric Nelson wrote: Hi Stefano, On 03/24/2012 01:19 AM, stefano babic wrote: Am 24/03/2012 08:09, schrieb Dirk Behme: Hi Stefano, Hi Dirk, On 13.03.2012 17:59, Eric Nelson wrote: Signed-off-by: Eric Nelsoneric.nel...@boundarydevices.com Should this patch go into your u-boot-imx.git -next? mmhh...in patchworks this is marked as Changes requested - I do not remember now why, but I have a couple of open questions rereading the patch... Funny how that happens with time. Well, it is not a case ;-). I scan regularly patchwork and I check for not worked patches - however, if a patch is in Changes requested, I expect a new version and I do not care about it. Dirk's message let me convince that the patch was not deeply reviewed and I checked it again. So many thanks to Dirk. diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 1d09a72..5915159 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c snip +u32 reg = 0; +s32 timeout = 10; +struct imx_ccm_reg *const imx_ccm += (struct imx_ccm_reg *) CCM_BASE_ADDR; +struct iomuxc_base_regs *const iomuxc_regs += (struct iomuxc_base_regs *) IOMUXC_BASE_ADDR; + +/* Enable sata clock */ +reg = readl(imx_ccm-CCGR5); /* CCGR5 */ +reg |= MXC_CCM_CCGR5_CG2_MASK; +writel(reg,imx_ccm-CCGR5); + +/* Enable PLLs */ +reg = readl(imx_ccm-analog_pll_enet); +reg= ~BM_ANADIG_PLL_SYS_POWERDOWN; +writel(reg,imx_ccm-analog_pll_enet); +reg |= BM_ANADIG_PLL_SYS_ENABLE; +while (timeout--) { +if (readl(imx_ccm-analog_pll_enet) BM_ANADIG_PLL_SYS_LOCK) +break; +} +if (timeout= 0) +return -1; +reg= ~BM_ANADIG_PLL_SYS_BYPASS; +writel(reg,imx_ccm-analog_pll_enet); +reg |= BM_ANADIG_PLL_ENET_ENABLE_SATA; +writel(reg,imx_ccm-analog_pll_enet); Is it all this part really board specific or mx6 specific ? I would like to split this part into a common and a board specific parts, and making the common part available for other boards. This is all generic MX6 SATA enablement and could be moved into common code. Is cpu/armv7/mx6/clock.c the right place? How about routine named 'enable_sata_clock()'? ok, agree. + +/* Enable sata phy */ +reg = readl(iomuxc_regs-gpr[13]) + (IOMUXC_GPR13_SDMA_STOP_REQ + |IOMUXC_GPR13_CAN2_STOP_REQ + |IOMUXC_GPR13_CAN1_STOP_REQ + |IOMUXC_GPR13_ENET_STOP_REQ); Why do you need to touch CAN bits ? Not touching them, just keeping them the way they are and clearing out the rest (which are all SATA fields). Then these three are superfluous, are not they ? You read the register, and putting in or with IOMUXC_GPR13_CANx_STOP_REQ does nothing. Why do you not use clrsetbits to change the sata bits ? Perhaps this would be clearer: reg = readl(iomuxc-gpr[13]) ~(IOMUXC_GPR13_SATA_PHY_8_MASK |IOMUXC_GPR13_SATA_PHY_7_MASK |IOMUXC_GPR13_SATA_PHY_6_MASK |IOMUXC_GPR13_SATA_SPEED_MASK |IOMUXC_GPR13_SATA_PHY_5_MASK |IOMUXC_GPR13_SATA_PHY_4_MASK |IOMUXC_GPR13_SATA_PHY_3_MASK |IOMUXC_GPR13_SATA_PHY_2_MASK |IOMUXC_GPR13_SATA_PHY_1_MASK); Or better yet, maybe a macro in iomux-v3.h: clrsetbits does exactly what you want, I think. Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] i.MX: fsl_esdhc: allow use with cache enabled.
On 24/03/2012 23:36, Eric Nelson wrote: Hi Stefano, Hi Eric, Sorry I let this linger. On 03/17/2012 03:50 AM, Stefano Babic wrote: On 03/03/2012 23:37, Eric Nelson wrote: Signed-off-by: Eric Nelsoneric.nel...@boundarydevices.com --- Hi Eric, I have added Andy in CC as MMC Maintainer drivers/mmc/fsl_esdhc.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index a2f35e3..8e4bcef 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -190,6 +190,8 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) esdhc_clrsetbits32(regs-wml, WML_RD_WML_MASK, wml_value); esdhc_write32(regs-dsaddr, (u32)data-dest); } else { + flush_dcache_range((ulong)data-src,(ulong)data-src+data-blocks*data-blocksize); This breaks PowerPC boards. Can you tell me how? ./MAKEALL MPC8536DS Configuring for MPC8536DS board... fsl_esdhc.c: In function 'check_and_invalidate_dcache_range': fsl_esdhc.c:255:19: warning: initialization makes integer from pointer without a cast [enabled by default] drivers/mmc/libmmc.o: In function `esdhc_setup_data': /home/stefano/Projects/imx/u-boot-imx/drivers/mmc/fsl_esdhc.c:193: undefined reference to `flush_dcache_range' drivers/mmc/libmmc.o: In function `check_and_invalidate_dcache_range': /home/stefano/Projects/imx/u-boot-imx/drivers/mmc/fsl_esdhc.c:258: undefined reference to `invalidate_dcache_range' make: *** [u-boot] Fehler 1 Main reason is that PowerPC (this is a PowerQuickIII) has a snooping mechanism, and it is enough to set a bit in the SOC to make things working. Maybe can we add these functions as empty in 85xx ? Or we can add an intermediate layer in fsl_eshc.h that manage this, such as fsl_esdhc_flush_dcache_range. This was already done to solve the endianess problem (PowerPC is big endian). Andy, what do you think about ? AFAIK, blocksize needs to be a multiple of 512 so this should be cache-safe with any cacheline size. Yes, I think your changes are correct in the i.MX case. Best regards, Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2] i.MX6: mx6q_sabrelite: add SATA bindings
Hi Stefano, On 03/25/2012 03:17 AM, Stefano Babic wrote: On 24/03/2012 22:01, Eric Nelson wrote: Hi Stefano, On 03/24/2012 01:19 AM, stefano babic wrote: Am 24/03/2012 08:09, schrieb Dirk Behme: Hi Stefano, Hi Dirk, On 13.03.2012 17:59, Eric Nelson wrote: Signed-off-by: Eric Nelsoneric.nel...@boundarydevices.com Should this patch go into your u-boot-imx.git -next? mmhh...in patchworks this is marked as Changes requested - I do not remember now why, but I have a couple of open questions rereading the patch... Funny how that happens with time. Well, it is not a case ;-). I scan regularly patchwork and I check for not worked patches - however, if a patch is in Changes requested, I expect a new version and I do not care about it. Dirk's message let me convince that the patch was not deeply reviewed and I checked it again. So many thanks to Dirk. Ack that thanks to Dirk! diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 1d09a72..5915159 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c snip +if (timeout= 0) +return -1; +reg= ~BM_ANADIG_PLL_SYS_BYPASS; +writel(reg,imx_ccm-analog_pll_enet); +reg |= BM_ANADIG_PLL_ENET_ENABLE_SATA; +writel(reg,imx_ccm-analog_pll_enet); Is it all this part really board specific or mx6 specific ? I would like to split this part into a common and a board specific parts, and making the common part available for other boards. This is all generic MX6 SATA enablement and could be moved into common code. Is cpu/armv7/mx6/clock.c the right place? How about routine named 'enable_sata_clock()'? ok, agree. Will do. + +/* Enable sata phy */ +reg = readl(iomuxc_regs-gpr[13]) +(IOMUXC_GPR13_SDMA_STOP_REQ + |IOMUXC_GPR13_CAN2_STOP_REQ + |IOMUXC_GPR13_CAN1_STOP_REQ + |IOMUXC_GPR13_ENET_STOP_REQ); Why do you need to touch CAN bits ? Not touching them, just keeping them the way they are and clearing out the rest (which are all SATA fields). Then these three are superfluous, are not they ? You read the register, and putting in or with IOMUXC_GPR13_CANx_STOP_REQ does nothing. Why do you not use clrsetbits to change the sata bits ? There's a simple answer for this: I hadn't heard of 'clrsetbits' before. Perhaps this would be clearer: reg = readl(iomuxc-gpr[13]) ~(IOMUXC_GPR13_SATA_PHY_8_MASK |IOMUXC_GPR13_SATA_PHY_7_MASK |IOMUXC_GPR13_SATA_PHY_6_MASK |IOMUXC_GPR13_SATA_SPEED_MASK |IOMUXC_GPR13_SATA_PHY_5_MASK |IOMUXC_GPR13_SATA_PHY_4_MASK |IOMUXC_GPR13_SATA_PHY_3_MASK |IOMUXC_GPR13_SATA_PHY_2_MASK |IOMUXC_GPR13_SATA_PHY_1_MASK); Or better yet, maybe a macro in iomux-v3.h: clrsetbits does exactly what you want, I think. Ok. I'll address in a V2. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/6] add zip command support for uboot
From: Lei Wen lei...@marvell.com This patch set add zip command support for uboot. The first two patches import deflate and trees functions from zlib 1.2.5 without any change. While the third patch did the necessary change to make the import file could be built passed in uboot environment. The fourth patch make us could zip the memory from 0 in the address space. The latter fifth and sixth patch does the adding gzip lib function exporting and zip command support. Patch set test with zipunzip and compared with original memory content. Lei Wen (6): lib: zlib: import deflate source file from 1.2.5 lib: zlib: import trees file from 1.2.5 lib: zlib: include deflate into zlib build lib: zlib: remove the limitation for cannot using 0 as start lib: add gzip lib function callback common: add zip command support common/Makefile |1 + common/cmd_zip.c | 60 ++ include/common.h |7 + include/u-boot/zlib.h | 40 +- lib/Makefile |1 + lib/gzip.c| 143 lib/zlib/deflate.c| 1831 + lib/zlib/deflate.h| 342 + lib/zlib/trees.c | 1244 + lib/zlib/trees.h | 128 lib/zlib/zlib.c |8 + lib/zlib/zutil.h |4 + 12 files changed, 3804 insertions(+), 5 deletions(-) create mode 100644 common/cmd_zip.c create mode 100644 lib/gzip.c create mode 100644 lib/zlib/deflate.c create mode 100644 lib/zlib/deflate.h create mode 100644 lib/zlib/trees.c create mode 100644 lib/zlib/trees.h -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/6] lib: zlib: include deflate into zlib build
From: Lei Wen lei...@marvell.com Add a new config CONFIG_GZIP_ENABLED, if enabled, the uboot bin would include zlib's deflate method which could be used for compressing. Signed-off-by: Lei Wen lei...@marvell.com --- include/u-boot/zlib.h | 40 +++- lib/zlib/trees.c |8 lib/zlib/zlib.c |8 lib/zlib/zutil.h |4 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/include/u-boot/zlib.h b/include/u-boot/zlib.h index fb27081..80639d8 100644 --- a/include/u-boot/zlib.h +++ b/include/u-boot/zlib.h @@ -513,11 +513,41 @@ typedef gz_header FAR *gz_headerp; If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. - */ - -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, - int stream_size)); - + */ + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); + + +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input diff --git a/lib/zlib/trees.c b/lib/zlib/trees.c index 56e9bb1..a0078d0 100644 --- a/lib/zlib/trees.c +++ b/lib/zlib/trees.c @@ -1168,14 +1168,14 @@ local int detect_data_type(s) * method would use a table) * IN assertion: 1 = len = 15 */ -local unsigned bi_reverse(code, len) -unsigned code; /* the value to invert */ +local unsigned bi_reverse(value, len) +unsigned value; /* the value to invert */ int len; /* its bit length */ { register unsigned res = 0; do { -res |= code 1; -code = 1, res = 1; +res |= value 1; +value = 1, res = 1; } while (--len 0); return res 1; } diff --git a/lib/zlib/zlib.c b/lib/zlib/zlib.c index 230d0df..7e15702 100644 --- a/lib/zlib/zlib.c +++ b/lib/zlib/zlib.c @@ -12,6 +12,14 @@ * - added inflateIncomp */ +#include common.h + +#ifdef CONFIG_GZIP_COMPRESSED +#define NO_DUMMY_DECL +#include deflate.c +#include trees.c +#endif + #include zutil.h #include inftrees.h #include inflate.h diff --git a/lib/zlib/zutil.h b/lib/zlib/zutil.h index 114cb74..7e05c3b 100644 --- a/lib/zlib/zutil.h +++ b/lib/zlib/zutil.h @@ -83,6 +83,10 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* The minimum and maximum match lengths */ /* functions */ +#ifdef CONFIG_GZIP_COMPRESSED +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ +# define OS_CODE 0x03 /* assume Unix */ +#endif #include linux/string.h #define zmemcpy memcpy -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/6] lib: zlib: import trees file from 1.2.5
From: Lei Wen lei...@marvell.com Signed-off-by: Lei Wen lei...@marvell.com --- lib/zlib/trees.c | 1244 ++ lib/zlib/trees.h | 128 ++ 2 files changed, 1372 insertions(+), 0 deletions(-) create mode 100644 lib/zlib/trees.c create mode 100644 lib/zlib/trees.h diff --git a/lib/zlib/trees.c b/lib/zlib/trees.c new file mode 100644 index 000..56e9bb1 --- /dev/null +++ b/lib/zlib/trees.c @@ -0,0 +1,1244 @@ +/* trees.c -- output deflated data using Huffman coding + * Copyright (C) 1995-2010 Jean-loup Gailly + * detect_data_type() function provided freely by Cosmin Truta, 2006 + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The deflation process uses several Huffman trees. The more + * common source values are represented by shorter bit sequences. + * + * Each code tree is stored in a compressed form which is itself + * a Huffman encoding of the lengths of all the code strings (in + * ascending order by source values). The actual code strings are + * reconstructed from the lengths in the inflate process, as described + * in the deflate specification. + * + * REFERENCES + * + * Deutsch, L.P.,'Deflate' Compressed Data Format Specification. + * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc + * + * Storer, James A. + * Data Compression: Methods and Theory, pp. 49-50. + * Computer Science Press, 1988. ISBN 0-7167-8156-5. + * + * Sedgewick, R. + * Algorithms, p290. + * Addison-Wesley, 1983. ISBN 0-201-06672-6. + */ + +/* @(#) $Id$ */ + +/* #define GEN_TREES_H */ + +#include deflate.h + +#ifdef DEBUG +# include ctype.h +#endif + +/* === + * Constants + */ + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define END_BLOCK 256 +/* end of block literal code */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_1017 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +local const int extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +local const uch bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +#define Buf_size (8 * 2*sizeof(char)) +/* Number of bits used within bi_buf. (bi_buf might be implemented on + * more than 16 bits on some systems.) + */ + +/* === + * Local data. These are initialized only once. + */ + +#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ + +#if defined(GEN_TREES_H) || !defined(STDC) +/* non ANSI compilers may not accept trees.h */ + +local ct_data static_ltree[L_CODES+2]; +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +local ct_data static_dtree[D_CODES]; +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +uch _dist_code[DIST_CODE_LEN]; +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +uch _length_code[MAX_MATCH-MIN_MATCH+1]; +/* length code for each normalized match length (0 == MIN_MATCH) */ + +local int base_length[LENGTH_CODES]; +/* First normalized length for each code (0 = MIN_MATCH) */ + +local int base_dist[D_CODES]; +/* First normalized distance for each code (0 = distance of 1) */ + +#else +# include trees.h +#endif /* GEN_TREES_H */ + +struct static_tree_desc_s { +const ct_data *static_tree; /* static tree or NULL */ +const intf *extra_bits; /* extra bits for each code or NULL */ +int extra_base; /* base index for extra_bits */ +int elems; /* max number of elements in the tree */ +int max_length; /* max bit length for the codes */ +}; + +local static_tree_desc static_l_desc = +{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; + +local static_tree_desc static_d_desc = +{static_dtree, extra_dbits, 0, D_CODES,
[U-Boot] [PATCH 5/6] lib: add gzip lib function callback
From: Lei Wen lei...@marvell.com Signed-off-by: Lei Wen lei...@marvell.com --- include/common.h |7 +++ lib/Makefile |1 + lib/gzip.c | 143 ++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 lib/gzip.c diff --git a/include/common.h b/include/common.h index 74d9704..31839c3 100644 --- a/include/common.h +++ b/include/common.h @@ -711,6 +711,13 @@ int gunzip(void *, int, unsigned char *, unsigned long *); int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp, int stoponerr, int offset); +/* lib/gzip.c */ +int gzip(void *dst, unsigned long *lenp, + unsigned char *src, unsigned long srclen); +int zzip(void *dst, unsigned long *lenp, unsigned char *src, + unsigned long srclen, int stoponerr, + int (*func)(unsigned long, unsigned long)); + /* lib/net_utils.c */ #include net.h static inline IPaddr_t getenv_IPaddr (char *var) diff --git a/lib/Makefile b/lib/Makefile index e6e6ec6..2f276c9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -41,6 +41,7 @@ COBJS-y += display_options.o COBJS-y += errno.o COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o COBJS-$(CONFIG_GZIP) += gunzip.o +COBJS-$(CONFIG_GZIP_COMPRESSED) += gzip.o COBJS-y += hashtable.o COBJS-$(CONFIG_LMB) += lmb.o COBJS-y += ldiv.o diff --git a/lib/gzip.c b/lib/gzip.c new file mode 100644 index 000..64e275c --- /dev/null +++ b/lib/gzip.c @@ -0,0 +1,143 @@ +/* + * (C) Copyright 2012 + * Lei Wen lei...@marvell.com, Marvell Inc. + * + * 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 common.h +#include watchdog.h +#include command.h +#include image.h +#include malloc.h +#include u-boot/zlib.h +#include zlib/zutil.h + +#ifndef CONFIG_GZIP_COMPRESS_DEF_SZ +#define CONFIG_GZIP_COMPRESS_DEF_SZ0x200 +#endif +#define ZALLOC_ALIGNMENT 16 + +static void *zalloc(void *x, unsigned items, unsigned size) +{ + void *p; + + size *= items; + size = (size + ZALLOC_ALIGNMENT - 1) ~(ZALLOC_ALIGNMENT - 1); + + p = malloc(size); + + return p; +} + +static void zfree(void *x, void *addr, unsigned nb) +{ + free(addr); +} + +int gzip(void *dst, unsigned long *lenp, + unsigned char *src, unsigned long srclen) +{ + return zzip(dst, lenp, src, srclen, 1, NULL); +} + +/* + * Compress blocks with zlib + */ +int zzip(void *dst, unsigned long *lenp, unsigned char *src, + unsigned long srclen, int stoponerr, + int (*func)(unsigned long, unsigned long)) +{ + z_stream s; + int r, flush, orig, window; + unsigned long comp_len, left_len; + + if (!srclen) + return 0; + +#ifndef CONFIG_GZIP + window = MAX_WBITS; +#else + window = 2 * MAX_WBITS; +#endif + orig = *lenp; + s.zalloc = zalloc; + s.zfree = zfree; + s.opaque = Z_NULL; + + r = deflateInit2_(s, Z_BEST_SPEED, Z_DEFLATED, window, + DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + ZLIB_VERSION, sizeof(z_stream)); + if (r != Z_OK) { + printf(Error: deflateInit2_() returned %d\n, r); + return -1; + } + + while (srclen 0) { + comp_len = (srclen CONFIG_GZIP_COMPRESS_DEF_SZ) ? + CONFIG_GZIP_COMPRESS_DEF_SZ : srclen; + + s.next_in = src; + s.avail_in = comp_len; + flush = (srclen CONFIG_GZIP_COMPRESS_DEF_SZ) ? + Z_NO_FLUSH : Z_FINISH; + + do { + left_len = (*lenp CONFIG_GZIP_COMPRESS_DEF_SZ) ? + CONFIG_GZIP_COMPRESS_DEF_SZ : *lenp; + s.next_out = dst; + s.avail_out = left_len; + r = deflate(s, flush); + if (r == Z_STREAM_ERROR stoponerr == 1) { + printf(Error: deflate() returned %d\n, r); + r = -1; + goto bail; + } + if
[U-Boot] [PATCH 4/6] lib: zlib: remove the limitation for cannot using 0 as start
From: Lei Wen lei...@marvell.com We often need the requirement that compressing those memory range start from 0, but the default deflate code in zlib prevent us to do this. Considering the special case of uboot, that it could access all memory range, it is reasonable to be able to also take the address space from 0 into compression. Signed-off-by: Lei Wen lei...@marvell.com --- lib/zlib/deflate.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/lib/zlib/deflate.c b/lib/zlib/deflate.c index 5c4022f..3f7de14 100644 --- a/lib/zlib/deflate.c +++ b/lib/zlib/deflate.c @@ -592,11 +592,8 @@ int ZEXPORT deflate (strm, flush) } s = strm-state; -if (strm-next_out == Z_NULL || -(strm-next_in == Z_NULL strm-avail_in != 0) || -(s-status == FINISH_STATE flush != Z_FINISH)) { +if (s-status == FINISH_STATE flush != Z_FINISH) ERR_RETURN(strm, Z_STREAM_ERROR); -} if (strm-avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); s-strm = strm; /* just in case */ -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/6] common: add zip command support
From: Lei Wen lei...@marvell.com Signed-off-by: Lei Wen lei...@marvell.com --- common/Makefile |1 + common/cmd_zip.c | 60 ++ 2 files changed, 61 insertions(+), 0 deletions(-) create mode 100644 common/cmd_zip.c diff --git a/common/Makefile b/common/Makefile index fd9b3b0..f34d4e5 100644 --- a/common/Makefile +++ b/common/Makefile @@ -162,6 +162,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o endif COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o +COBJS-$(CONFIG_CMD_ZIP) += cmd_zip.o # others ifdef CONFIG_DDR_SPD diff --git a/common/cmd_zip.c b/common/cmd_zip.c new file mode 100644 index 000..18c9e52 --- /dev/null +++ b/common/cmd_zip.c @@ -0,0 +1,60 @@ +/* + * (C) Copyright 2012 + * Lei Wen lei...@marvell.com, Marvell Inc. + * + * 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 common.h +#include command.h + +static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + unsigned long src, dst; + unsigned long src_len, dst_len = ~0UL; + char buf[32]; + + switch (argc) { + case 5: + dst_len = simple_strtoul(argv[4], NULL, 16); + /* fall through */ + case 4: + src = simple_strtoul(argv[1], NULL, 16); + src_len = simple_strtoul(argv[2], NULL, 16); + dst = simple_strtoul(argv[3], NULL, 16); + break; + default: + return cmd_usage(cmdtp); + } + + if (gzip((void *) dst, dst_len, (void *) src, src_len) != 0) + return 1; + + printf(Compressed size: %ld = 0x%lX\n, dst_len, dst_len); + sprintf(buf, %lX, dst_len); + setenv(filesize, buf); + + return 0; +} + +U_BOOT_CMD( + zip,5, 1, do_zip, + zip a memory region, + srcaddr srcsize dstaddr [dstsize] +); -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] doc: Fix some typos in different files
adresses/addresses alernate/alternate asssuming/assuming calcualted/calculated enviroment/environment evalutation/evaluation falsh/flash labled/labeled paramaters/parameters Signed-off-by: Thomas Weber tho...@tomweber.eu --- doc/README.AVR32-port-muxing |4 ++-- doc/README.SNTP |2 +- doc/README.Sandpoint8240 |6 +++--- doc/README.at91 |6 +++--- doc/README.ebony |2 +- doc/README.fsl-ddr |4 ++-- doc/README.mpc832xemds |2 +- doc/README.mpc8360emds |2 +- doc/README.mpc837xemds |2 +- doc/README.mpc8544ds |2 +- doc/README.mpc8572ds |4 ++-- doc/README.mpc85xxads|2 +- doc/README.mvbc_p|2 +- doc/README.mvblm7|4 ++-- doc/README.mvsmr |2 +- doc/README.ocotea|2 +- doc/README.p2020rdb |4 ++-- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/doc/README.AVR32-port-muxing b/doc/README.AVR32-port-muxing index b53799d..8c1718c 100644 --- a/doc/README.AVR32-port-muxing +++ b/doc/README.AVR32-port-muxing @@ -91,7 +91,7 @@ of the flags are the same on all implementations. PORTMUX_DIR_OUTPUT PORTMUX_DIR_INPUT -These mutually-exlusive flags configure the initial direction of the +These mutually-exclusive flags configure the initial direction of the pins. PORTMUX_DIR_OUTPUT means that the pins are driven by the CPU, while PORTMUX_DIR_INPUT means that the pins are tristated by the CPU. These flags are ignored by portmux_select_peripheral(). @@ -125,7 +125,7 @@ PORTMUX_PULL_UP. PORTMUX_DRIVE_HIGH PORTMUX_DRIVE_MAX -These mutually-exlusive flags determine the drive strength of the +These mutually-exclusive flags determine the drive strength of the pins. PORTMUX_DRIVE_MIN will give low power-consumption, but may cause corruption of high-speed signals. PORTMUX_DRIVE_MAX will give high power-consumption, but may be necessary on pins toggling at very high diff --git a/doc/README.SNTP b/doc/README.SNTP index 9edc957..da9ec45 100644 --- a/doc/README.SNTP +++ b/doc/README.SNTP @@ -6,7 +6,7 @@ syncronize RTC of the board. This command needs the command line parameter of server's IP address or environment variable ntpserverip. The network time is sent as UTC. So if you want to set local time to RTC, set the offset in second from UTC to the -enviroment variable time offset. +environment variable time offset. If the DHCP server provides time server's IP or time offset, you don't need to set the above environment variables yourself. diff --git a/doc/README.Sandpoint8240 b/doc/README.Sandpoint8240 index a41b69a..fa846dc 100644 --- a/doc/README.Sandpoint8240 +++ b/doc/README.Sandpoint8240 @@ -236,7 +236,7 @@ PART 10) = setenv serverip 192.168.0.10 = setenv gatewayip=192.168.0.1 = saveenv -Saving Enviroment to Flash... +Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... done @@ -296,7 +296,7 @@ Erase Flash Bank # 2 - missing = cp.b 0x10 FFF0 1f28c Copy to Flash... done = saveenv -Saving Enviroment to Flash... +Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... done @@ -330,7 +330,7 @@ Erase Flash from 0xfff0 to 0xfff3 done Erased 7 sectors Copy to Flash... done -Saving Enviroment to Flash... +Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... done diff --git a/doc/README.at91 b/doc/README.at91 index 84b5595..b51df00 100644 --- a/doc/README.at91 +++ b/doc/README.at91 @@ -62,16 +62,16 @@ Environment variables U-Boot environment variables can be stored at different places: - Dataflash on SPI chip select 0 (dataflash card) - Nand flash. - - Nor falsh (not populate by default) + - Nor flash (not populate by default) You can choose your storage location at config step (here for at91sam9260ek) : make at91sam9263ek_config - use data flash (spi cs0) (default) make at91sam9263ek_nandflash_config - use nand flash make at91sam9263ek_dataflash_cs0_config - use data flash (spi cs0) - make at91sam9263ek_norflash_config - use nor falsh + make at91sam9263ek_norflash_config - use nor flash You can choose to boot directly from U-Boot at config step - make at91sam9263ek_norflash_boot_config - boot from nor falsh + make at91sam9263ek_norflash_boot_config - boot from nor flash -- diff --git a/doc/README.ebony b/doc/README.ebony index a8479a4..4df00b3 100644 --- a/doc/README.ebony +++ b/doc/README.ebony @@ -4,7 +4,7 @@ === This file contains some handy info regarding U-Boot and the AMCC -Ebony evalutation
[U-Boot] BIOS EMULATOR driver
Hello, I'm working on one project about bios emulator and I notice that this driver is linked for boards P1022DS and sequoia too, but they don't really use any methods of it. It's safe to remove this support from configs files? Whole this driver is seems to be imported from somewhere and lots of its code is unused Actually only one method is used. It's safe to clean this too? Thanks for answer Viktor Krivak ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] BIOS EMULATOR driver
Dear Viktor, In message CAJxx_ay7FAz-SJ0k2cBqWd1meVhDqm6vtESy=T6f9rs=kat...@mail.gmail.com you wrote: I'm working on one project about bios emulator and I notice that this driver is linked for boards P1022DS and sequoia too, but they don't really use any methods of it. It's safe to remove this support from configs files? Are you sure that the code is not used? sequoia: #define CONFIG_BIOSEMU /* x86 bios emulator for vga bios */ #define CONFIG_ATI_RADEON_FB/* use radeon framebuffer driver */ ... P1022DS: #define CONFIG_BIOSEMU ... #define CONFIG_ATI_RADEON_FB These boards enable the BIOS emulator to initialize the BIOS on ATI Radeon graphics cards; CONFIG_ATI_RADEON_FB causes that ati_radeon_fb (drivers/video/ati_radeon_fb.c) gets included; this code calls (among other things) BootVideoCardBIOS() ... Whole this driver is seems to be imported from somewhere and lots of its code is unused Actually only one method is used. It's safe to clean this too? If you disable all the graphics code, yes. 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 reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v5] kirkwood: add NAS62x0 board support
Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220. Only difference between boards is number of SATA ports. More information about the boards can be found here: http://www.raidsonic.de/en/products/nas-systems.php?we_objectID=7036 http://www.raidsonic.de/en/products/nas-systems.php?we_objectID=7515 Signed-off-by: Luka Perkov ub...@lukaperkov.net Signed-off-by: Gerald Kerma drea...@doukki.net Signed-off-by: Simon Baatz gmbno...@gmail.com --- Changes from version v1: * use tools/checkpatch.pl to locate patch errors and fix them * add two entries in boards.cfg, one for each board * fixed CONFIG_RESET_PHY_R * don't define values for macros that enable features only * remove static RAM configuration * fix comments * use only CONFIG_ENV_OFFSET and remove CONFIG_ENV_ADDR * clean coding style * add entry in MAINTAINERS file Changes from version v2: * use defined() in macros for board selection for robustness Changes from version v3: * don't use utf8 for Geralds name * don't mix upper/lower case in kwbimage.cfg * fix prompt Changes from version v4: * fix board Makefile (clean and distclean) * use generic way to handle arch number of the board * fix MAINTAINERS file * move code from Marvell to raidsonic folder * use CONFIG_MACH_TYPE * set only necessary GPIOs * use link instead of address for license * add few links about board being supported for quick reference * add previous change logs * multiple updates to kwbimage.cfg, thank you Simon About kwbimage.cfg - first version was taken from sheevaplug with change only regarding memory. Now it's rewriten so it uses settings like manufacturer. MAINTAINERS |5 + board/raidsonic/ib62x0/Makefile | 43 + board/raidsonic/ib62x0/ib62x0.c | 79 board/raidsonic/ib62x0/ib62x0.h | 40 board/raidsonic/ib62x0/kwbimage.cfg | 172 +++ boards.cfg |2 + include/configs/ib62x0.h| 172 +++ 7 files changed, 513 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 46f63a0..deb093e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -782,6 +782,11 @@ Linus Walleij linus.wall...@linaro.org integratorapvarious integratorcpvarious +Luka Perkov ub...@lukaperkov.net + + ib6210 ARM926EJS + ib6220 ARM926EJS + Dave Peverley dpever...@mpc-data.co.uk omap730p2 ARM926EJS diff --git a/board/raidsonic/ib62x0/Makefile b/board/raidsonic/ib62x0/Makefile new file mode 100644 index 000..d450f8d --- /dev/null +++ b/board/raidsonic/ib62x0/Makefile @@ -0,0 +1,43 @@ +# +# (C) Copyright 2009 +# Marvell Semiconductor www.marvell.com +# Written-by: Prafulla Wadaskar prafu...@marvell.com +# +# 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, see http://www.gnu.org/licenses/. +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := ib62x0.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/raidsonic/ib62x0/ib62x0.c b/board/raidsonic/ib62x0/ib62x0.c new file mode 100644 index 000..65f2c2e --- /dev/null +++ b/board/raidsonic/ib62x0/ib62x0.c @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011-2012 + * Gerald Kerma drea...@doukki.net + * Luka Perkov ub...@lukaperkov.net + * Simon Baatz gmbno...@gmail.com + * + * 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 +
Re: [U-Boot] [PATCH V4] net: fec_mxc: allow use with cache enabled
Hi Marek, Have you had a chance to review this V4 patch for the fec_mxc driver? http://lists.denx.de/pipermail/u-boot/2012-March/120205.html Note that Stefano pointed out yesterday that PPC doesn't properly implement invalidate_dcache_range. http://lists.denx.de/pipermail/u-boot/2012-March/120918.html I believe you mentioned previously that the fec_mxc driver was compatible with certain PPC SOCs, so this might temporarily block any such transition. Please advise, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] pci: declare pciauto functions in header
The FSL PCI driver uses local prototypes for pciauto_[pre|post]scan_setup_bridge(), this does not seem right, so move them to the pci.h file. Fixed a small extern declaration too, this is harmless but distracts the view since all other prototypes are explicitly external. Signed-off-by: Linus Walleij linus.wall...@linaro.org --- drivers/pci/fsl_pci_init.c |5 - include/pci.h |6 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index d04a08c..1d75a82 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -47,11 +47,6 @@ DECLARE_GLOBAL_DATA_PTR; #define FSL_PCIE_CFG_RDY 0x4b0 #define FSL_PROG_IF_AGENT 0x1 -void pciauto_prescan_setup_bridge(struct pci_controller *hose, - pci_dev_t dev, int sub_bus); -void pciauto_postscan_setup_bridge(struct pci_controller *hose, - pci_dev_t dev, int sub_bus); - #ifndef CONFIG_SYS_PCI_MEMORY_BUS #define CONFIG_SYS_PCI_MEMORY_BUS 0 #endif diff --git a/include/pci.h b/include/pci.h index 7d98ad4..eba122f 100644 --- a/include/pci.h +++ b/include/pci.h @@ -527,8 +527,12 @@ extern void pciauto_setup_device(struct pci_controller *hose, struct pci_region *mem, struct pci_region *prefetch, struct pci_region *io); +extern void pciauto_prescan_setup_bridge(struct pci_controller *hose, +pci_dev_t dev, int sub_bus); +extern void pciauto_postscan_setup_bridge(struct pci_controller *hose, +pci_dev_t dev, int sub_bus); extern void pciauto_config_init(struct pci_controller *hose); -int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev); +extern int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev); extern pci_dev_t pci_find_device (unsigned int vendor, unsigned int device, int index); extern pci_dev_t pci_find_devices (struct pci_device_id *ids, int index); -- 1.7.7.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] pci: get rid of local prototypes
two boards were redeclaring pciauto_region_allocate() in their local scope for no obvious reason, the function is in pci.h anyway, this is probably just copying artifacts and old cruft. Signed-off-by: Linus Walleij linus.wall...@linaro.org --- board/esd/cpci750/pci.c |4 board/prodrive/p3mx/pci.c |4 2 files changed, 0 insertions(+), 8 deletions(-) diff --git a/board/esd/cpci750/pci.c b/board/esd/cpci750/pci.c index 24ab13f..840385c 100644 --- a/board/esd/cpci750/pci.c +++ b/board/esd/cpci750/pci.c @@ -28,10 +28,6 @@ #ifdef CONFIG_PCI #include pci.h -#ifdef CONFIG_PCI_PNP -int pciauto_region_allocate(struct pci_region* res, unsigned int size, unsigned int *bar); -#endif - #include ../../Marvell/include/pci.h #undef DEBUG diff --git a/board/prodrive/p3mx/pci.c b/board/prodrive/p3mx/pci.c index 712c21c..7f4604b 100644 --- a/board/prodrive/p3mx/pci.c +++ b/board/prodrive/p3mx/pci.c @@ -28,10 +28,6 @@ #ifdef CONFIG_PCI #include pci.h -#ifdef CONFIG_PCI_PNP -int pciauto_region_allocate(struct pci_region* res, unsigned int size, unsigned int *bar); -#endif - #include ../../Marvell/include/pci.h #undef DEBUG -- 1.7.7.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4] net: fec_mxc: allow use with cache enabled
Dear Eric Nelson, Hi Marek, Have you had a chance to review this V4 patch for the fec_mxc driver? http://lists.denx.de/pipermail/u-boot/2012-March/120205.html If I didn't review, I was probably fine with it as it was ;-) Though I think I acked it. Note that Stefano pointed out yesterday that PPC doesn't properly implement invalidate_dcache_range. http://lists.denx.de/pipermail/u-boot/2012-March/120918.html I believe you mentioned previously that the fec_mxc driver was compatible with certain PPC SOCs, so this might temporarily block any such transition. Please advise, Eric Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] (no subject)
These two patches split the previous patch http://lists.denx.de/pipermail/u-boot/2012-March/120150.html into two parts. The first is board-independent and will be useful on all i.MX6 boards. The second is specific to the mx6qsabrelite board. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] i.MX6: mx6q_sabrelite: add SATA bindings
V2 has been stripped of the board-independent changes and uses clrsetbits_le32() instead of twiddling bits by hand. Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com --- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 32 + include/configs/mx6qsabrelite.h | 13 ++ 2 files changed, 45 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 1d09a72..afb1245 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -25,6 +25,8 @@ #include asm/arch/imx-regs.h #include asm/arch/mx6x_pins.h #include asm/arch/iomux-v3.h +#include asm/arch/ccm_regs.h +#include asm/arch/clock.h #include asm/errno.h #include asm/gpio.h #include mmc.h @@ -267,6 +269,32 @@ int board_eth_init(bd_t *bis) return 0; } +#ifdef CONFIG_CMD_SATA + +int setup_sata(void) +{ + int rval = enable_sata_clock(); + if (rval == 0) { + struct iomuxc_base_regs *const iomuxc_regs + = (struct iomuxc_base_regs *) IOMUXC_BASE_ADDR; + clrsetbits_le32(iomuxc_regs-gpr[13], + IOMUXC_GPR13_SATA_MASK, + IOMUXC_GPR13_SATA_PHY_8_RXEQ_3P0DB + |IOMUXC_GPR13_SATA_PHY_7_SATA2M + |IOMUXC_GPR13_SATA_SPEED_3G + |(3IOMUXC_GPR13_SATA_PHY_6_SHIFT) + |IOMUXC_GPR13_SATA_SATA_PHY_5_SS_DISABLED + |IOMUXC_GPR13_SATA_SATA_PHY_4_ATTEN_9_16 + |IOMUXC_GPR13_SATA_PHY_3_TXBOOST_0P00_DB + |IOMUXC_GPR13_SATA_PHY_2_TX_1P104V + |IOMUXC_GPR13_SATA_PHY_1_SLOW); + rval = 0; + } + + return rval; +} +#endif + int board_early_init_f(void) { setup_iomux_uart(); @@ -283,6 +311,10 @@ int board_init(void) setup_spi(); #endif +#ifdef CONFIG_CMD_SATA + setup_sata(); +#endif + return 0; } diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h index c851559..a3c97c6 100644 --- a/include/configs/mx6qsabrelite.h +++ b/include/configs/mx6qsabrelite.h @@ -71,6 +71,19 @@ #define CONFIG_CMD_FAT #define CONFIG_DOS_PARTITION +#define CONFIG_CMD_SATA +/* + * SATA Configs + */ +#ifdef CONFIG_CMD_SATA +#define CONFIG_DWC_AHSATA +#define CONFIG_SYS_SATA_MAX_DEVICE 1 +#define CONFIG_DWC_AHSATA_PORT_ID 0 +#define CONFIG_DWC_AHSATA_BASE_ADDRSATA_ARB_BASE_ADDR +#define CONFIG_LBA48 +#define CONFIG_LIBATA +#endif + #define CONFIG_CMD_PING #define CONFIG_CMD_DHCP #define CONFIG_CMD_MII -- 1.7.9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] i.MX6: add enable_sata_clock()
Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com --- This patch requires Stefano's driver for MX5/MX6 to be useful. http://lists.denx.de/pipermail/u-boot/2012-February/118530.html This is the first and board-independent part of what's needed to enable SATA on an i.MX6 board as discussed in this thread: http://lists.denx.de/pipermail/u-boot/2012-March/120919.html arch/arm/cpu/armv7/mx6/clock.c | 31 arch/arm/include/asm/arch-mx6/clock.h|1 + arch/arm/include/asm/arch-mx6/imx-regs.h |9 +++ arch/arm/include/asm/arch-mx6/iomux-v3.h | 111 ++ 4 files changed, 152 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c index ef98563..0ec4c15 100644 --- a/arch/arm/cpu/armv7/mx6/clock.c +++ b/arch/arm/cpu/armv7/mx6/clock.c @@ -303,6 +303,37 @@ u32 imx_get_fecclk(void) return decode_pll(PLL_ENET, CONFIG_SYS_MX6_HCLK); } +int enable_sata_clock(void) +{ + u32 reg = 0; + s32 timeout = 10; + struct imx_ccm_reg *const imx_ccm + = (struct imx_ccm_reg *) CCM_BASE_ADDR; + + /* Enable sata clock */ + reg = readl(imx_ccm-CCGR5); /* CCGR5 */ + reg |= MXC_CCM_CCGR5_CG2_MASK; + writel(reg, imx_ccm-CCGR5); + + /* Enable PLLs */ + reg = readl(imx_ccm-analog_pll_enet); + reg = ~BM_ANADIG_PLL_SYS_POWERDOWN; + writel(reg, imx_ccm-analog_pll_enet); + reg |= BM_ANADIG_PLL_SYS_ENABLE; + while (timeout--) { + if (readl(imx_ccm-analog_pll_enet) BM_ANADIG_PLL_SYS_LOCK) + break; + } + if (timeout = 0) + return -1; + reg = ~BM_ANADIG_PLL_SYS_BYPASS; + writel(reg, imx_ccm-analog_pll_enet); + reg |= BM_ANADIG_PLL_ENET_ENABLE_SATA; + writel(reg, imx_ccm-analog_pll_enet); + + return 0 ; +} + unsigned int mxc_get_clock(enum mxc_clock clk) { switch (clk) { diff --git a/arch/arm/include/asm/arch-mx6/clock.h b/arch/arm/include/asm/arch-mx6/clock.h index 613809b..b91d8bf 100644 --- a/arch/arm/include/asm/arch-mx6/clock.h +++ b/arch/arm/include/asm/arch-mx6/clock.h @@ -47,5 +47,6 @@ u32 imx_get_uartclk(void); u32 imx_get_fecclk(void); unsigned int mxc_get_clock(enum mxc_clock clk); void enable_usboh3_clk(unsigned char enable); +int enable_sata_clock(void); #endif /* __ASM_ARCH_CLOCK_H */ diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 1033d05..f72e753 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -438,5 +438,14 @@ struct anatop_regs { u32 digprog;/* 0x260 */ }; +struct iomuxc_base_regs { + u32 gpr[14];/* 0x000 */ + u32 obsrv[5]; /* 0x038 */ + u32 swmux_ctl[197]; /* 0x04c */ + u32 swpad_ctl[250]; /* 0x360 */ + u32 swgrp[26]; /* 0x748 */ + u32 daisy[104]; /* 0x7b0..94c */ +}; + #endif /* __ASSEMBLER__*/ #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */ diff --git a/arch/arm/include/asm/arch-mx6/iomux-v3.h b/arch/arm/include/asm/arch-mx6/iomux-v3.h index 4558f4f..788b413 100644 --- a/arch/arm/include/asm/arch-mx6/iomux-v3.h +++ b/arch/arm/include/asm/arch-mx6/iomux-v3.h @@ -100,4 +100,115 @@ typedef u64 iomux_v3_cfg_t; int imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad); int imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count); +/* + * IOMUXC_GPR13 bit fields + */ +#define IOMUXC_GPR13_SDMA_STOP_REQ (130) +#define IOMUXC_GPR13_CAN2_STOP_REQ (129) +#define IOMUXC_GPR13_CAN1_STOP_REQ (128) +#define IOMUXC_GPR13_ENET_STOP_REQ (127) +#define IOMUXC_GPR13_SATA_PHY_8_MASK (724) +#define IOMUXC_GPR13_SATA_PHY_7_MASK (0x1f19) +#define IOMUXC_GPR13_SATA_PHY_6_SHIFT 16 +#define IOMUXC_GPR13_SATA_PHY_6_MASK (7IOMUXC_GPR13_SATA_PHY_6_SHIFT) +#define IOMUXC_GPR13_SATA_SPEED_MASK (115) +#define IOMUXC_GPR13_SATA_PHY_5_MASK (114) +#define IOMUXC_GPR13_SATA_PHY_4_MASK (711) +#define IOMUXC_GPR13_SATA_PHY_3_MASK (0x1f7) +#define IOMUXC_GPR13_SATA_PHY_2_MASK (0x1f2) +#define IOMUXC_GPR13_SATA_PHY_1_MASK (30) + +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_0P5DB (0b00024) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_1P0DB (0b00124) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_1P5DB (0b01024) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_2P0DB (0b01124) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_2P5DB (0b10024) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_3P0DB (0b10124) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_3P5DB (0b11024) +#define IOMUXC_GPR13_SATA_PHY_8_RXEQ_4P0DB (0b11124) + +#define IOMUXC_GPR13_SATA_PHY_7_SATA1I (0b119) +#define IOMUXC_GPR13_SATA_PHY_7_SATA1M (0b119) +#define IOMUXC_GPR13_SATA_PHY_7_SATA1X (0b1101019) +#define IOMUXC_GPR13_SATA_PHY_7_SATA2I (0b1001019) +#define IOMUXC_GPR13_SATA_PHY_7_SATA2M (0b1001019) +#define
Re: [U-Boot] [PATCH V3 0/2] i.MX6: mx6q_sabrelite: add SATA bindings
On 03/25/2012 04:00 PM, Eric Nelson wrote: These two patches split the previous patch http://lists.denx.de/pipermail/u-boot/2012-March/120150.html into two parts. The first is board-independent and will be useful on all i.MX6 boards. The second is specific to the mx6qsabrelite board. Sorry about the prior e-mail. It looks like I botched the header. I'm still trying to figure out this 'git send-email' thing. This should say that the following two patches are V3 of a patch originally titled i.MX6: mx6q_sabrelite: add SATA bindings, though the title doesn't match because only the second is board-specific. http://lists.denx.de/pipermail/u-boot/2012-March#120150 Regards, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4] net: fec_mxc: allow use with cache enabled
On 03/25/2012 03:44 PM, Marek Vasut wrote: Dear Eric Nelson, Hi Marek, Have you had a chance to review this V4 patch for the fec_mxc driver? http://lists.denx.de/pipermail/u-boot/2012-March/120205.html If I didn't review, I was probably fine with it as it was ;-) Though I think I acked it. Thanks Marek, I was trying to clean up my Changes requested items in patchwork to keep Graeme happy and it appears that this wasn't acked. http://patchwork.ozlabs.org/patch/146658/ I think Mike also hinted at an ack of V3: http://lists.denx.de/pipermail/u-boot/2012-March/120217.html Regards, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4] net: fec_mxc: allow use with cache enabled
Dear Eric Nelson, ensure that transmit and receive buffers are cache-line aligned invalidate cache for each packet as received update receive buffer descriptors one cache line at a time flush cache before transmitting Original patch by Marek: http://lists.denx.de/pipermail/u-boot/2012-February/117695.html Signed-off-by: Eric Nelson eric.nelson at boundarydevices.com --- V2 addresses some concerns from the ML: - Use readl()/writel() instead of mapped data structure accesses - Wrong comment style - rbd_base[0] == rbd_base removed 'volatile' from fec_send(). V3 updates from ML (and Marek): consolidated CONFIG_FEC_DATA_ALIGNMENT and CONFIG_FEC_DESC_ALIGNMENT added cache flushes after initialization of TBD/RBD V4 updates from ML http://lists.denx.de/pipermail/u-boot/2012-March#120139 remove tabs after #define/#if/#error replace CONFIG_FEC_ALIGN with ARCH_DMA_MINALIGN Acked-by: Marek Vasut ma...@denx.de Didn't I ack some previous version? Maybe I even added tested-by to some previous version ;-) Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] cmd_fat: add FAT write command
On 3/25/12, Anatolij Gustschin ag...@denx.de wrote: On Thu, 22 Mar 2012 15:38:56 +0100 Maximilian Schwerin m...@tigris.de wrote: Once CONFIG_FAT_WRITE is defined, users can invoke 'fatwrite' command that saves data in RAM as a FAT file. This patch was originally part of http://article.gmane.org/gmane.comp.boot-loaders.u-boot/121847 Reported-by: Donggeun Kim dg77@samsung.com Cc: Kyungmin Park kyungmin.p...@samsung.com --- README |8 +- common/cmd_fat.c | 57 ++ 2 files changed, 63 insertions(+), 2 deletions(-) Applied to u-boot-staging/ag...@denx.de after fixing attribution tags and a typo. Thanks. Hmm, emails to dg77@samsung.com address are now rejected: Recipient address rejected: User unknown (in reply to RCPT TO command) Hi, FYI: Now Mr. Kim is left the company. So if any issue and codes from Mr. Kim, then let me follow up. Thank you, Kyungmin Park +printf(%ld bytes write\n, size); typo fixed, s/write/written/ Thanks, Anatolij ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-sh/master
Dear Wolfgang Denk. Please pull u-boot-sh/master. The following changes since commit 7cb30b13f12077c7eec8ce2419cd96cd65ace8e2: Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash (2012-03-23 21:59:16 +0100) are available in the git repository at: git://git.denx.de/u-boot-sh.git master for you to fetch changes up to 75d79840ff8ea4e5a21b2b343f0316c57354897d: sh: Fix building ecovec board (2012-03-26 10:09:31 +0900) Nobuhiro Iwamatsu (4): sh: Add header file for interface of SH MMC sh: sh7757lcr: Add MMC header file of SH sh: Add header file of MMC framework sh: ecovec: Remove unused variable Phil Edworthy (1): sh: Fix building ecovec board Yoshihiro Shimoda (2): sh: sh7757lcr: add supporting for MMCIF sh_spi: Add 4 chip select signals supporting arch/sh/include/asm/mmc.h | 18 ++ arch/sh/lib/board.c |1 + board/renesas/ecovec/Makefile |8 ++-- board/renesas/ecovec/ecovec.c |1 - board/renesas/sh7757lcr/sh7757lcr.c |6 ++ doc/README.sh7757lcr|1 + drivers/spi/sh_spi.c| 19 --- drivers/spi/sh_spi.h|4 +++- include/configs/sh7757lcr.h | 11 +++ 9 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 arch/sh/include/asm/mmc.h -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Loading kernel from usb
Dear Calvin Boyd, * please always CC the mailing list! * please avoid top-posting! Dear Marek Vasut, I tried using the CONFIG_CMD_USB to enable the use of the usb commands from the u-boot command prompt. However, I am getting compilation errors: drivers/usb/host/libusb_host.a(ehci-hcd.o): In function `usb_lowlevel_init': ehci-hcd.c:(.text+0x5d4): undefined reference to `ehci_hcd_init' drivers/usb/host/libusb_host.a(ehci-hcd.o): In function `usb_lowlevel_stop': ehci-hcd.c:(.text+0x850): undefined reference to `ehci_hcd_stop' make: *** [u-boot] Error 1 You also need to enable driver for your USB host controller. Regards, Calvin Boyd From: marek.va...@gmail.com To: u-boot@lists.denx.de Subject: Re: [U-Boot] Loading kernel from usb Date: Sun, 25 Mar 2012 01:41:30 +0100 CC: calvin_b...@hotmail.com Dear Calvin Boyd, I am currently working on a project and I am trying to load the kernel from usb instead of an sd card. How do you configure u-boot to support usb commands? Why don't you attempt to please read the documentation first? Try CONFIG_CMD_USB for starters. Best regards, Marek Vasut Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4] net: fec_mxc: allow use with cache enabled
On 03/25/2012 04:57 PM, Marek Vasut wrote: Dear Eric Nelson, ensure that transmit and receive buffers are cache-line aligned invalidate cache for each packet as received update receive buffer descriptors one cache line at a time flush cache before transmitting Original patch by Marek: http://lists.denx.de/pipermail/u-boot/2012-February/117695.html Signed-off-by: Eric Nelsoneric.nelson at boundarydevices.com --- snip V4 updates from ML http://lists.denx.de/pipermail/u-boot/2012-March#120139 remove tabs after #define/#if/#error replace CONFIG_FEC_ALIGN with ARCH_DMA_MINALIGN Acked-by: Marek Vasutma...@denx.de Didn't I ack some previous version? Maybe I even added tested-by to some previous version ;-) Thanks Marek, I couldn't find an official ack of the whole thing, though most of the code structure came from you and were acked in parts. I'm just trying to push it into the end zone so we can get completely cache-enabled on i.MX6. Regards, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] kobs-ng tool?
Can some give a clue how to use this tool? It used to flash NAND chips with u-boot. The I use is mx53_ard. - bud ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] BIOS EMULATOR driver
Dear Wolfgang, I'm working on one project about bios emulator and I notice that this driver is linked for boards P1022DS and sequoia too, but they don't really use any methods of it. It's safe to remove this support from configs files? Are you sure that the code is not used? I pretty sure because I try compile it without this driver and everything seems to be ok. Best regards, Wolfgang Denk Best regards Viktor Krivak ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Enable high speed support for USB device framework and usbtty
On 3/19/2012 3:58 PM, Marek Vasut wrote: Dear Shiraz Hashim, Hi Marek, On Mon, Mar 19, 2012 at 06:57:29AM +0800, Marek Vasut wrote: Hi, Yes, ep0.c has direct access to the device field. I'll omit the usbd_device_qualifier_descriptor function in V2. How's V2 going? Unfortunately Amit is not well and he is taking rest. He would resume on this from next week. Please forward him that I wish him getting better ASAP. Thanks for your wishes Marek, I'm well now and back to office! I shall finish sending V2 of all the patches I have sent till date, within a couple of days. Best Regards Amit Virdi ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] ColdFire: Update the bitops for ColdFire platform
This patch uses the general ffs definition to replace the platform ffs definition. This patch also fixes the build error by adding hweightN definition for m5329evb and m5373evb. Signed-off-by: Jason Jin jason@freescale.com Signed-off-by: Alison Wang b18...@freescale.com --- arch/m68k/include/asm/bitops.h | 59 ++- 1 files changed, 27 insertions(+), 32 deletions(-) diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h index ad971b4..525d90c 100644 --- a/arch/m68k/include/asm/bitops.h +++ b/arch/m68k/include/asm/bitops.h @@ -17,41 +17,36 @@ extern int test_and_change_bit(int nr, volatile void *addr); #ifdef __KERNEL__ -/* - * ffs: find first bit set. This is defined the same way as - * the libc and compiler builtin ffs routines, therefore - * differs in spirit from the above ffz (man ffs). - */ -extern __inline__ int ffs(int x) + +extern inline int test_bit(int nr, __const__ volatile void *addr) { - int r = 1; - - if (!x) - return 0; - if (!(x 0x)) { - x = 16; - r += 16; - } - if (!(x 0xff)) { - x = 8; - r += 8; - } - if (!(x 0xf)) { - x = 4; - r += 4; - } - if (!(x 3)) { - x = 2; - r += 2; - } - if (!(x 1)) { - x = 1; - r += 1; - } - return r; + __const__ unsigned int *p = (__const__ unsigned int *) addr; + + return (p[nr 5] (1UL (nr 31))) != 0; } + +extern inline int test_and_set_bit(int nr, volatile void *vaddr) +{ + char retval; + + volatile char *p = ((volatile char *)vaddr)[(nr^31) 3]; + __asm__ __volatile__ (bset %2,(%4); sne %0 +: =d (retval), =m (*p) +: di (nr 7), m (*p), a (p)); + + return retval; +} + #define __ffs(x) (ffs(x) - 1) -#define PLATFORM_FFS + +/* + * * hweightN: returns the hamming weight (i.e. the number + * * of bits set) of a N-bit word + **/ + +#define hweight32(x) generic_hweight32(x) +#define hweight16(x) generic_hweight16(x) +#define hweight8(x) generic_hweight8(x) #endif /* __KERNEL__ */ -- 1.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] ColdFire: Rename NANDFLASH_SIZE into CONFIG_NANDFLASH_SIZE for MCF537x
This patch fixes the build error for MCF537x. As the NANDFLASH_SIZE is redefined in boards.cfg, it is needed to rename NANDFLASH_SIZE into CONFIG_NANDFLASH_SIZE in include/configs/M5373EVB.h. Signed-off-by: Alison Wang b18...@freescale.com --- include/configs/M5373EVB.h | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h index d0044b1..17a6773 100644 --- a/include/configs/M5373EVB.h +++ b/include/configs/M5373EVB.h @@ -1,7 +1,7 @@ /* * Configuation settings for the Freescale MCF5373 FireEngine board. * - * Copyright (C) 2004-2007 Freescale Semiconductor, Inc. + * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc. * TsiChung Liew (tsi-chung.l...@freescale.com) * * See file CREDITS for list of people who contributed to this @@ -60,7 +60,7 @@ #define CONFIG_CMD_PING #define CONFIG_CMD_REGINFO -#ifdef NANDFLASH_SIZE +#ifdef CONFIG_NANDFLASH_SIZE # define CONFIG_CMD_NAND #endif @@ -209,7 +209,7 @@ # define CONFIG_SYS_FLASH_PROTECTION /* Real (hardware) sectors protection */ #endif -#ifdef NANDFLASH_SIZE +#ifdef CONFIG_NANDFLASH_SIZE # define CONFIG_SYS_MAX_NAND_DEVICE 1 # define CONFIG_SYS_NAND_BASE CONFIG_SYS_CS2_BASE # define CONFIG_SYS_NAND_SIZE 1 @@ -265,9 +265,9 @@ #define CONFIG_SYS_CS1_MASK0x001f0001 #define CONFIG_SYS_CS1_CTRL0x002A3780 -#ifdef NANDFLASH_SIZE +#ifdef CONFIG_NANDFLASH_SIZE #define CONFIG_SYS_CS2_BASE0x2000 -#define CONFIG_SYS_CS2_MASK((NANDFLASH_SIZE 20) | 1) +#define CONFIG_SYS_CS2_MASK((CONFIG_NANDFLASH_SIZE 20) | 1) #define CONFIG_SYS_CS2_CTRL0x1f60 #endif -- 1.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot