summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Shell: Handle aborting loops betterSascha Hauer2019-04-245-8/+30
| | | | | | | | | | | | | | | | | | It's easy to get stuck in an infinite loop in the hush shell: while true; do sleep 1; done The 'sleep' command will check for ctrl-c with the ctrlc() function. This will abort the sleep command. Hush then checks for ctrl-c again in the loop. The ctrl-c in the buffer has already been eaten by the sleep command, so the loop will continue. With this patch we remember the presence of a ctrl-c character in a variable instead of checking for a new character each time. The variable must be resetted explicitly by calling ctrlc_handled() which will be called by the shell in the outer loop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hab/caam: Fix compilation of caam driver when hab is disabledSascha Hauer2019-04-113-6/+13
| | | | | | | | | The caam driver needs the variable habv4_need_rng_software_self_test, but this is only declared when HABV4 is enabled. Instead of exporting a variable rather provide a function to test if a software selftest of the random number generator is needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hab: habv4_need_rng_software_self_test is needed without hab supportSascha Hauer2019-04-111-1/+2
| | | | | | habv4_need_rng_software_self_test Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: socfpga: fix compiler warnings for Cyclone5Ian Abbott2019-04-101-3/+3
| | | | | | | | | | | | | | | When building for Cyclone5 SoCFPGA, the socfpga_a10_pll_init(), socfpga_a10_perith_init() and socfpga_a10_gate_init() functions are defined as dummy functions returning ERR_PTR(-ENOSYS). They are defined with external linkage. With '-Wmissing-prototypes' GCC warns about externally linked function definitions with no preceding prototype. Define them as 'static inline' to avoid the compiler warnings. (Note: Arria10 uses non-dummy versions of these functions declared 'extern' but defined elsewhere.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynqmp'Sascha Hauer2019-04-0914-3/+1344
|\
| * ARM: zynqmp: switch to firmware clock driverMichael Tretter2019-03-182-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | In the device tree, the clock controller is a subnode of the firmware node. Devices refer to the clocks by an id that is shared between the ATF and the driver. While the bindings for the clock controller are already upstream, the device in mainline Linux does not use them, yet. Add them in the Barebox device tree for now. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: add firmware DT nodeThomas Haemmerle2019-03-182-0/+18
| | | | | | | | | | | | | | | | | | Add firmware DT node in ZynqMP device tree. This node uses bindings as per new firmware interface driver. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: add ZynqMP clock driverMichael Tretter2019-03-188-0/+1162
| | | | | | | | | | | | | | | | | | | | | | | | The ZynqMP has a platform management unit (PMU) that is responsible for managing the clocks. Therefore, the clock driver uses the firmware driver to control the clocks. The Barebox driver is based on the Linux driver, but contains deviations to make the driver more readable and more consistent. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: move PAYLOAD_ARG_CNT to firmware headerMichael Tretter2019-03-182-2/+2
| | | | | | | | | | | | | | | | In order to use the query() call, the users of the firmware driver need to know the number of arguments. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: populate zynqmp_firmware dt nodeThomas Haemmerle2019-03-181-0/+1
| | | | | | | | | | | | | | | | | | | | The zynqmp_firmware node has sub-nodes for the various APIs to expose the platform management, as e.g. clock management. Therefore, the driver must populate the subnodes to initialize these drivers. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: populate "/firmware" while populating device treeThomas Haemmerle2019-03-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | The sub-nodes of "/firmware" are not populated, since it has no "compatible" property. Copy the behavior of Linux and call of_platform_populate() on the "/firmware" node to probe firmware drivers. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/warnings'Sascha Hauer2019-04-09106-284/+140
|\ \
| * | fs: squashfs: Remove unused functionSascha Hauer2019-03-181-108/+0
| | | | | | | | | | | | | | | | | | squashfs_lookup_next() isn't used in the tree. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mfd: twl-core: Add missing prototype for twlcore_get()Sascha Hauer2019-03-181-3/+4
| | | | | | | | | | | | | | | | | | twlcore_get() has no prototype provided in header file. Add it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bus: mvebu-mbus: Add missing whitespaceSascha Hauer2019-03-181-1/+1
| | | | | | | | | | | | | | | | | | orion5x_2win_mbus_data__maybe_unused should be two words. Fix it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: PXA: Provide prototype for pxa_clear_reset_source()Sascha Hauer2019-03-182-2/+4
| | | | | | | | | | | | | | | | | | | | | Move pxa_clear_reset_source() declaration to a header file where the file implementing it can see it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: sha256: Remove unused header fileSascha Hauer2019-03-181-23/+0
| | | | | | | | | | | | | | | | | | sha256_glue.h is not being unsed in the tree. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: sha256: Remove unused functionsSascha Hauer2019-03-181-18/+0
| | | | | | | | | | | | | | | | | | sha256_export and sha256_import are not used in the tree. remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: boards: Harmonize barebox_arm_reset_vector() prototypeSascha Hauer2019-03-1861-67/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox_arm_reset_vector() is a global function but we never provided a prototype anywhere. The prototypes differ for the different boards, so to provide a common prototype we must harmonize them. void barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2) Should be suitable for all boards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX: external-nand-boot: remove unused i.MX21 entrySascha Hauer2019-03-181-3/+0
| | | | | | | | | | | | | | | | | | | | | external nand boot on i.MX21 depends on broken for a long time no. As noone cared we remove it now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: Add missing includesSascha Hauer2019-03-1816-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Many files in the tree implement functions, but do not include the header files which provide the prototypes for these functions. This means conflicting prototypes remain undetected. Add the missing includes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: Make locally used functions staticSascha Hauer2019-03-1826-58/+43
| | | | | | | | | | | | | | | | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: semihosting: Fix function prototypeSascha Hauer2019-03-181-1/+1
| | | | | | | | | | | | | | | | | | lsee takes a loff_t pos argument and not a off_t argument. Fix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/usb-storage'Sascha Hauer2019-04-099-376/+265
|\ \ \
| * | | usb: storage: Inline usb_limit_blk_cnt()Andrey Smirnov2019-03-111-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Usb_limit_blk_cnt() has only one user so we may as well inline it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop unnecessary assignmentAndrey Smirnov2019-03-111-3/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Simplify I/O loop in usb_stor_blk_io()Andrey Smirnov2019-03-111-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify I/O loop a bit, by re-arranging things and dropping "sectors_done", "result" and "data" local variables. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Use simple boolean to speficy read vs. write operationAndrey Smirnov2019-03-111-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use simple boolean to speficy read vs. write operation usb_stor_blk_io() instead of having a custom anonymous enum. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop needless macroAndrey Smirnov2019-03-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's only user of the to_usb_mass_storage() so we may as well inline it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop unnecessary check in usb_stor_blk_io()Andrey Smirnov2019-03-111-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking that sector_count is zero, shouldn't be necessary since block layer won't call this function if there's no data to be read. Drop it. Checking that blockbits is eqal to SECTOR_SHIFT isn't necessary, since that field is filled by the driver and is not changed outsied of it. We know it is going to be SECTOR_SHIFT. Drop it. Checking sector_start > (ulong)-1 doesn't make sense at all since sector start is 'int' and it can't possibly be greater that ULONG_MAX. Drop it. Checking for sector_start >= pblk_dev->blk.num_blocks isn't necessary either, since we shouldn't receive request for invalid read from block layer. Drop it. Ditto for sector_count > INT_MAX and sector_start + sector_count > pblk_dev->blk.num_blocks. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Drop usb_disable_asynch()Andrey Smirnov2019-03-113-34/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no users of usb_control_msg() in the codebase that pass timeout of 0, so it doesn't look like usb_disable_asynch() has any effect on USB operation. Drop that function and remove all of its uses to simplify things. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Use put_unaligned_be* helpersAndrey Smirnov2019-03-111-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace explicit endianness casts with put_unaligned_be* helpers. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Introduce usb_stor_transport()Andrey Smirnov2019-03-111-96/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move retry logic found in all of the low-level usb_stor_* functions into a standalone subroutine and convert the rest of the code to use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop unused us_blkdev_listAndrey Smirnov2019-03-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no users of us_blkdev_list in the file. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop unused fields in struct us_dataAndrey Smirnov2019-03-112-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only bulk-only transport is supported by the currennt codebase, so ep_bInterval and recv_intr_ep are not really used. Remove them and all related code. While at it remove flags and subclass as well since they are not really used anywhere in the codebase. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ata: ahci: Do not include <scsi.h>Andrey Smirnov2019-03-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | No symbols found in <scsi.h> are used in this file. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: Do not include <scsi.h>Andrey Smirnov2019-03-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | No symbols found in <scsi.h> are used in this file. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop struct SCSI_cmd_blockAndrey Smirnov2019-03-115-97/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the info we need to pass to transport function can be captured in a struct us_blk_dev and two byte arrays, so having a dedicated struct with many unused fields doesn't really buy us anything. Drop the struct and convert the rest of the code to pass needed data explicitly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Remove unused variablesAndrey Smirnov2019-03-111-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop a number of variables no longer used in the code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Make usb_stor_request_sense() a standalone functionAndrey Smirnov2019-03-111-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't try to re-use caller's "ccb" and instead convert usb_stor_request_sense() to use its own for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Share code for READ(10) and WRITE(10)Andrey Smirnov2019-03-111-51/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both usb_stor_read_10() and usb_stor_write_10() do almost exactly the same thing, so merge them into a signle routine and adjust all of the users accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Drop extra call to transport in usb_stor_write_10()Andrey Smirnov2019-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There doesn't seem to be a particularly good reason to call ->trasport() one last time after 2 failures. Drop the call so allow sharing this code with usb_stor_read_10() in the following commit. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Make usb_stor_write_10() a standalone functionAndrey Smirnov2019-03-111-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move special preparation steps done before the call to usb_stor_write_10() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Make usb_stor_read_10() a standalone functionAndrey Smirnov2019-03-111-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move special preparation steps done before the call to usb_stor_read_10() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Make usb_stor_test_unit_ready() a standalone functionAndrey Smirnov2019-03-111-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move special preparation steps done before the call to usb_stor_test_unit_ready() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Make usb_stor_inquiry() a standalone functionAndrey Smirnov2019-03-111-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move special preparation steps done before and after call to usb_stor_inquiry() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Make usb_stor_read_capacity() a standalone functionAndrey Smirnov2019-03-111-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move special preparation steps done before and after call to usb_stor_read_capacity() inside the function itself for clarity and to allow futher code improvements. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Don't use "unsigned long" for 32-bit valuesAndrey Smirnov2019-03-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unsignled long will expand to 64-bit unsigned integer on 64-bit CPUs. This will break current code using it to read out two 32-bit values returned by READ_CAPACITY. Fix the proble by using "u32" explicitly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Replace custom debug tracing with dev_dbgAndrey Smirnov2019-03-113-90/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace custom debug tracing macros with a call to dev_dbg to simplify code and add device info into degug output. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: storage: Simplify memory allocation in usb_stor_probe()Andrey Smirnov2019-03-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace explicit malloc() + OOM check and memset() with a single call to xzalloc(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>