summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Merge branch 'for-next/spd'Sascha Hauer2019-03-0719-337/+806
|\
| * ddr_spd: Enable in PBLSascha Hauer2019-03-041-1/+1
| | | | | | | | | | | | | | SPD EEPROMs are typically needed in PBL when the SDRAM is not yet initialized. Enable compilation of the SPD support in PBL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ddr_spd: provide common SPD typeSascha Hauer2019-03-041-0/+10
| | | | | | | | | | | | | | Provide a common struct type for the different SPD EEPROM types. Can be used to pass around SPD data without specifying the DDR type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ddr_spd: Add function to read eepromSascha Hauer2019-03-042-0/+88
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ddr_spd: Update from U-BootSascha Hauer2019-03-045-217/+604
| | | | | | | | | | | | | | | | | | | | | | This updates the ddr_spd.h header file from U-Boot-2019.01 with some small changes: - typedefs are removed - "_s" suffix from struct types removed - remove unnecessary "extern" from function declarations Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * crc: Add PBL variant for crc_itu_t()Sascha Hauer2019-03-042-1/+17
| | | | | | | | | | | | | | Enable crc_itu_t() for PBL. For the PBL use the slower-but-smaller variant without table. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * crc: import crc_itu_t() from kernelSascha Hauer2019-03-0414-120/+88
| | | | | | | | | | | | | | | | Our cyc_crc16() function is the same function as crc_itu_t() in the Linux kernel. Import and use crc_itu_t() from the Kernel for consistency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rpi'Sascha Hauer2019-03-0728-56/+404
|\ \
| * | ARM: rpi: Clarify debug uart namesSascha Hauer2019-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | Now that we support the miniuart as lowlevel debug UART clarify that the other UARTs are PL011. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fixup! ARM: rpi: Add mini UART debug_ll supportSascha Hauer2019-03-071-1/+1
| | |
| * | fixup! ARM: rpi: move debug UART Kconfig settingsSascha Hauer2019-03-071-1/+1
| | |
| * | ARM: rpi: Add mini UART debug_ll supportSascha Hauer2019-03-062-0/+43
| | | | | | | | | | | | | | | | | | | | | The raspberry pi 3 comes up with the mini UART as default, so allow to use it for debug_ll output. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: move debug UART Kconfig settingsSascha Hauer2019-03-063-24/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In contrast to other architectures, R.Pi debug UART config was placed under the "System Type" menu, not under the "Debugging -> low-level debugging port". This made this setting easy to miss when enabling low level debug mesages. While at it use the existing base address defines rather than defining them again in Kconfig. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | debug_ll: Add ns16550 early debugging functionsSascha Hauer2019-03-061-0/+56
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | debug_ll: Move pl011 header file to architecture independent placeSascha Hauer2019-03-066-5/+5
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: Move UART base address definitions to header fileSascha Hauer2019-03-062-4/+5
| | | | | | | | | | | | | | | | | | Move defines to header file to make them reusable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: save bootargs from VC FDT to vc.bootargsTomaz Solc2019-03-042-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When booting a Raspberry Pi, it is useful to extract bootargs from the device tree that was created by the VideoCore firmware. These bootargs contain for example settings for the framebuffer that the kernel needs to properly set the video output. This commit extracts the bootargs in the board initialization code and saves them to the vc.bootargs global variable. For example, a bootloader environment can then add the contents of this variable to linux.bootargs.vc, which then gets included into the final bootargs for the kernel using CONFIG_FLEXIBLE_BOOTARGS. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: save fdt that was passed from VideoCoreTomaz Solc2019-03-044-19/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Raspberry Pi, VideoCore firmware creates a device tree that contains information about peripherals that were initialized by VideoCore based on settings in config.txt. Normally this device tree is passed to the Linux kernel via a pointer in the r2 register. A bootloader needs to pass this device tree to the kernel, or some peripherals will not work correctly. Since the VideoCore device tree is not compatible with barebox, we can't just pass it to barebox_arm_entry() as the internal barebox device tree. This commit makes the prebootloader code copy the device tree from VideoCore into a scrap RAM area just above the area reserved for the bootloader. Board initialization code in the bootloader proper then copies it into a file /vc.dtb. The bootloader environment is then free to pass this file to the kernel at boot (e.g. via bootm -o). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: start: save end of memory passed to start.Tomaz Solc2019-03-042-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Knowing the address of the end of the memory area used by Barebox is useful if PBL stores some extra data after it, so that board init code can later retrieve it from there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: add CONFIG_PINCTRL to rpi_defconfig.Tomaz Solc2019-02-191-1/+1
| | | | | | | | | | | | | | | | | | Required for emmc pin function switching on Raspberry Pi 3. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: Add device tree for Compute Module 3.Tomaz Solc2019-02-195-1/+40
| | | | | | | | | | | | | | | | | | | | | Compute Module needs "no-sd" property on the MMC interface otherwise mci-bcm2835 hangs on SD card probe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: bcm2835: parse other device tree properties.Tomaz Solc2019-02-191-0/+3
| | | | | | | | | | | | | | | | | | | | | The driver was missing a call to mci_of_parse() which fills in properties such as "bus-width", "no-sd" into the mci_host struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: bcm2835: use device_initcall(), not coredev.Tomaz Solc2019-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pinctrl driver needs to be initialized before mci driver on Raspberry Pi. Otherwise the pinctrl device tree properties in the mci node are ignored. pinctrl is initialized by coredevice_initcall(), so moving mci-bcm2835 to device_initcall() ensures that it is initialized later. There is no reason for mci-bcm2835 to use coredevice_initcall(). Other mci drivers already use device_initcall(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pinctrl: bcm2835: register the pin controller.Tomaz Solc2019-02-191-1/+51
| | | | | | | | | | | | | | | | | | | | | This adds hooks for the pin controller driver to the existing bcm2835_set_function(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pinctrl: bcm2835: move existing code from gpio.Tomaz Solc2019-02-196-6/+8
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Kconfig: add pin controllers submenu.Tomaz Solc2019-02-191-0/+4
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: switch emmc from sdhost to sdhciTomaz Solc2019-02-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BCM2837 has two mmc interfaces: sdhost and sdhci. On Raspberry Pi 3, sdhost is normally used for SD card/MMC flash and sdhci for the wireless interface. Barebox currently only has a driver for sdhci, so we disable the sdhost interface and remap the pins so that the sdhci has access to the SD card/MMC flash. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: bcm2835: set timeout_max.Tomaz Solc2019-02-181-0/+5
| | | | | | | | | | | | | | | | | | BCM2835 watchdog timeout can be set to maximum 15 seconds (0xffffff >> 16). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/nvme'Sascha Hauer2019-03-0720-25/+5870
|\ \ \
| * | | drivers: Import a very basic NVME implementation from LinuxAndrey Smirnov2019-02-1810-0/+2758
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import a very abridged NVME implementation from Linux kernel in order to be able to access NVME storage attached via PCIe. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>