summaryrefslogtreecommitdiffstats
path: root/fs/jffs2
Commit message (Collapse)AuthorAgeFilesLines
* Rename struct fs_driver_d to fs_driverSascha Hauer2023-01-101-1/+1
| | | | | | | | | Remove the meaningless '_d' suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct fs_device_d to fs_deviceSascha Hauer2023-01-103-5/+5
| | | | | | | | | Remove the meaningless '_d' suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-5/+5
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: jffs2: fix error when reading blocks with offsetHolger Assmann2022-02-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This bug resulted in a panic when trying to read a file partially with an offset, e.g. when starting Linux. In such a case a header is loaded by a separate call of jffs2_read(), which then copies only the first n bytes out of the respective block. When the remaining data of the block is then subsequently going to to be read the system deviates in its behaviour from that under Linux by not calling jffs2_read_inode_range() in a 4k-alignment, but with an offset. jffs2_read_inode_range() originates from the Linux jffs2 driver. When being called with an offset it still reads 4096 bytes of data and eventually returns fragments of two consecutive blocks. jffs2_read() then reads this result whilst again applying the offset, therefore returning faulty data. We fix that problem by calling jffs2_get_block() without an offset and therefore reading the whole block. The offset is then applied when we actually perform memcpy with the returned buffer. This fix might also increase the performance since the respective block is likely to be cached from the previous call. Signed-off-by: Holger Assmann <h.assmann@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207173239.772421-1-h.assmann@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: jffs2: add SPDX-License-Identifier: GPL-2.0-onlyAhmad Fatoum2022-01-0524-73/+29
| | | | | | | | | The files refer to the (Linux) top-level LICENSE file. Replace that with GPL-2.0-only. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for Kbuild/KconfigAhmad Fatoum2022-01-052-0/+4
| | | | | | | | | | | | | | | To verify only Kconfig/Makefile is touched: git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile' will print only arch/powerpc/Kbuild. To verify nothing unexpected is added: git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: jffs2: remove unnecessary slab cache structureHolger Assmann2021-11-303-124/+20
| | | | | | | | | | | | jffs2_create_slab_caches() and its subsequent kmem_cache calls are not needed in Barebox since they can directly be replaced by malloc calls. This patch performs that replacement as well as the related clean up. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Holger Assmann <h.assmann@pengutronix.de> Link: https://lore.barebox.org/20211129124545.14171-3-h.assmann@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: jffs2: introduce reference counting at probeHolger Assmann2021-11-301-12/+22
| | | | | | | | | | | | | | | | | | | | | | | The Barebox jffs2 driver initialises global slab caches and compressors within the probing stage [1]. In Barebox, jffs2_create_slab_caches() has several calls to kmem_cache_create() which does nothing more than allocating the context data structure for the kmem_cache. Probing a second jffs2 however will overwrite the original pointers returned by kmem_cache_create(), leading to a double free when more than one jffs2 file system gets unmounted and jffs2_destroy_slab_caches() is called. The same issue exists regarding jffs2_compressors_init(). We can fix this bug by introducing reference counting for both the slab caches and the compressors so that the global data structures are kept as long as at least one file system is present. [1] jffs2_compressors_init(), jffs2_create_slab_caches() in probe() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Holger Assmann <h.assmann@pengutronix.de> Link: https://lore.barebox.org/20211129124545.14171-2-h.assmann@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: jffs2: add initial support for reading jffs2Steffen Trumtrar2020-02-1026-0/+8457
| | | | | | | | | | | | | | | | | | | | | Import the jffs2 filesystem code from Linux v5.5-rc1 and convert it to work with barebox. Writing is *not* supported. Testing was done with a n25q256a-compatible QuadSPI chip on a SoCFPGA-based Socrates board. Testing was done with a combination of: user@somelinuxhost: mkfs.jffs2 --eraseblock=4 -d fs/jffs2/ -o jffs2.img root@target:~ flash_erase -j /dev/mtd5 0 0 root@target:~ dd if=jffs2.img of=/dev/mtd5 barebox@EBV SOCrates:/ mount /dev/mtd0.data (...) mounted /dev/mtd0.data on /mnt/mtd0.data Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove uncompilable filesystemsSascha Hauer2007-09-2111-3885/+0
|
* svn_rev_238Sascha Hauer2007-07-051-30/+0
| | | | moved mkmodestr() to fs/fs.c
* svn_rev_003Sascha Hauer2007-07-055-133/+0
| | | | remove all #if 0 and #if 1
* Move "ar" flags to config.mk to allow for silent "make -s"Wolfgang Denk2006-10-091-1/+1
| | | | Based on patch by Mike Frysinger, 20 Jun 2006
* Add support for a saving build objects in a separate directory.Marian Balakowicz2006-09-011-7/+9
| | | | | | | | | | | | | | | | | | | | | Modifications are based on the linux kernel approach and support two use cases: 1) Add O= to the make command line 'make O=/tmp/build all' 2) Set environement variable BUILD_DIR to point to the desired location 'export BUILD_DIR=/tmp/build' 'make' The second approach can also be used with a MAKEALL script 'export BUILD_DIR=/tmp/build' './MAKEALL' Command line 'O=' setting overrides BUILD_DIR environent variable. When none of the above methods is used the local build is performed and the object files are placed in the source directory.
* Fix JFFS2 support for legacy NAND driver.Marian Balakowicz2006-04-081-6/+28
| | | | Some more NAND cleanup and small fixes.
* Add support for Lite5200B board.Wolfgang Denk2006-03-171-2/+2
| | | | Patch by Patch by Jose Maria (Txema) Lopez, 16 Jan 2006
* Add crc of data to jffs2 (in jffs2_1pass_build_lists()).Wolfgang Denk2006-03-122-1/+14
| | | | Patch by Rick Bronson, 15 Jun 2005
* Re-factoring the legacy NAND code (legacy NAND now only in board-specificBartlomiej Sieka2006-03-052-11/+15
| | | | | | | code and in SoC code). Boards using the old way have CFG_NAND_LEGACY and BOARDLIBS = drivers/nand_legacy/libnand_legacy.a added. Build breakage for NETTA.ERR and NETTA_ISDN - will go away when the new NAND support is implemented for these boards.
* Merge with /home/wd/git/u-boot/testing-NAND/ to add new NAND handling.Bartlomiej Sieka2006-02-243-4/+1173
|\
| * Update of new NAND codeWolfgang Denk2005-09-142-28/+19
| | | | | | | | Patch by Ladislav Michl, 13 Sep 2005
| * Merge with testing-NAND (Rewrite of NAND code)Wolfgang Denk2005-08-172-0/+1178
| |\
| | * Rewrite of NAND code based on what is in 2.6.12 Linux kernelWolfgang Denk2005-08-172-0/+1178
| | | | | | | | | | | | Patch by Ladislav Michl, 29 Jun 2005
* | | Merge with /home/m8/git/u-bootWolfgang Denk2005-10-151-1/+1
|\ \ \
| * | | Added support for TQM834x boards.Marian Balakowicz2005-10-111-1/+1
| |/ /
* / / Cleanup for GCC-4.xWolfgang Denk2005-10-132-12/+14
|/ /
* | Fix return values of the jffs2 commands ls/fsload/fsinfo,Wolfgang Denk2005-08-161-2/+2
| | | | | | | | | | | | so we can use them to, e.g., check the existence of a file with "if ls foo; then this; else that; fi" in the hush shell Patch by Andreas Engel, 16 August 2005
* | Add configuration for IFM AEV FIFO board.Wolfgang Denk2005-08-101-3/+3
| | | | | | | | Minor coding style cleanup.
* | Add common (with Linux) MTD partition scheme and "mtdparts" commandWolfgang Denk2005-08-082-39/+94
|/ | | | | | | | Old, obsolete and duplicated code was cleaned up and replace by the new partitioning method. There are two possible approaches now: * define a single, static partition * use mtdparts command line option and dynamic partitioning Default is static partitioning.
* It's better to handle LZO and LZARI compression mdoes for JFFS2 withwdenk2005-05-053-13/+9
| | | | a single #define.
* Major upate of JFFS2 code; now in sync with snapshot of MTD CVS ofwdenk2005-05-054-1/+685
| | | | | March 13, 2005); new configuration options CONFIG_JFFS2_LZO and CONFIG_JFFS2_LZARI are added. Both are undefined by default.
* Fix problem with symbolic links in JFFS2 code.wdenk2005-05-041-1/+5
|
* Patch by Klaus Heydeck, 12 May 2004:wdenk2004-05-121-1/+1
| | | | | | Using external watchdog for KUP4 boards in mpc8xx/cpu.c; load_sernum_ethaddr() for KUP4 boards in lib_ppc/board.c; various changes to KUP4 board specific files
* * Fix memory leak in the NAND-specific JFFS2 codewdenk2004-05-051-3/+6
| | | | * Fix SL811 USB controller when attached to a USB hub
* * Fix minor NAND JFFS2 related issuewdenk2004-05-031-1/+1
| | | | | | | | | * Fixes for SL811 USB controller: - implement workaround for broken memory stick - improve error handling * Increase packet send timeout to 10 ms in cpu/mpc8xx/scc.c to better cope with congested networks.
* * Back out Patch by Christian Hohnstaedt, 23 Apr 2004:wdenk2004-04-251-47/+15
| | | | | | | | | (JFFS2 speed enhancements) because of using non-public data (PHYS_FLASH_SECT_SIZE) * Patch by Travis Sawyer, 23 Apr 2004: Fix VSC/CIS 8201 phy descrambler interoperability timing due to errata from Vitesse Semiconductor.
* * Patch by Christian Hohnstaedt, 23 Apr 2004:wdenk2004-04-251-15/+47
| | | | | | | | | | | | | | | | | | | | | | JFFS2 speed enhancements: - repair header CRC calculation in jffs2_1pass.c - add eraseblock size to the partition information to skip empty eraseblocks if we find more then 4k of free space. - The JFFS2 scanner is now fast enough to remove the spinning wheel so #ifdef-ed out. - add watchdog calls in long running loops * Patch by Philippe Robin, 22 Apr 2004: Fix ethernet configuration for "versatile" board * Patch by Kshitij Gupta, 21 Apr 2004: Remove busy loop and use MPU timer fr usleep() on OMAP1510/1610 boards * Patch by Steven Scholz, 24 Feb 2004: Fix a bug in AT91RM9200 ethernet driver: The MII interface is now initialized before accessing the PHY. * Cleanup PCI ID's
* * Patch by Yasushi Shoji, 07 Apr 2004:wdenk2004-04-181-6/+6
| | | | | - add support for microblaze processors - add support for AtmarkTechno "suzaku" board
* * Configure PPChameleon board to use redundand environment in flashwdenk2004-04-181-31/+210
| | | | | | * Configure PPChameleon board to use JFFS2 NAND support. * Added support for JFFS2 filesystem (read-only) on top of NAND flash
* * Patches by Thomas Viehweger, 16 Mar 2004:wdenk2004-03-231-6/+10
| | | | | | | | | - show PCI clock frequency on MPC8260 systems - add FCC_PSMR_RMII flag for HiP7 processors - in do_jffs2_fsload(), take load address from load_addr if not set explicit, update load_addr otherwise - replaced printf by putc/puts when no formatting is needed (smaller code size, faster execution)
* * Fix problems caused by Robert Schwebel's cramfs patchwdenk2004-01-041-1/+1
| | | | | | | | | | | | * Patch by Scott McNutt, 02 Jan 2004: Add support for the Nios Active Serial Memory Interface (ASMI) on Cyclone devices * Patch by Andrea Marson, 16 Dec 2003: Add support for the PPChameleon ME and HI modules * Patch by Yuli Barcohen, 22 Dec 2003: Add support for Motorola DUET ADS board (MPC87x/88x)
* * Patch by Robert Schwebel, 15 Dec 2003:wdenk2004-01-031-2/+2
| | | | add support for cramfs (uses JFFS2 command interface)
* * Patches by Xianghua Xiao, 15 Oct 2003:wdenk2003-10-151-1/+1
| | | | | | | | - Added Motorola CPU 8540/8560 support (cpu/85xx) - Added Motorola MPC8540ADS board support (board/mpc8540ads) - Added Motorola MPC8560ADS board support (board/mpc8560ads) * Minor code cleanup
* * Patches by Denis Peter, 9 Sep 2003:wdenk2003-09-101-21/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | add FAT support for IDE, SCSI and USB * Patches by Gleb Natapov, 2 Sep 2003: - cleanup of POST code for unsupported architectures - MPC824x locks way0 of data cache for use as initial RAM; this patch unlocks it after relocation to RAM and invalidates the locked entries. * Patch by Gleb Natapov, 30 Aug 2003: new I2C driver for mpc107 bridge. Now works from flash. * Patch by Dave Ellis, 11 Aug 2003: - JFFS2: fix typo in common/cmd_jffs2.c - JFFS2: fix CFG_JFFS2_SORT_FRAGMENTS option - JFFS2: remove node version 0 warning - JFFS2: accept JFFS2 PADDING nodes - SXNI855T: add AM29LV800 support - SXNI855T: move environment from EEPROM to flash - SXNI855T: boot from JFFS2 in NOR or NAND flash * Patch by Bill Hargen, 11 Aug 2003: fixes for I2C on MPC8240 - fix i2c_write routine - fix iprobe command - eliminates use of global variables, plus dead code, cleanup.
* * Code cleanup:wdenk2003-06-272-32/+25
| | | | | | | | | - remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
* * Avoid flicker on the TRAB's VFD by synchronizing the enable withwdenk2003-03-142-294/+375
| | | | | | | | | | | | | | | | | | | the HSYNC/VSYNC. Requires new CPLD code (Version 101 for Rev. 100 boards, version 153 for Rev. 200 boards). * Patch by Vladimir Gurevich, 12 Mar 2003: Fix relocation problem of statically initialized string pointers in common/cmd_pci.c * Patch by Kai-Uwe Blöm, 12 Mar 2003: Cleanup & bug fixes for JFFS2 code: - the memory mangement was broken. It caused havoc on malloc by writing beyond the block boundaries. - the length calculation for files was wrong, sometimes resulting in short file reads. - data copying now optionally takes fragment version numbers into account, to avoid copying from older data. See doc/README.JFFS2 for details.
* Initial revisionwdenk2002-11-034-0/+1262
|
* Initial revisionwdenk2002-03-081-0/+396
|
* Initial revisionwdenk2002-03-081-0/+47
|
* Initial revisionwdenk2002-02-171-0/+78