summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* imx-bbu-nand-fcb: make available for i.MX28 aswellSascha Hauer2015-06-121-0/+5
| | | | | | | | The code can be used with slight modifications on i.MX28 aswell. Add a i.MX28 registration function and move the differences to function callbacks. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX6: bbu nand: Move to common placeSascha Hauer2015-06-121-0/+9
| | | | | | The code can be used on i.MX28 aswell, so move it to a common place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* filetype: Add filetype for MXS bootstreamSascha Hauer2015-06-121-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/am335x'Sascha Hauer2015-05-281-0/+1
|\
| * net: phy: Add missing phy_unregister_deviceSascha Hauer2015-04-281-0/+1
| | | | | | | | | | | | The counterpart of phy_register_device is missing. Add it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of-device-id'Sascha Hauer2015-05-063-3/+3
|\ \
| * | of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-303-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mvebu'Sascha Hauer2015-05-062-0/+38
|\ \
| * | bus: mvebu-mbus: Convert mbus platform driver to direct driverSebastian Hesselbarth2015-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Registering mbus driver as platform driver is a little late for some register accesses to work. We have to make sure boot-up mbus windows are disabled early, so call mbus driver directly from SoC init. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | spi: Add SPI GPIO bitbang driverSebastian Hesselbarth2015-04-271-0/+36
| | | | | | | | | | | | | | | | | | | | | This adds a driver for SPI master by GPIO pins. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2015-05-068-8/+24
|\ \ \
| * | | usb: increase USB_CNTL_TIMEOUT to match linuxSteffen Trumtrar2015-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB requests should be processed within a timeframe of 5s. The linux kernel also uses this timeout value for the control packets. For the musb the increase in timeout helps successfully probing USB devices (at least on one test hardware), but on the other hand doesn't slow down the system, if there are no devices, i.e. the timeout never hits. That means, that the USB core correctly aborts instead of timing out. Why and how the 100ms was chosen in the first place, can not be deduced from the git history, just that it seems to work fine for most boards. Change USB_CNTL_TIMEOUT to 5000ms and replace all occurences of `USB_CNTL_TIMEOUT * x` with just `USB_CNTL_TIMEOUT`, as the timeout is now large enough without it. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | linux/amba/bus.h: drop unusable amba_{g,s}et_drvdata macrosAntony Pavlov2015-04-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | amba_{g,s}et_drvdata macros from linux kernel use dev_{g,s}et_drvdata functions. But in linux dev_get_drvdata() takes only one argument while in barebox dev_get_drvdata() takes two arguments. There is no dev_set_drvdata() in barebox at all. So amba_{g,s}et_drvdata macros from linux are unusable for barebox. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | of_path: of_find_path(): add possibility to return .bb deviceMarc Kleine-Budde2015-04-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a flags argument to the of_find_path() function. The only flag defined for now is OF_FIND_PATH_FLAGS_BB. When used on NAND devices, the function returns the bad block aware device (the ".bb" device). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | timeout: factor out wait-for-key-press loop into separate fileMarc Kleine-Budde2015-04-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch factors out the wait-for-key-press loop from the shell command "timeout" into a sparate file, so that it can be used from C, too. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: add includes includes to make fdt.h, of.h and state.h self containedMarc Kleine-Budde2015-04-173-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise compilation may fail with: include/fdt.h:11:15: error: unknown type name 'uint64_t' static inline uint64_t fdt64_to_cpu(uint64_t x) include/of.h:22:19: error: field 'list' has incomplete type struct list_head list; Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | drivers/base: Mark (of|platform)_device_id data as constantUwe Kleine-König2015-04-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should be no reason to ever change the data pointed to by id_table or of_compatible. So make this offical by adding some 'const's. In Linux the corresponding pointers are marked as const, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | pci: Do not abuse dev->priv for storing dataSascha Hauer2015-04-171-0/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | dev->priv is for private use of the device driver, so do not use it in the pci core. Instead, introduce a id field in struct pci_device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2015-05-061-0/+30
|\ \ \ | |_|/ |/| |
| * | habv4: add High Assurance Boot v4Marc Kleine-Budde2015-04-151-0/+30
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the code to check the HAB ROM for failures during development. Add a cal to "habv4_get_status();" to your board file, to get the current system state from the ROM. _NOTE_: On i.MX6 this has to happen before barebox starts the MMU, because the HAB ROM vector table is placed at 0x94, which is not accessible after the MMU has setup the zero page. This patch contains code ported from u-boot patches [1][2] by Shaojun Wang [3] which were found in the "Mx28 Secure Boot" and "Mx6 HAB (High Assurance Boot)" thread on the freescale community forum [4][5]. [1] https://community.freescale.com/servlet/JiveServlet/download/370047-269174/0001-enable-mx28-u-boot-hab.patch.txt.zip [1] https://community.freescale.com/servlet/JiveServlet/download/96451-11-266175/0001-u-boot-enable-mx6-hab.patch.zip [2] https://community.freescale.com/people/ShaojunWang [3] https://community.freescale.com/thread/317254 [3] https://community.freescale.com/docs/DOC-96451 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | led: Fix led_gpio_rgb_unregister prototypeSascha Hauer2015-04-201-2/+2
| | | | | | | | | | | | | | Analog to the other led_unregister prototypes this must take the LED type specific struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | base: Introduce deferred probingSebastian Hesselbarth2015-04-171-0/+1
|/ | | | | | | | | As expected, we would need deferred probing sooner or later. This is a first approach to allow devices to return -EPROBE_DEFER and get sorted into a list of deferred devices that will be re-probed later. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-04-131-0/+21
|\
| * state: add framework for persistent state handlingSascha Hauer2015-03-121-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a framework to describe, access, store and restore a set of variables. A state variable set can be fully described in a devicetree node. This node could be part of the regular devicetree blob or it could be an extra devicetree solely for the state. The state variable set contains variables of different types and a place to store the variable set. For more information see: Documentation/devicetree/bindings/barebox/barebox,state.rst Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/pxa'Sascha Hauer2015-04-131-0/+1
|\ \
| * | net: smc1111: add a quirk for pxa pxa27x platformsRobert Jarzmik2015-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As hinted in the linux kernel driver, pxa platforms such as mainstone, stargate and idp have a broken design, where half-word writes not aligned to a word address are not working. This patch is a taking back the half-word write accessor for this specific case from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/pci'Sascha Hauer2015-04-132-0/+777
|\ \ \
| * | | pci: Add i.MX6 pcie supportSascha Hauer2015-03-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the corresponding kernel driver with changes to make it work on barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | pci: pci_regs.h: Sync with LinuxSascha Hauer2015-03-171-0/+769
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync the pci register definitions with Linux 4.0-rc1. Some are needed for the upcoming designware pcie driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/crypto'Sascha Hauer2015-04-137-12/+226
|\ \ \ \ | |_|/ / |/| | |
| * | | crypto: sha1: switch to linux implementationJean-Christophe PLAGNIOL-VILLARD2015-03-272-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | current implementation $ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin -rw-r--r-- 1 root root 211095 Mar 24 13:21 build/versatilpb/arch/arm/pbl/zbarebox.bin linux generic implementation $ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin -rw-r--r-- 1 root root 210829 Mar 24 13:21 build/versatilpb/arch/arm/pbl/zbarebox.bin on a compressed lzo barebox we will 266 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: hmac: move register to hmacJean-Christophe PLAGNIOL-VILLARD2015-03-273-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we will use the best sha algo at runtime Add a new init level crypto_initcall to ensure that all the sha present before hmac Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: prepare to allow multiple digest driverJean-Christophe PLAGNIOL-VILLARD2015-03-272-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow to have hw driver or asm optimised driver. Use a priority level to determine which one to use at runtime. The generic one will be 0. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: allow algo to specify their length at runtimeJean-Christophe PLAGNIOL-VILLARD2015-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | such as RSA as we load a DER key we will detect the key size at runtime and so the algo length. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: digest: speficied when a digest need a key to be usedJean-Christophe PLAGNIOL-VILLARD2015-03-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | such as for hmac(xxx) you must provide a key This will allow to enforce the correct parameter at digest command <digest>sum is not impacted Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | command: add generic digest commandJean-Christophe PLAGNIOL-VILLARD2015-03-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | That can be used for digest calculation and verify Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | lib: Add hex2bin and bin2hex implementationsSascha Hauer2015-03-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Taken from the Kernel, put into the same place as in the kernel, although the hexdump.c does not actually contain hexdum functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | command: allow runtime usageJean-Christophe PLAGNIOL-VILLARD2015-03-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow as example to list the currently supported digest. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: add pbkdf2 hmac key generatorJean-Christophe PLAGNIOL-VILLARD2015-03-191-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will allow to generate a KEY + IV based on a password and salt for AES encryption/decryption as example or simply the key for hmac or rsa from text password Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: add digest callbackJean-Christophe PLAGNIOL-VILLARD2015-03-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combination of @init and @update and @final. This function effectively behaves as the entire chain of operations, @init, @update and @final issued in sequence. This is added for hardware which cannot do even the @finup, but can only do the whole transformation in one run. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: add verify callbackJean-Christophe PLAGNIOL-VILLARD2015-03-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will allow to compare a md with the original one When calling this do not call final For RSA_SIGN verification final does not exist only verify as final will be for signing Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: digest: digest_file_window/digest_file/digest_file_by_name drop key ↵Jean-Christophe PLAGNIOL-VILLARD2015-03-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | params expect the key to be set before calling Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: digest: Make string arguments constSascha Hauer2015-03-131-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Most string arguments for keys and filenames can be const. Change that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | command: add hmac sum supportfor md5, sha1, sha224, sha256, sha384, sha512Jean-Christophe PLAGNIOL-VILLARD2015-03-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass the key via -h param barebox@barebox sandbox:/ sha256sum -h test /dev/fd0 c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de /dev/fd0 0x00000000 ... 0xffffffffffffffff use the same idea as openssl command $ openssl dgst -sha256 -hmac "test" TODO HMAC-SHA256(TODO)= c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: add HMAC support for md5, sha1, sha224, sha256, sha384, sha512Jean-Christophe PLAGNIOL-VILLARD2015-03-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the hmac algo will be registered as hmac(%s) such as hmac(sha256) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: make it multi-instanceJean-Christophe PLAGNIOL-VILLARD2015-03-121-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now you need to call digest_alloc and when you finish to use it digest_free. We need this for upcomming aes encryption support and secure boot as we will need multiple instance of the same digest. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: introduce digest_{init/update/final/length}Jean-Christophe PLAGNIOL-VILLARD2015-03-121-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow to move from a one at a time digest to a multi-instance with too much impact on the code using it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | pci: make sure to activate devices on the root busLucas Stach2015-04-131-0/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b8a1bb1dd215 (pci: defer device registration until after bridge setup) changed the activation order of devices, so that bridges above the devices could be configured properly before activating the devices below. This commit failed to acknowledge that there may be devices located directly on the root bus without any bridge in between and so those devices would never get enabled. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* | | lib: Add hex2bin and bin2hex implementationsSascha Hauer2015-03-131-0/+4
| |/ |/| | | | | | | | | | | Taken from the Kernel, put into the same place as in the kernel, although the hexdump.c does not actually contain hexdum functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gitignore: only ignore include/config.hJean-Christophe PLAGNIOL-VILLARD2015-03-121-1/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>