summaryrefslogtreecommitdiff
path: root/sys/dev/cfi
AgeCommit message (Collapse)Author
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2024-07-24newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh
Sponsored by: Netflix
2024-06-16cfi: Use device_set_descf()Mark Johnston
No functional change intended. MFC after: 1 week
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2022-05-10Remove unused cfi_diskclass.John Baldwin
2022-05-09Remove unused cfi_devclass.John Baldwin
2020-09-01cfi: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365217
2020-02-07Ever since the block layer expanded its command syntax beyond justScott Long
BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in drivers when the driver doesn't support a particular command. Do a sweep and fix that. Reported by: imp Notes: svn path=/head/; revision=357647
2019-11-26cfi: #include <limits.h> for ULONG_MAX after r355101Ed Maste
Reported by: rlibby MFC with: r355101 Notes: svn path=/head/; revision=355104
2019-11-25cfi: check for inter overflow in cfi_devioctlEd Maste
Reported by: Pietro Oliva Reviewed by: markj MFC after: 3 days Security: Possible OOB read in root-only ioctl Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355101
2019-03-24Fix AMD type flash write operations, and display chip information at bootAllan Jude
Applies to MX flash chips on AR9132 and RT3050 Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: imp, sbruno Differential Revision: https://reviews.freebsd.org/D14279 Notes: svn path=/head/; revision=345464
2018-07-17Remove kernel support for armebWarner Losh
Remove all the big-endian arm architectures (ixp425 and ixp435) support in the kernel and associated drivers. Differential Revision: https://reviews.freebsd.org/D16257 Notes: svn path=/head/; revision=336436
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
2017-11-20sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
2017-05-06[cfi] fix CFI flash reset command for MX29LV320T/B.Adrian Chadd
MX flash MX29LV320T/B datasheet say reset is 0xf0. Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Approved by: mizhka Differential Revision: https://reviews.freebsd.org/D10177 Notes: svn path=/head/; revision=317865
2016-02-04Provide a workaround for setting the correct endianness when doing CFI onAdrian Chadd
a mips big-endian board. This is (hopefully! ish!) a temporary change until a slightly better way can be found to express this without a config option. Tested: * BUFFALO WZR-HP-G300NH 1stGen (by submitter) Submitted by: Mori Hiroki <yamori813@yahoo.co.jp> Notes: svn path=/head/; revision=295284
2014-10-16Follow up to r225617. In order to maximize the re-usability of kernel codeDavide Italiano
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe Notes: svn path=/head/; revision=273174
2014-02-02Follow r261352 by updating all drivers which are children of simplebusIan Lepore
to check the status property in their probe routines. Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings. Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper. Notes: svn path=/head/; revision=261410
2013-10-22Set BUS_PROBE_NOWILDCARD on this attachment as a stopgap. UnconditionallyNathan Whitehorn
poking at registers in unknown devices is not the best probe mechanism. This should be reverted and a better solution found later. Notes: svn path=/head/; revision=256900
2013-10-18MFP4: 1136252Brooks Davis
Add an option ATSE_CFI_HACK to allow memory mapped CFI devices to have their address range allocated sharable so that atse(4) can find it's Ethernet address in the expected location. We intend to remove this hack once the BERI platform has a loader. Notes: svn path=/head/; revision=256753
2013-09-04MFP4 217312, 222008, 222052, 222053, 222673, 231484, 231491, 231565, 570643Brooks Davis
Rework the timeout code to use actual time rather than a DELAY() loop and to use both typical and maximum to allow logging of timeout failures. Also correct the erase timeout, it is specified in milliseconds not microseconds like the other timeouts. Do not invoke DELAY() between status queries as this adds significant latency which in turn reduced write performance substantially. Sanity check timeout values from the hardware. Implement support for buffered writes (only enabled on Intel/Sharp parts for now). This yields an order of magnitude speedup on the 64MB Intel StrataFlash parts we use. When making a copy of the block to modify, also keep a clean copy around until we are ready to commit the block and use it to avoid unnecessary erases. In the non-buffer write case, also use it to avoid unnecessary writes when the block has not been erased. This yields a significant speedup when doing things like zeroing a block. Sponsored by: DARPA, AFRL Reviewed by: imp (previous version) Notes: svn path=/head/; revision=255207
2013-06-12Use direct custom implementations instead of g_handleattr() for CFI and NANDAlexander Motin
d_getattr(). Since these drivers use disk(9) KPI and not directly GEOM, use of that function means KPI layering violation, causing extra g_io_deliver() call for the request. Notes: svn path=/head/; revision=251651
2013-05-30MFP4 @217311Brooks Davis
Intel and Sharp flash power on with their blocks in a "locked" state. Unlocked them before attempting to perform an erase or write action and relock when the action is complete. Notes: svn path=/head/; revision=251118
2013-05-30MFP4 @222836Brooks Davis
Add support for partitioning CFI disks from FDT using geom_flashmap. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=251117
2013-04-30MFP4 change 222060:Brooks Davis
On Intel devices, put the Factory PPR in kenv. On some FPGA boards it may be the only software accessable unique ID. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=250115
2013-04-30MFP4 changes 222065 and 222068:Brooks Davis
Add a simplebus attachment for cfi(4)'s FDT support and move cfi_bus_fdt.c to sys/conf/files so non-ppc architectures are supported. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=250114
2013-04-03MFP4 change 217313 and part of 222068:Brooks Davis
Add a simple nexus attachment for cfi(4). Notes: svn path=/head/; revision=249072
2013-01-30Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez
device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
2012-03-27CFI fixes for big endian archs.Jayachandran C.
The flash commands and responses are little-endian and have to be byte swapped on big-endian systems. However the raw read of data need not be swapped. Make the cfi_read and cfi_write do the swapping, and provide a cfi_read_raw which does not byte swap for reading data from flash. Notes: svn path=/head/; revision=233553
2011-05-22Merge r221614,221696,221737,221840 from largeSMP project branch:Attilio Rao
Rewrite atomic operations for powerpc in order to achieve the following: - Produce a type-clean implementation (in terms of functions arguments and returned values) for the primitives. - Fix errors with _long() atomics where they ended up with the wrong arguments to be accepted. - Follow the sys/type.h specifics that define the numbered types starting from standard C types. - Let _ptr() version to not auto-magically cast arguments, but leave the burden on callers, as _ptr() atomic is intended to be used relatively rarely. Fix cfi in order to support the latest point. In collabouration with: bde Tested by: andreast, nwhitehorn, jceel MFC after: 2 weeks Notes: svn path=/head/; revision=222198
2010-07-11Convert Freescale PowerPC platforms to FDT convention.Rafal Jaworowski
The following systems are affected: - MPC8555CDS - MPC8572DS This overhaul covers the following major changes: - All integrated peripherals drivers for Freescale MPC85XX SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values). - This includes: LBC, PCI / PCI-Express, I2C, DS1553, OpenPIC, TSEC, SEC, QUICC, UART, CFI. - Thanks to the common FDT infrastrucutre (fdtbus, simplebus) we retire ocpbus(4) driver, which was based on hard-coded config data. Note that world for these platforms has to be built WITH_FDT. Reviewed by: imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=209908
2009-06-10Move from using devclass_find_free_unit(cfi_diskclass, 0) to -1, sinceWarner Losh
they have the same basic behavior. Notes: svn path=/head/; revision=193936
2009-03-10choose the size of the last region for d_stripsize instead of the first;Sam Leffler
this fixes geom_redboot on boards that have multiple parts/regions as it uses the value to locate the FIS directory which is in the last erase region of flash Notes: svn path=/head/; revision=189654
2009-03-09Add cfid, a disk interface to CFI flash devices; this enables constructionSam Leffler
of flash-based filesystems. Note this is not interlocked against the raw CFI device. Notes: svn path=/head/; revision=189606
2009-02-17fix whitespaceSam Leffler
Notes: svn path=/head/; revision=188741
2009-02-08fix typoSam Leffler
Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=188332
2009-02-07fix building w/o CFI_ARMEDANDDANGEROUSSam Leffler
Notes: svn path=/head/; revision=188268
2009-02-07expand CFI_ARMEDANDDANGEROUS to include writing the user segmentSam Leffler
of the PR; this register is actually write-once so deserves the safety-belt as much as the PLR Notes: svn path=/head/; revision=188267
2009-02-05Add support for frobbing Intel StrataFlash Protection Registers:Sam Leffler
o add CFI_SUPPORT_STRATAFLASH compile option to enable support o add new ioctls to get/set the factory and user/oem segments of the PR and to get/set Protection Lock Register that fuses the user segment o add #defines for bits in the status register o update cfi_wait_ready to take an offset so it can be used to wait for PR write completion and replace constants w/ symbolic names Note: writing the user segment isn't correct; committing now to get review. Sponsored by: Carlson Wireless Reviewed by: imp, Chris Anderson Notes: svn path=/head/; revision=188156
2009-02-03add Roel's copyright as he did the initial versionSam Leffler
Notes: svn path=/head/; revision=188089
2009-02-03honor any interface width (e.g. setup by the bus shim) and don't probe;Sam Leffler
this is needed for the moment to workaround bus shim issues Notes: svn path=/head/; revision=188087
2009-02-03reorg ioctl code to simplify adding new requestsSam Leffler
Notes: svn path=/head/; revision=188086
2008-10-25Add a driver for flash memory that implements to the Common FlashMarcel Moolenaar
Memory Interface (CFI). The flash memory can be read and written to through /dev/cfi# and an ioctl() exists so processes can read the query information. The driver supports the AMD and Intel command set, though only the AMD command has been tested. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=184251