summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs
Commit message (Collapse)AuthorAgeFilesLines
* ARM: mxs: Allow to compile all boards for a SoC togetherSascha Hauer2019-10-021-10/+0
| | | | | | | | | | All boards in mach-mxs support multi image, so we no longer have to make the board type a choice. Let the user compile all boards for a SoC together. We cannot compile i.MX23 together with i.MX28 though, there are still many conflicting defines which use the IMX_ namespace which are really SoC specific. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mxs: Move HAVE_PBL_MULTI_IMAGES up to ARCHSascha Hauer2019-10-021-7/+0
| | | | | | | Now that all boards in mach-mxs select HAVE_PBL_MULTI_IMAGES we can move it up to ARCH_MXS. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mxs: chumby: Switch to multi image supportSascha Hauer2019-10-021-0/+1
| | | | | | Build the Chumby as multi image. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mxs: imx23-evk: Switch to multi image supportSascha Hauer2019-10-021-0/+1
| | | | | | Build the i.MX23 EVK as multi image. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mxs: cfa10036: Switch to multi image supportSascha Hauer2019-10-021-0/+1
| | | | | | Build the cfa10036 as multi image. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2019-03-183-0/+3
| | | | | | | | | 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-181-5/+5
| | | | | | | 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>
* devfs: Drop dev_lseek_default()Andrey Smirnov2019-01-291-1/+0
| | | | | | | | | | | | | | | | | | | | | Only the following cdevs do not declare an .lseek() operation: - Console devices in common/console.c - Firmware framework in common/firmware.c - JTAG driver in drivers/misc/jtag.c - UBI in drivers/mtd/ubi/barebox.c Of those four, first two are marked DEVFS_IS_CHARACTER_DEV and implement only .write() operation and the last two don't implement anything but .ioctl(). While there's probably no meaningful way to use lseek() against any of those devices, there doesn't seem to be any harm in allowing it either. Change devfs_lseek() to ignore absense of .lseek() callback and drop dev_lseek_default() and all references to it in the codebase. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: Introduce dev_set_name()Andrey Smirnov2018-10-182-2/+2
| | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: mxs_power_status: align outputRoland Hieber2018-08-141-10/+10
| | | | | | | | | | | | | | | | | | | Exemplary previous behaviour: vddio: 3100mV (BO -200mV), Linreg enabled, Linreg offset: -1, FET enabled vdda: 1800mV (BO -175mV), Linreg disabled, Linreg offset: -1, FET enabled vddd: 1200mV (BO -175mV), Linreg enabled, Linreg offset: -1, FET disabled vddmem: 1500mV (BO -25mV), Linreg disabled After this patch this looks much cleaner: vddio: 3100mV (BO -200mV), Linreg enabled, Linreg offset: -1, FET enabled vdda: 1800mV (BO -175mV), Linreg disabled, Linreg offset: -1, FET enabled vddd: 1200mV (BO -175mV), Linreg enabled, Linreg offset: -1, FET disabled vddmem: 1500mV (BO - 25mV), Linreg disabled Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: mxs_power_status: use less magic valuesRoland Hieber2018-08-141-17/+20
| | | | | | | | | ... and in that process fix the erroneous usage of VDDA values when printing the stats for POWER_VDDDCTRL_DISABLE_FET and all of the *LINREG_OFFSET bitfields. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: make VDDx brownout setup more understandableRoland Hieber2018-08-141-3/+7
| | | | | | | | Rename bo_int to prev_bo_enirq to make its purpose clearer, and throw in a few comments for easier understanding. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: fix VDDx brownout setup logicRoland Hieber2018-08-141-3/+3
| | | | | | | | | | | The cfg->bo_irq and cfg->bo_enirq (i.e. VDDx_BO_IRQ and ENIRQ_VDDx_BO) flags are part of POWER_CTRL, so setting those flag in cfg->reg (i.e. POWER_VDDxCTRL) makes no sense. Fortunately, those bits are reserved in ENIRQ_VDDx_BO, so writing them did no harm, but also doesn't work as intended. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: make power levels configurable in mx2*_power_initRoland Hieber2018-08-142-11/+66
| | | | | | | | | | | | | Depending on the application, board code might want to configure different power levels and brownout thresholds. They can do so now with an additional struct mxs_power_ctrls* parameter to mx2*_power_init. Note that VDDMEM was not set up explicitely in mx28_power_init, but can now be configured. However, mx28_power_default->vddmem is NULL, so the old behaviour is still the case when using those default values. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: allow starting from battery input without 4P2 source enabledRoland Hieber2018-08-142-1/+4
| | | | | | | | | | | | | | Some boards don't need the 4.2V power source at all, so allow them to keep it disabled for efficiency reasons. For backwards compatibility, don't disable the 4P2 power source on the existing boards which are supplied from battery input. The POWER_USE_5V code path however always enables it up as it is needed to supply the DC-DC converter. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: refactor mx2*_power_init source configurationRoland Hieber2018-08-142-36/+37
| | | | | | | | | | | | Having three ints as parameter suggests that we can use up to 2^3 power configurations for the system, but when we look at the code, the power setup is packaged in if {...} else if {...} else if {...} blocks, so setting more than one parameter to 1 is useless here. Refactor the parameters into an enum to get rid of that suggestion. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX23: Add memory size detectionSascha Hauer2018-08-142-0/+33
| | | | | | | | | | No need for the boards to manually add memory, we can do this automatically by reading back the memory size from the SDRAM controller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX28: Add memory size detectionSascha Hauer2018-08-142-0/+34
| | | | | | | | | | | | | | We can detect the SDRAM automatically, no need to let the boards do it manually. This also fixes device tree based i.MX28 boards like the duckbill. These boards once had a /memory node in the device tree, but now that this was changed to /memory@40000000 barebox didn't find it anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: allow configuration of EMI clock prescalerRoland Hieber2018-08-142-11/+10
| | | | | | | | | | | | | Allow to set not only the fractional divider, but also the prescaler for the EMI clock in mxs_mem_init_clock(), and rename the parameters accordingly to reflect the change. Port the existing board code to set up the EMI clock explicitely with the old values. Also fix the off-by-a-half error in the comments, which did not take the prescaler of 2 into account, on which the fractional divider is applied (according to the i.MX23/i.MX28 Reference Manuals) Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: i.MX28: allow setup of low-voltage SDRAMRoland Hieber2018-08-142-7/+9
| | | | | | | | The PINCTRL_*_DDR_MODE_* defines are now needed in global scope, so move them to the respective include header. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>