9
0
Fork 0
Commit Graph

186 Commits

Author SHA1 Message Date
Daniel Schultz 80807102b9 arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT
This patch is based on a patch from the U-Boot and fixes two errors with
the LCDC. Original commit message from Jyri Sarha [1]:
"Initialize EMIF OCP_CONFIG registers REG_COS_COUNT_1, REG_COS_COUNT_2,
and REG_PR_OLD_COUNT field for Beaglebone-Black and am335x-evm. With
the default values LCDC suffers from DMA FIFO underflows and frame
synchronization lost errors. The initialization values are the highest
that work flawlessly when heavy memory load is generated by CPU. 32bpp
colors were used in the test. On BBB the video mode used 110MHz pixel
clock. The mode supported by the panel of am335x-evm uses 30MHz pixel
clock."

The register values are generated by testing, because there is no formula
to calculate them. Also from Jyri Sarha [1]:
"In practice the only rule to find an optimal value is to find as high as
possible REG_PR_OLD_COUNT value that does not produce LCDC FIFO
underflows under worst case scenario. The worst case happens when the
highest pixel clock videomode with maximum bpp is used while memory
subsystem is stressed by endless stream of writes hitting the same
memory memory bank (can be the same address)."

It only contains the BeagleBone Black and the Phytec SoM, because I
don't have other boards.

[1] https://patchwork.ozlabs.org/patch/704013/

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-30 07:25:18 +01:00
Yegor Yefremov d385021578 arm: am33xx: add reset duration control register address definition
PRM_RSTTIME register provides settings for global and power domain
reset durations.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:33 +01:00
Teresa Remmet 3368a42e72 OMAP: am33xx_bbu_nand: Extent barebox update handler
Make it possible to write barebox image to multiple partitions
like xload partitions.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:37:24 +02:00
Teresa Remmet 7bfb94f978 OMAP: xload: nand: Check for redundant barebox partition
Add a support for a redundant barebox backup partition if loading
barebox image from first barebox partitions fails.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:37:24 +02:00
Teresa Remmet d316cda736 mtd: nand: omap_gpmc: Remove BCH4 support
This has no users and seems to be untested. Removed it.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-12 08:16:03 +02:00
Daniel Schultz 64a8df2f6d arm: am33xx: Master Osc clock speed handling
Setup the plls with Master Osc. clock speed from the SYSBOOT
Configuration Pin.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 08:01:06 +01:00
Daniel Schultz a4a28df47d arm: am33xx: Move function to read from Master OSC
Move the function to read the Master OSC speed from
the SYSBOOT Configuration Pin for reuse.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 08:01:06 +01:00
Sascha Hauer 5e11907b7b ARM: Omap3: Remove useless inline
Silences gcc5 warning:

In file included from arch/arm/mach-omap/gpmc.c:31:0:
arch/arm/mach-omap/include/mach/sys_info.h:93:83:
warning: inline function 'get_sysboot_value' declared but never defined

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 11:05:49 +01:00
Daniel Schultz b9672eb87d ARM: am33xx: Add barebox_update eMMC option
With this patch the barebox_update command will be extended by the possibility
to flash the MLO to eMMC devices.

The MLO will be flashed to the following addresses:
0x00000
0x20000
0x40000
0x60000

Because the first 512 Bytes of the MLO are reserved for the CHSETTINGS header
and this only use ~80 Bytes, there is space for the partition table in the
header.

The command will overwrite the bootstrap code area and will hold the
partition table and the Boot signature.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-09 08:59:28 +02:00
Sascha Hauer 83b0a5ae05 restart: replace reset_cpu with registered restart handlers
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>
2015-08-27 21:37:03 +02:00
Michael Grzeschik a2d81f787a ARM: OMAP: AM33xx: add uart1 pinmux setup
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-24 09:22:06 +02:00
Daniel Schultz 7dc53b3bb2 ARM: am335x: Changed timer
The 32KHz from dmtimer0 is derived from a SoC internal RC oscillator
which is quite inaccurate. Switch to dmtimer2 which is driven from
the high frequency oscillator clock.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:33:11 +02:00
Sascha Hauer 18ea2863bf Merge branch 'for-next/omap'
Conflicts:
	arch/arm/boards/beagle/board.c
