summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs
Commit message (Collapse)AuthorAgeFilesLines
* rename file_operations -> cdev_operationsSascha Hauer2018-04-061-1/+1
| | | | | | | | Linux also has struct file_operations which are something different. Rename our file_operations to cdev_operations which better matches what we have. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx/mxs remove mxs-usb-loaderOleksij Rempel2017-03-091-7/+0
| | | | | | | ... and use imx-usb-loader instead Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make generic default environment type a use choiceSascha Hauer2016-10-101-5/+0
| | | | | | | | So far it was hardcoded for each board if defenv-1 or defenv-2 is used. Make this a user choice so that a particular board no longer enforces a defenv type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mxs: add parameter to mx28_mem_init to allow custom memory configUwe Kleine-König2016-05-102-8/+8
| | | | | | | | | | Rename the already global array of default memory settings to make the intended usage more obvious. Also make generous use of the const keyword. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/restart'Sascha Hauer2015-09-012-8/+9
|\
| * restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-272-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: Drop asm-generic/gpio.hSascha Hauer2015-08-201-21/+0
|/ | | | | | | | | | Since we no longer have custom gpio function prototypes we can drop the prototypes from asm-generic/gpio.h can add them to include/gpio.h instead. While at it add static inline dummy wrappers for !CONFIG_GENERIC_GPIO so that code using gpios can compile without gpio support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: stm: code buswidth in platform data as decimalSascha Hauer2015-07-061-6/+1
| | | | | | | | | Instead of putting hardware specific bit masks in platform_data just use the decimal interface width and encode this in the driver. This makes it easier to create the platform_data and helps device tree based implementations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pwm'Sascha Hauer2015-07-031-0/+1
|\
| * ARM: i.MX28: Add PWM clk supportSascha Hauer2015-06-121-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: MXS: ocotp: Register a separate deviceSascha Hauer2015-06-121-1/+8
|/ | | | | | | | | With device tree the device name starts with a number, so the device parameters are not accessible on the shell. Register a separate device for the ocotp to make the permanent_write_enable variable accessible again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Add duckbill board supportSascha Hauer2015-02-031-0/+8
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: power-init: Add parameters to mx28_power_init()Sascha Hauer2015-02-032-30/+45
| | | | | | | | | | | | | | | | | | | Instead of introducing new functions each time a new power supply situation is to be added, this patch adds parameters to mx28_power_init. Right now there are three parameters: - has_battery - true when this board has a battery. - use_battery_input - true when this board is supplied from the battery input, but has a DC source instead of a real battery - use_5v_input - true when this board can use the 5V input The third one is introduced with this patch and allow to boot a board from 5v (USB) source only. The main necessary change this needs is that the DC-DC converter must always be sourced from DCDC_4P2 (DROPOUT_CTRL field of HW_POWER_DCDC4P2) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Add regulator debug printSascha Hauer2015-01-281-0/+37
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Setup vdda in power prepSascha Hauer2015-01-282-15/+15
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: ocotp: Add devicetree supportSascha Hauer2015-01-281-0/+9
| | | | | | Add the device tree compatible strings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Create ocotp device in SoC codeSascha Hauer2015-01-281-0/+1
| | | | | | | The ocotp device is completely SoC internal, no need to register it from boards. Register it from SoC code instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Make gpio a driverSascha Hauer2015-01-283-60/+8
| | | | | | This turns the MXS gpio support into a driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Do not register devices with device tree supportSascha Hauer2015-01-282-0/+6
| | | | | | | When a device tree is present the SoC internal devices come from it, so do not register them as platform devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MXS: power-init: inline only once used functionsSascha Hauer2015-01-281-93/+65
| | | | | | | mxs_power_init_4p2_params and mxs_power_init_4p2_regulator are used only once, so inline the code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Fix vddd brownout settingSascha Hauer2015-01-281-2/+2
| | | | | | | | The brownout setting can be at maximum 7*25mV below the voltage setting of the regulator. Set it to the minimum Voltage which is 1325mV. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: imx28evk: Update environment and configSascha Hauer2015-01-201-0/+1
| | | | | | | This switches the imx28evk to new environment and updates the defconfig file for tons of new features. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: imx28evk: Add lowlevel supportSascha Hauer2015-01-201-0/+1
| | | | | | | This switches the imx28evk to multiimage support and adds the lowlevel initialization to make the bootlets unnecessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2015-01-0924-8/+3275
|\
| * ARM: imx233-olinuxino: generate complete bootstreamJan Luebbe2015-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | - Enable multi-image support to generate bootstream, sd-card and 2nd stage images. - Handle pin-mux in lowlevel.c only. - Use fine-tuned memory setup from u-boot. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * arm: mxs: fix pin voltage register value for EMIJan Luebbe2015-01-051-1/+1
| | | | | | | | | | | | | | | | The EMI pins are documented in the reference manual as using value 0 for both 1.8V and 2.5V. Value 1 is reserved. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: MXS: Update Karo TX28 board supportSascha Hauer2015-01-051-0/+2
| | | | | | | | | | | | | | | | | | - enable multiimage support to generate bootstream, sd-card and 2nd stage images - Enable new defaultenv support - Enable more features Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: MXS: Add multiimage supportSascha Hauer2015-01-052-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Freescale MXS SoCs have a multi staged boot process which needs different images composed out of different binaries. The ROM executes a so called bootstream which contains multiple executables. The first one is executed in SRAM and the purpose of this binary is to setup the internal PMIC and the SDRAM. The second image is usually the bootloader itself. In case of barebox the bootstream is composed out of the self extracting barebox image (pblx) and the prepare stage for setting up the SDRAM. The bootstream image itself is useful for USB boot, but for booting from SD cards or NAND a BCB header has to be prepended to the image. In case of SD boot the image has the .mxssd file extension in barebox. Since the bootstream images are encrypted they are not suitable for 2nd stage execution. For this purpose the 2nd stage images are generated. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: MXS: Enable iomux support for pblSascha Hauer2015-01-051-0/+1
| | | | | | | | | | | | Upcoming lowlevel code for MXS needs the iomux setup functions Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: MXS: Add more base address definesSascha Hauer2015-01-052-0/+6
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: mxs: Add lowlevel setup from U-BootSascha Hauer2015-01-0511-0/+3236
| | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot has code to replace the infamous Freescale bootlet code. This patch adds this for barebox with some changes: - Separate it more into mx23/mx28 functions instead of mxs functions with #ifdefs for the actual SoC - Add mx2x_power_init_battery_input() power entry point for boards which have a regulated input on the battery pin to supply the board. - Export more functions to be more flexible when boards need non standard setup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: MXS: remove unnecessary mach/imx-regs.h includeSascha Hauer2015-01-057-7/+6
| | | | | | | | | | | | And replace the ones needed with the SoC specific header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: Add mxs-usb-loader toolSascha Hauer2015-01-051-0/+7
| | | | | | | | | | | | | | | | This is directly taken from the rockbox projects sbloader tool, just renamed to mxs-usb-loader to avoid confusion with bareboxes several different image tools. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-082-2/+2
|/ | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Reuse init_clock() return value for clocksource driversAlexander Shiyan2014-11-101-2/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxs: iomux-imx23/imx28: add additional checks on modeUwe Kleine-König2014-11-031-4/+19
| | | | | | | | | | | | | This catches wrong modes: - request to enable the pull up on a pin that doesn't have one. - ditto for bit keepers, drive strength and voltage Additionally only write values for a given pin if the mode has the corresponding value set. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxs: iomux-imx23/imx28: unify mode definitionUwe Kleine-König2014-11-033-121/+82
| | | | | | | | | | | | | | | | | i.MX23 and i.MX28 iomux mode definitions differ for no good reason. Compared to the two previous definitions this introduces a few flags that are not used yet but this changes in the next commit to detect broken definitions. Apart from different constants this commit intends to be a no-op. If there are changes in the register values there is either a bug in this patch or the used mode is broken (e.g. a pullup value is defined for a pin that has a bitkeeper). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxs: iomux-imx28: Fix keeper/pullup/drive strength/voltage flagsUwe Kleine-König2014-10-271-26/+26
| | | | | | | | | | | | | Double check all pin's BK, PE, SE and VE flags and correct wrong definitions using i.MX28 Applications Processor Reference Manual, Rev 2, 08/2013. Fixes: b1df39c28c7f (mxs: Add remaining i.MX28 iomux configurations) Fixes: e2cee7cb6790 (mxs: add support for mx28-evk) Fixes: 03e61e1bd967 (STM378x: Add i.MX28 architecture) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+3
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-111-3/+0
| | | | | | | | | | | | | | | | | | The FSF address has changed; The FSF site says that address is Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA (see http://www.fsf.org/about/contact/) Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: mxs: support overwriting the device name via platform dataUwe Kleine-König2013-11-111-0/+1
| | | | | | | | | | | | | The current implementation of the bootloader specification depends on the hardware name and the name of the device in /dev to match. As the default hardware name is mciX and the device name is diskY the bootloader spec cannot be used as is. This patch implements a way to overwrite the device name similar to what is possible for the imx-esdhc driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mxs: Fix signed/unsigned arguments for printfAlexander Shiyan2013-11-112-5/+5
| | | | | | | | "%d" in format string requires a signed integer. "%u" in format string requires a unsigned integer. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bcb: fix compilationEric Bénard2013-10-281-2/+2
| | | | | | | | | | | this fix : arch/arm/mach-mxs/bcb.c:268: error: too few arguments to function 'chip->ecc.read_page_raw' arch/arm/mach-mxs/bcb.c:309: error: too few arguments to function 'chip->write_page' caution : this is NOT runtime tested. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx28-regs: i.MX28 has 2 USB controllersEric Bénard2013-09-111-1/+2
| | | | | | | so declare both base address Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb-imx28: fix enableEric Bénard2013-09-101-2/+3
| | | | | | | we need to power on the PLL when enabling the USB clock. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/boardinfo'Sascha Hauer2013-09-051-8/+0
|\ | | | | | | | | | | | | Conflicts: arch/mips/boards/qemu-malta/init.c commands/bootm.c drivers/of/base.c
| * Set model and hostname at boardlevelSascha Hauer2013-08-161-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | With multiboard support the compiletime generated BOARDINFO string gets more and more meaningless. This removes it from Kconfig and replaces it with a variable that can be set at boardlevel. Also many boards have a standard setting for the hostname in the environment. This patch also moves the standard to C code by calling barebox_set_hostname(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>