diff options
28 files changed, 142 insertions, 348 deletions
diff --git a/board/amcc/yucca/yucca.c b/board/amcc/yucca/yucca.c index 67a016787a..8c65cfb6fe 100644 --- a/board/amcc/yucca/yucca.c +++ b/board/amcc/yucca/yucca.c @@ -609,7 +609,7 @@ int board_pcie_card_present(int port) /* * For the given slot, set endpoint mode, send power to the slot, * turn on the green LED and turn off the yellow LED, enable the - * clock. In end point mode reset bit is read only. + * clock. In endpoint mode reset bit is read only. */ void board_pcie_setup_port(int port, int rootpoint) { diff --git a/board/atum8548/atum8548.c b/board/atum8548/atum8548.c index da6cf47433..c11a5c3499 100644 --- a/board/atum8548/atum8548.c +++ b/board/atum8548/atum8548.c @@ -219,7 +219,7 @@ void pci_init_board(void) pcie1_hose.region_count = 1; #endif printf (" PCIE1 connected to Slot as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/freescale/mpc8536ds/mpc8536ds.c index f8292cf378..81a56b55e0 100644 --- a/board/freescale/mpc8536ds/mpc8536ds.c +++ b/board/freescale/mpc8536ds/mpc8536ds.c @@ -226,7 +226,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 3); pcie_ep = fsl_setup_hose(&pcie3_hose, pci_info[num].regs); printf (" PCIE3 connected to Slot3 as %s (base address %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie3_hose, first_free_busno); @@ -246,7 +246,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf (" PCIE1 connected to Slot1 as %s (base address %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie1_hose, first_free_busno); @@ -266,7 +266,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 2); pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs); printf (" PCIE2 connected to Slot 2 as %s (base address %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie2_hose, first_free_busno); diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c index 35a8063c9b..b35e02f685 100644 --- a/board/freescale/mpc8544ds/mpc8544ds.c +++ b/board/freescale/mpc8544ds/mpc8544ds.c @@ -144,7 +144,7 @@ void pci_init_board(void) pcie3_hose.region_count = 1; #endif printf (" PCIE3 connected to ULI as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie3_hose, first_free_busno); @@ -179,7 +179,7 @@ void pci_init_board(void) pcie1_hose.region_count = 1; #endif printf (" PCIE1 connected to Slot 2 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], @@ -210,7 +210,7 @@ void pci_init_board(void) pcie2_hose.region_count = 1; #endif printf (" PCIE2 connected to Slot 1 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie2_hose, first_free_busno); diff --git a/board/freescale/mpc8548cds/mpc8548cds.c b/board/freescale/mpc8548cds/mpc8548cds.c index 38cbc8bac1..aa3f32bf67 100644 --- a/board/freescale/mpc8548cds/mpc8548cds.c +++ b/board/freescale/mpc8548cds/mpc8548cds.c @@ -343,7 +343,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf (" PCIE1 connected to Slot as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], diff --git a/board/freescale/mpc8568mds/mpc8568mds.c b/board/freescale/mpc8568mds/mpc8568mds.c index 60e22de4b9..4ec13a9691 100644 --- a/board/freescale/mpc8568mds/mpc8568mds.c +++ b/board/freescale/mpc8568mds/mpc8568mds.c @@ -408,7 +408,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf (" PCIE1 connected to Slot as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/freescale/mpc8569mds/mpc8569mds.c index 56854caa8d..1c76b84efc 100644 --- a/board/freescale/mpc8569mds/mpc8569mds.c +++ b/board/freescale/mpc8569mds/mpc8569mds.c @@ -552,7 +552,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf (" PCIE1 connected to Slot as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie1_hose, first_free_busno); diff --git a/board/freescale/mpc8572ds/mpc8572ds.c b/board/freescale/mpc8572ds/mpc8572ds.c index 64e164b1a0..74085c3260 100644 --- a/board/freescale/mpc8572ds/mpc8572ds.c +++ b/board/freescale/mpc8572ds/mpc8572ds.c @@ -194,7 +194,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 3); pcie_ep = fsl_setup_hose(&pcie3_hose, pci_info[num].regs); printf (" PCIE3 connected to ULI as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie3_hose, first_free_busno); @@ -226,7 +226,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 2); pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs); printf (" PCIE2 connected to Slot 1 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie2_hose, first_free_busno); @@ -246,7 +246,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf (" PCIE1 connected to Slot 2 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie1_hose, first_free_busno); diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index 2d4b9addb6..784a2ed686 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -249,7 +249,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf (" PCIE1 connected to ULI as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], @@ -270,7 +270,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 2); pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs); printf (" PCIE2 connected to Slot as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie2_hose, first_free_busno); diff --git a/board/freescale/p1_p2_rdb/pci.c b/board/freescale/p1_p2_rdb/pci.c index 6fd6963f0c..aa2f64ca91 100644 --- a/board/freescale/p1_p2_rdb/pci.c +++ b/board/freescale/p1_p2_rdb/pci.c @@ -66,7 +66,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 2); pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs); printf(" PCIE2 connected to Slot 1 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie2_hose, first_free_busno); @@ -85,7 +85,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf(" PCIE1 connected to Slot 2 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie1_hose, first_free_busno); diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index 599caa235d..f6eae55d1d 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -222,7 +222,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 2); pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs); printf(" PCIE2 connected to ULI as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie2_hose, first_free_busno); @@ -262,7 +262,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 3); pcie_ep = fsl_setup_hose(&pcie3_hose, pci_info[num].regs); printf(" PCIE3 connected to Slot 1 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie3_hose, first_free_busno); @@ -281,7 +281,7 @@ void pci_init_board(void) SET_STD_PCIE_INFO(pci_info[num], 1); pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); printf(" PCIE1 connected to Slot 2 as %s (base addr %lx)\n", - pcie_ep ? "End Point" : "Root Complex", + pcie_ep ? "Endpoint" : "Root Complex", pci_info[num].regs); first_free_busno = fsl_pci_init_port(&pci_info[num++], &pcie1_hose, first_free_busno); diff --git a/board/tqc/tqm85xx/tqm85xx.c b/board/tqc/tqm85xx/tqm85xx.c index aa7827e1ec..8c9d586925 100644 --- a/board/tqc/tqm85xx/tqm85xx.c +++ b/board/tqc/tqm85xx/tqm85xx.c @@ -636,7 +636,7 @@ static inline void init_pcie1(void) if (pcie_configured && !(gur->devdisr & MPC85xx_DEVDISR_PCIE)){ printf ("PCIe: %s, base address %x", - pcie_ep ? "End point" : "Root complex", (uint)pci); + pcie_ep ? "Endpoint" : "Root complex", (uint)pci); if (pci->pme_msg_det) { pci->pme_msg_det = 0xffffffff; diff --git a/board/xes/common/fsl_8xxx_pci.c b/board/xes/common/fsl_8xxx_pci.c index a615820651..3a8182715b 100644 --- a/board/xes/common/fsl_8xxx_pci.c +++ b/board/xes/common/fsl_8xxx_pci.c @@ -256,7 +256,7 @@ void pci_init_board(void) if (width && !(devdisr & MPC8xxx_DEVDISR_PCIE1)) { printf("\n PCIE1 connected as %s (x%d)", - host ? "Root Complex" : "End Point", width); + host ? "Root Complex" : "Endpoint", width); if (in_be32(&pci->pme_msg_det)) { out_be32(&pci->pme_msg_det, 0xffffffff); debug(" with errors. Clearing. Now 0x%08x", @@ -305,7 +305,7 @@ void pci_init_board(void) if (width && !(devdisr & MPC8xxx_DEVDISR_PCIE2)) { printf("\n PCIE2 connected as %s (x%d)", - host ? "Root Complex" : "End Point", width); + host ? "Root Complex" : "Endpoint", width); if (in_be32(&pci->pme_msg_det)) { out_be32(&pci->pme_msg_det, 0xffffffff); debug(" with errors. Clearing. Now 0x%08x", @@ -354,7 +354,7 @@ void pci_init_board(void) if (width && !(devdisr & MPC8xxx_DEVDISR_PCIE3)) { printf("\n PCIE3 connected as %s (x%d)", - host ? "Root Complex" : "End Point", width); + host ? "Root Complex" : "Endpoint", width); if (in_be32(&pci->pme_msg_det)) { out_be32(&pci->pme_msg_det, 0xffffffff); debug(" with errors. Clearing. Now 0x%08x", diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 735b3443e6..205fc40ac8 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -2179,6 +2179,12 @@ Void_t* mALLOc(bytes) size_t bytes; INTERNAL_SIZE_T nb; + /* check if mem_malloc_init() was run */ + if ((mem_malloc_start == 0) && (mem_malloc_end == 0)) { + /* not initialized yet */ + return 0; + } + if ((long)bytes < 0) return 0; nb = request2size(bytes); /* padded request size; */ diff --git a/cpu/ppc4xx/4xx_pcie.c b/cpu/ppc4xx/4xx_pcie.c index d9605c30b5..f3b921477b 100644 --- a/cpu/ppc4xx/4xx_pcie.c +++ b/cpu/ppc4xx/4xx_pcie.c @@ -924,7 +924,7 @@ static inline u64 ppc4xx_get_cfgaddr(int port) } /* - * 4xx boards as end point and root point setup + * 4xx boards as endpoint and root point setup * and * testing inbound and out bound windows * @@ -940,7 +940,7 @@ static inline u64 ppc4xx_get_cfgaddr(int port) * * Once your board came up as root point , you can verify by reading * /proc/bus/pci/devices. Where you can see the configuration registers - * of end point device attached to the port. + * of endpoint device attached to the port. * * Enpoint cofiguration can be verified by connecting 4xx board to any * host or another 4xx board. Then try to scan the device. In case of diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index f0f0301bd1..9a1fb4f316 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -133,7 +133,7 @@ struct musb_regs { u8 rxhubport; } tar[16]; /* - * end point registers + * endpoint registers * ep0 elements are valid when array index is 0 * otherwise epN is valid */ diff --git a/fs/jffs2/LICENCE b/fs/jffs2/LICENCE new file mode 100644 index 0000000000..5628859081 --- /dev/null +++ b/fs/jffs2/LICENCE @@ -0,0 +1,30 @@ +The files in this directory and elsewhere which refer to this LICENCE +file are part of JFFS2, the Journalling Flash File System v2. + + Copyright © 2001-2007 Red Hat, Inc. and others + +JFFS2 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 or (at your option) any later +version. + +JFFS2 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 JFFS2; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +As a special exception, if other files instantiate templates or use +macros or inline functions from these files, or you compile these +files and link them with other works to produce a work based on these +files, these files do not by themselves cause the resulting work to be +covered by the GNU General Public License. However the source code for +these files must still be made available in accordance with section (3) +of the GNU General Public License. + +This exception does not invalidate any other reasons why a work based on +this file might be covered by the GNU General Public License. + diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile index fd6a1050c6..7c9fb41b8d 100644 --- a/fs/jffs2/Makefile +++ b/fs/jffs2/Makefile @@ -27,8 +27,7 @@ LIB = $(obj)libjffs2.a AOBJS = ifdef CONFIG_CMD_JFFS2 -COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzari.o -COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzo.o +COBJS-$(CONFIG_JFFS2_LZO) += compr_lzo.o COBJS-y += compr_rtime.o COBJS-y += compr_rubin.o COBJS-y += compr_zlib.o diff --git a/fs/jffs2/compr_lzari.c b/fs/jffs2/compr_lzari.c deleted file mode 100644 index 6a29608562..0000000000 --- a/fs/jffs2/compr_lzari.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2004 Patrik Kluba, - * University of Szeged, Hungary - * - * For licensing information, see the file 'LICENCE' in the - * jffs2 directory. - * - * $Id: compr_lzari.c,v 1.3 2004/06/23 16:34:39 havasi Exp $ - * - */ - -/* - Lempel-Ziv-Arithmetic coding compression module for jffs2 - Based on the LZARI source included in LDS (lossless datacompression sources) -*/ - -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ - -/* -Original copyright follows: - -************************************************************** - LZARI.C -- A Data Compression Program - (tab = 4 spaces) -************************************************************** - 4/7/1989 Haruhiko Okumura - Use, distribute, and modify this program freely. - Please send me your improved versions. - PC-VAN SCIENCE - NIFTY-Serve PAF01022 - CompuServe 74050,1022 -************************************************************** - -LZARI.C (c)1989 by Haruyasu Yoshizaki, Haruhiko Okumura, and Kenji Rikitake. -All rights reserved. Permission granted for non-commercial use. - -*/ - -/* - - 2004-02-18 pajko <pajko(AT)halom(DOT)u-szeged(DOT)hu> - Removed unused variables and fixed no return value - - 2004-02-16 pajko <pajko(AT)halom(DOT)u-szeged(DOT)hu> - Initial release - -*/ - - -#include <config.h> -#include <linux/stddef.h> -#include <jffs2/jffs2.h> - - -#define N 4096 /* size of ring buffer */ -#define F 60 /* upper limit for match_length */ -#define THRESHOLD 2 /* encode string into position and length - if match_length is greater than this */ -#define NIL N /* index for root of binary search trees */ - -static unsigned char - text_buf[N + F - 1]; /* ring buffer of size N, - with extra F-1 bytes to facilitate string comparison */ - -/********** Arithmetic Compression **********/ - -/* If you are not familiar with arithmetic compression, you should read - I. E. Witten, R. M. Neal, and J. G. Cleary, - Communications of the ACM, Vol. 30, pp. 520-540 (1987), - from which much have been borrowed. */ - -#define M 15 - -/* Q1 (= 2 to the M) must be sufficiently large, but not so - large as the unsigned long 4 * Q1 * (Q1 - 1) overflows. */ - -#define Q1 (1UL << M) -#define Q2 (2 * Q1) -#define Q3 (3 * Q1) -#define Q4 (4 * Q1) -#define MAX_CUM (Q1 - 1) - -#define N_CHAR (256 - THRESHOLD + F) - /* character code = 0, 1, ..., N_CHAR - 1 */ - -static unsigned long char_to_sym[N_CHAR], sym_to_char[N_CHAR + 1]; -static unsigned long - sym_freq[N_CHAR + 1], /* frequency for symbols */ - sym_cum[N_CHAR + 1], /* cumulative freq for symbols */ - position_cum[N + 1]; /* cumulative freq for positions */ - -static void StartModel(void) /* Initialize model */ -{ - unsigned long ch, sym, i; - - sym_cum[N_CHAR] = 0; - for (sym = N_CHAR; sym >= 1; sym--) { - ch = sym - 1; - char_to_sym[ch] = sym; sym_to_char[sym] = ch; - sym_freq[sym] = 1; - sym_cum[sym - 1] = sym_cum[sym] + sym_freq[sym]; - } - sym_freq[0] = 0; /* sentinel (!= sym_freq[1]) */ - position_cum[N] = 0; - for (i = N; i >= 1; i--) - position_cum[i - 1] = position_cum[i] + 10000 / (i + 200); - /* empirical distribution function (quite tentative) */ - /* Please devise a better mechanism! */ -} - -static void UpdateModel(unsigned long sym) -{ - unsigned long c, ch_i, ch_sym; - unsigned long i; - if (sym_cum[0] >= MAX_CUM) { - c = 0; - for (i = N_CHAR; i > 0; i--) { - sym_cum[i] = c; - c += (sym_freq[i] = (sym_freq[i] + 1) >> 1); - } - sym_cum[0] = c; - } - for (i = sym; sym_freq[i] == sym_freq[i - 1]; i--) ; - if (i < sym) { - ch_i = sym_to_char[i]; ch_sym = sym_to_char[sym]; - sym_to_char[i] = ch_sym; sym_to_char[sym] = ch_i; - char_to_sym[ch_i] = sym; char_to_sym[ch_sym] = i; - } - sym_freq[i]++; - while (--i > 0) sym_cum[i]++; - sym_cum[0]++; -} - -static unsigned long BinarySearchSym(unsigned long x) - /* 1 if x >= sym_cum[1], - N_CHAR if sym_cum[N_CHAR] > x, - i such that sym_cum[i - 1] > x >= sym_cum[i] otherwise */ -{ - unsigned long i, j, k; - - i = 1; j = N_CHAR; - while (i < j) { - k = (i + j) / 2; - if (sym_cum[k] > x) i = k + 1; else j = k; - } - return i; -} - -unsigned long BinarySearchPos(unsigned long x) - /* 0 if x >= position_cum[1], - N - 1 if position_cum[N] > x, - i such that position_cum[i] > x >= position_cum[i + 1] otherwise */ -{ - unsigned long i, j, k; - - i = 1; j = N; - while (i < j) { - k = (i + j) / 2; - if (position_cum[k] > x) i = k + 1; else j = k; - } - return i - 1; -} - -static int Decode(unsigned char *srcbuf, unsigned char *dstbuf, unsigned long srclen, - unsigned long dstlen) /* Just the reverse of Encode(). */ -{ - unsigned long i, r, j, k, c, range, sym; - unsigned char *ip, *op; - unsigned char *srcend = srcbuf + srclen; - unsigned char *dstend = dstbuf + dstlen; - unsigned char buffer = 0; - unsigned char mask = 0; - unsigned long low = 0; - unsigned long high = Q4; - unsigned long value = 0; - - ip = srcbuf; - op = dstbuf; - for (i = 0; i < M + 2; i++) { - value *= 2; - if ((mask >>= 1) == 0) { - buffer = (ip >= srcend) ? 0 : *(ip++); - mask = 128; - } - value += ((buffer & mask) != 0); - } - - StartModel(); - for (i = 0; i < N - F; i++) text_buf[i] = ' '; - r = N - F; - - while (op < dstend) { - range = high - low; - sym = BinarySearchSym((unsigned long) - (((value - low + 1) * sym_cum[0] - 1) / range)); - high = low + (range * sym_cum[sym - 1]) / sym_cum[0]; - low += (range * sym_cum[sym ]) / sym_cum[0]; - for ( ; ; ) { - if (low >= Q2) { - value -= Q2; low -= Q2; high -= Q2; - } else if (low >= Q1 && high <= Q3) { - value -= Q1; low -= Q1; high -= Q1; - } else if (high > Q2) break; - low += low; high += high; - value *= 2; - if ((mask >>= 1) == 0) { - buffer = (ip >= srcend) ? 0 : *(ip++); - mask = 128; - } - value += ((buffer & mask) != 0); - } - c = sym_to_char[sym]; - UpdateModel(sym); - if (c < 256) { - if (op >= dstend) return -1; - *(op++) = c; - text_buf[r++] = c; - r &= (N - 1); - } else { - j = c - 255 + THRESHOLD; - range = high - low; - i = BinarySearchPos((unsigned long) - (((value - low + 1) * position_cum[0] - 1) / range)); - high = low + (range * position_cum[i ]) / position_cum[0]; - low += (range * position_cum[i + 1]) / position_cum[0]; - for ( ; ; ) { - if (low >= Q2) { - value -= Q2; low -= Q2; high -= Q2; - } else if (low >= Q1 && high <= Q3) { - value -= Q1; low -= Q1; high -= Q1; - } else if (high > Q2) break; - low += low; high += high; - value *= 2; - if ((mask >>= 1) == 0) { - buffer = (ip >= srcend) ? 0 : *(ip++); - mask = 128; - } - value += ((buffer & mask) != 0); - } - i = (r - i - 1) & (N - 1); - for (k = 0; k < j; k++) { - c = text_buf[(i + k) & (N - 1)]; - if (op >= dstend) return -1; - *(op++) = c; - text_buf[r++] = c; - r &= (N - 1); - } - } - } - return 0; -} - -int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out, - u32 srclen, u32 destlen) -{ - return Decode(data_in, cpage_out, srclen, destlen); -} diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index 1923ed909a..93651f53e9 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -471,9 +471,8 @@ static char *compr_names[] = { "COPY", "DYNRUBIN", "ZLIB", -#if defined(CONFIG_JFFS2_LZO_LZARI) +#if defined(CONFIG_JFFS2_LZO) "LZO", - "LZARI", #endif }; @@ -781,13 +780,10 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest) case JFFS2_COMPR_ZLIB: ret = zlib_decompress(src, lDest, jNode->csize, jNode->dsize); break; -#if defined(CONFIG_JFFS2_LZO_LZARI) +#if defined(CONFIG_JFFS2_LZO) case JFFS2_COMPR_LZO: ret = lzo_decompress(src, lDest, jNode->csize, jNode->dsize); break; - case JFFS2_COMPR_LZARI: - ret = lzari_decompress(src, lDest, jNode->csize, jNode->dsize); - break; #endif default: /* unknown */ diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c index fe8c70d91d..3982003a42 100644 --- a/fs/jffs2/jffs2_nand_1pass.c +++ b/fs/jffs2/jffs2_nand_1pass.c @@ -34,9 +34,8 @@ static char *compr_names[] = { "COPY", "DYNRUBIN", "ZLIB", -#if defined(CONFIG_JFFS2_LZO_LZARI) +#if defined(CONFIG_JFFS2_LZO) "LZO", - "LZARI", #endif }; @@ -344,13 +343,10 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest, case JFFS2_COMPR_ZLIB: ret = zlib_decompress(src, dst, inode->csize, inode->dsize); break; -#if defined(CONFIG_JFFS2_LZO_LZARI) +#if defined(CONFIG_JFFS2_LZO) case JFFS2_COMPR_LZO: ret = lzo_decompress(src, dst, inode->csize, inode->dsize); break; - case JFFS2_COMPR_LZARI: - ret = lzari_decompress(src, dst, inode->csize, inode->dsize); - break; #endif default: /* unknown */ diff --git a/include/common.h b/include/common.h index 07897f682e..8197508b6d 100644 --- a/include/common.h +++ b/include/common.h @@ -617,6 +617,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_generic/net_utils.c */ +#include <net.h> +static inline IPaddr_t getenv_IPaddr (char *var) +{ + return (string_to_ip(getenv(var))); +} + /* lib_generic/time.c */ void udelay (unsigned long); diff --git a/include/jffs2/jffs2.h b/include/jffs2/jffs2.h index ed96babf61..651f94cf38 100644 --- a/include/jffs2/jffs2.h +++ b/include/jffs2/jffs2.h @@ -68,10 +68,9 @@ #define JFFS2_COMPR_COPY 0x04 #define JFFS2_COMPR_DYNRUBIN 0x05 #define JFFS2_COMPR_ZLIB 0x06 -#if defined(CONFIG_JFFS2_LZO_LZARI) +#if defined(CONFIG_JFFS2_LZO) #define JFFS2_COMPR_LZO 0x07 -#define JFFS2_COMPR_LZARI 0x08 -#define JFFS2_NUM_COMPR 9 +#define JFFS2_NUM_COMPR 8 #else #define JFFS2_NUM_COMPR 7 #endif @@ -226,11 +225,9 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, unsigned long sourcelen, unsigned long dstlen); long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out, __u32 srclen, __u32 destlen); -#if defined(CONFIG_JFFS2_LZO_LZARI) +#if defined(CONFIG_JFFS2_LZO) int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out, u32 srclen, u32 destlen); -int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out, - u32 srclen, u32 destlen); #endif char *mkmodestr(unsigned long mode, char *str); diff --git a/include/net.h b/include/net.h index 1c8ab12454..3f6a5d1497 100644 --- a/include/net.h +++ b/include/net.h @@ -508,9 +508,6 @@ extern void VLAN_to_string (ushort x, char *s); /* Convert a string to a vlan id */ extern ushort string_to_VLAN(char *s); -/* read an IP address from a environment variable */ -extern IPaddr_t getenv_IPaddr (char *); - /* read a VLAN id from an environment variable */ extern ushort getenv_VLAN(char *); diff --git a/include/usb/ehci-fsl.h b/include/usb/ehci-fsl.h index 3b99456227..f48945a27a 100644 --- a/include/usb/ehci-fsl.h +++ b/include/usb/ehci-fsl.h @@ -112,7 +112,7 @@ struct usb_ehci { u32 perlistbase; /* 0x154 - Periodic List Base - USB Device Address */ u32 ep_list_addr; /* 0x158 - Next Asynchronous List - - End Point Address */ + - Endpoint Address */ u8 res5[0x4]; u32 burstsize; /* 0x160 - Programmable Burst Size */ u32 txfilltuning; /* 0x164 - Host TT Transmit @@ -124,17 +124,17 @@ struct usb_ehci { u32 portsc; /* 0x184 - Port status/control */ u8 res8[0x20]; u32 usbmode; /* 0x1a8 - USB Device Mode */ - u32 epsetupstat; /* 0x1ac - End Point Setup Status */ - u32 epprime; /* 0x1b0 - End Point Init Status */ - u32 epflush; /* 0x1b4 - End Point De-initlialize */ - u32 epstatus; /* 0x1b8 - End Point Status */ - u32 epcomplete; /* 0x1bc - End Point Complete */ - u32 epctrl0; /* 0x1c0 - End Point Control 0 */ - u32 epctrl1; /* 0x1c4 - End Point Control 1 */ - u32 epctrl2; /* 0x1c8 - End Point Control 2 */ - u32 epctrl3; /* 0x1cc - End Point Control 3 */ - u32 epctrl4; /* 0x1d0 - End Point Control 4 */ - u32 epctrl5; /* 0x1d4 - End Point Control 5 */ + u32 epsetupstat; /* 0x1ac - Endpoint Setup Status */ + u32 epprime; /* 0x1b0 - Endpoint Init Status */ + u32 epflush; /* 0x1b4 - Endpoint De-initlialize */ + u32 epstatus; /* 0x1b8 - Endpoint Status */ + u32 epcomplete; /* 0x1bc - Endpoint Complete */ + u32 epctrl0; /* 0x1c0 - Endpoint Control 0 */ + u32 epctrl1; /* 0x1c4 - Endpoint Control 1 */ + u32 epctrl2; /* 0x1c8 - Endpoint Control 2 */ + u32 epctrl3; /* 0x1cc - Endpoint Control 3 */ + u32 epctrl4; /* 0x1d0 - Endpoint Control 4 */ + u32 epctrl5; /* 0x1d4 - Endpoint Control 5 */ u8 res9[0x228]; u32 snoop1; /* 0x400 - Snoop 1 */ u32 snoop2; /* 0x404 - Snoop 2 */ diff --git a/lib_generic/Makefile b/lib_generic/Makefile index bfaf3468ef..c17179cbc8 100644 --- a/lib_generic/Makefile +++ b/lib_generic/Makefile @@ -41,6 +41,7 @@ COBJS-y += gunzip.o COBJS-y += lmb.o COBJS-y += ldiv.o COBJS-$(CONFIG_MD5) += md5.o +COBJS-y += net_utils.o COBJS-y += sha1.o COBJS-$(CONFIG_SHA256) += sha256.o COBJS-y += string.o diff --git a/lib_generic/net_utils.c b/lib_generic/net_utils.c new file mode 100644 index 0000000000..f03b098e9c --- /dev/null +++ b/lib_generic/net_utils.c @@ -0,0 +1,50 @@ +/* + * Generic network code. Moved from net.c + * + * Copyright 1994 - 2000 Neil Russell. + * Copyright 2000 Roland Borde + * Copyright 2000 Paolo Scaffardi + * Copyright 2000-2002 Wolfgang Denk, wd@denx.de + * Copyright 2009 Dirk Behme, dirk.behme@googlemail.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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> + +IPaddr_t string_to_ip(char *s) +{ + IPaddr_t addr; + char *e; + int i; + + if (s == NULL) + return(0); + + for (addr=0, i=0; i<4; ++i) { + ulong val = s ? simple_strtoul(s, &e, 10) : 0; + addr <<= 8; + addr |= (val & 0xFF); + if (s) { + s = (*e) ? e+1 : e; + } + } + + return (htonl(addr)); +} @@ -1890,27 +1890,6 @@ void ip_to_string (IPaddr_t x, char *s) ); } -IPaddr_t string_to_ip(char *s) -{ - IPaddr_t addr; - char *e; - int i; - - if (s == NULL) - return(0); - - for (addr=0, i=0; i<4; ++i) { - ulong val = s ? simple_strtoul(s, &e, 10) : 0; - addr <<= 8; - addr |= (val & 0xFF); - if (s) { - s = (*e) ? e+1 : e; - } - } - - return (htonl(addr)); -} - void VLAN_to_string(ushort x, char *s) { x = ntohs(x); @@ -1939,11 +1918,6 @@ ushort string_to_VLAN(char *s) return htons(id); } -IPaddr_t getenv_IPaddr (char *var) -{ - return (string_to_ip(getenv(var))); -} - ushort getenv_VLAN(char *var) { return (string_to_VLAN(getenv(var))); |