2015-07-03 08:38:17 +02:00
Sascha Hauer 1d7c8ec143 ARM: OMAP: Add omap3 USB loader tool
The OMAP3 supports uploading the first stage bootloader via USB.
The ROM leaves the MUSB controller enabled and it can then be used
to upload a 2nd stage image. This patch adds the omap3-usb-loader tool
and the necessary barebox support to upload the 2nd stage image.

The omap usb loader tool is downloaded from https://github.com/grant-h/omap_loader
and changed to also accept CHSETTINGS images.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 08:20:48 +02:00
Sascha Hauer 302076b017 ARM: OMAP3: Change DSS divider to the one U-Boot uses
U-Boot uses 2 as the DSS divider, so do the same in barebox. This
shouldn't currently have any effect to barebox, but makes porting
some U-Boot code easier which makes assumptions about the DSS clock
rate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 08:20:44 +02:00
Sascha Hauer 6839250041 ARM: AM335x: replace specific barebox update handler with generic one
The AM335x SPI NOR barebox update handlers only writes a file to a device,
so use the generic handler for this purpose.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-01 09:10:59 +02:00
Wadim Egorov eb657a510b ARM: am33xx: Add support for reset reason detection
Also activate in defconfig.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-02 07:54:13 +01:00
Masahiro Yamada d8753571b2 sizes.h: move include/sizes.h to include/linux/sizes.h
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>
2015-01-08 14:00:26 +01:00
Teresa Gámez be23843702 ARM: am335x: Add register of boot devices
Add support for registering disabled boot devices from oftree.
Creating a device tree with all bootable devices disabled, makes
it possible to only enable and register the devices needed to
load the next stage bootloader.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 15:44:59 +01:00
Wadim Egorov 64e9e2ff0d arm: am33xx: Add rmii2_crs_dv mux selection in SMA2 register
"Silicon revision 1.0 devices only provide the MMC2_DAT7 signal when Mode3 is
selected. Silicon revision 2.0 and newer devices implement another level of
pin multiplexing which provides the original MMC2_DAT7 signal or RMII2_CRS_DV
signal when Mode3 is selected. This new level of of pin multiplexing is
selected with bit zero of the SMA2 register."

See AM335x Sitara Processors Manual.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 13:29:00 +01:00
Sascha Hauer a65334019b Merge branch 'for-next/musb' 2014-10-02 08:54:42 +02:00
Sascha Hauer 33e35f208e ARM: am335x: Add a NAND update handler for the regular barebox
To be able to not only update the MLO in NAND but also the
regular barebox image.
Since this is implemented with help of the corresponding xload
handler this also removes the 'xload' from the Kconfig options
and the filename.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-30 11:21:43 +02:00
Rolf Evers-Fischer e1b1d0f9ec ARM: AM33xx: Enable USB and USB phy clocks
These are necessary for USB support. To make sure they are actually
enabled when a USB capable barebox is started call the clock enable
function during startup also for the full barebox, not only the MLO.

Signed-off-by: Rolf Evers-Fischer <rolf.evers.fischer@delphi.com>
2014-09-26 21:36:58 +02:00
Sascha Hauer 0a2070b8fe ARM: AM33xx: Add AFI GF board support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-26 14:07:14 +02:00
Sascha Hauer 61cbf21fd5 ARM: AM33xx: Add SDRAM size detection
This adds a function which reads back the SDRAM controller settings.
This is used in a AM33xx specific barebox entry function and a
SDRAM driver which registers a SDRAM memory bank.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 15:22:42 +02:00
Antony Pavlov 8e89bc594a treewide: remove address of the Free Software Foundation
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>
2014-06-11 08:35:25 +02:00
Wadim Egorov 2565cac2cf ARM: omap: barebox update nand xloadslots handler
- Added barebox nand xloadslots update handler
- This handler updates all given xload slots in nand

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-19 09:15:39 +02:00
Sascha Hauer fb061bffe4 ARM: AM33xx: Add SPI bbu handler
We already have an update handler for the MLO on SPI, add
a update handler for the regular barebox aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 12:45:23 +02:00
Sascha Hauer 4fea2ceb98 ARM: am33xx: Add missing include
am33xx-generic.h needs memcpy, so include string.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 12:45:02 +02:00
Sascha Hauer a570417687 ARM: am33xx: Pass uart_base to soft_reset function
To make am33xx_uart0_soft_reset more flexible rename it to
am33xx_uart_soft_reset and pass the UART base to it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 12:45:02 +02:00
Sascha Hauer caa31714b5 ARM: AM33xx: make bbu handler static inline
The static inline wrapper for am33xx_bbu_spi_nor_mlo_register_handler
lacked the 'static inline'. add it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 12:44:39 +02:00
Sascha Hauer 1debe41a93 ARM: omap3: Add missing include
omap3-generic.h needs memcpy, include linux/string.h for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-03 15:12:56 +01:00
Sascha Hauer ee7f5d5d50 ARM: OMAP: Safe boot info in fixed SRAM address
Storing the boot information in the image itself and passing a pointer
around between images is cumbersome and doesn't fit well with multiimage
support where the pointer we pass around is already occupied by the
devicetree.
Do the same as U-Boot does and store the boot information at the bottom
of the SRAM public stack.
To maintain the compatibility between new xloaders and older barebox
binaries we still pass the boot information to the next stage via pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-10 14:35:34 +01:00
Sascha Hauer ed039cd72b Merge branch 'for-next/omap-drivers' 2013-12-06 08:23:27 +01:00
Sascha Hauer 599e61ebd9 bus: Add omap gpmc driver
This adds a devicetree-only driver for to configure the gpmc and its
child devices from dt. Currently only NAND is supported.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:54 +01:00
Sascha Hauer e0fbce20e6 ARM: OMAP: centralize omap startup
This introduces a single omap_init function which detects the
SoC and does all further SoC initialization. This is done to get
rid of initcalls without proper SoC protection. The same has been
done for i.MX already.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 21:34:06 +01:00
Sascha Hauer 1869803405 spi: omap: encode register offset into device_id
The omap3 and omap4/am33xx spi cores differ in the offset of the
registers in the address space. Instead of encoding this into the
resources use the platform_device_id mechanism. This is done in
preparation for devicetree probe support where the address space
is in the devicetree and can't be adjusted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:35:12 +01:00
Sascha Hauer dd04578bb2 ARM: OMAP: Make debug_ll UART Kconfig selectable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:34:36 +01:00
Sascha Hauer 5a4d27516e ARM: am33xx: Add am33xx_ prefix to SoC specific functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 14:24:03 +01:00
Sascha Hauer cca45a3299 ARM: OMAP: Make cpu_is_* macros runtime if necessary
Currently unused, just preparation for the next steps when we'll
get multiarch support for OMAP.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 11:25:37 +01:00
Sascha Hauer f56a48471a ARM: OMAP: select correct reset_cpu function at runtime
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 11:25:01 +01:00
Sascha Hauer f6b399ef9b ARM: OMAP: Add SoC prefix to running_in_* functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 11:24:42 +01:00
Jan Weitzel c988b8bf7f i2c-omap: Update driver
The driver didn't work well with at24 driver. NACKS are lost.
Errors are lost in isr due to the local variable err. Also we didn't wait for
bus free in omap_i2c_xfer_msg.

Fix issues and get other improvements from linux kernel

Tested on OMAP4 and AM335x

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 16:24:37 +02:00
Sascha Hauer 5913b71943 ARM: OMAP: register OMAP specific barebox bootm handler
The OMAP ROM code passes the boot information via r0 to the
bootloader. Add an OMAP specific barebox handler to pass this
information to the next stage. This allows us to chainload
bootloaders without loosing the information where we booted from.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 16:13:19 +02:00
Sascha Hauer 7f6b6d25d8 Merge branch 'for-next/omap'
Conflicts:
	arch/arm/boards/pcm051/env/config
2013-09-05 10:40:04 +02:00
Teresa Gámez f1cf4433bf PCM051: Fixup DDRPLL
The correct DDRPLL for PCM051 is 303MHz.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-05 10:15:49 +02:00
Sascha Hauer abd545d2f9 ARM: am33xx: make DDR PLL frequency configurable
Needed for 400MHz DDR3.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:34 +02:00
Sascha Hauer e3cbf4f762 ARM: am33xx: Add mmc1 registration helper
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:33 +02:00
Jan Luebbe ed02d24564 ARM: am33xx: implement cpu revision decoding
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:33 +02:00
Teresa Gámez 9f122f8bf0 ARM: am33xx: Cleanup of lowlevel code
There is a lot of duplicate lowlevel code between the
am33xx boards. Move this code to am33xx_generic and
create structs for sdram settings.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:33 +02:00