]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-firmware/ti-amx3-cm3-pm-firmware.git/log
processor-firmware/ti-amx3-cm3-pm-firmware.git
8 years agoCM3: Bump firmware release to 0x191 next ti2015.09.01 ti2016.01
Dave Gerlach [Thu, 5 Mar 2015 03:34:54 +0000 (21:34 -0600)]
CM3: Bump firmware release to 0x191

This version, 0x191, includes the following changes:
     - Add trace output on boot for kernel remoteproc driver
     - Fix resouce table as RSC_INTMEM is no longer used in kernel
     - Add header dependency checking

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
8 years agoCM3: Makefile: Add header dependency check to build
Dave Gerlach [Tue, 1 Sep 2015 16:45:52 +0000 (11:45 -0500)]
CM3: Makefile: Add header dependency check to build

Make sure to rebuild any .c files that depend on header files that have
changed by generating .d dependency files for each object file. Also, add
the .d files that get generated to the .gitignore file and to the make
clean job, and change use of 'find -exec' to delete .o and .d files to
'find -delete'

Reviewed-and-Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
8 years agoCM3: scripts/generate: Only generate version.h if changed
Dave Gerlach [Tue, 1 Sep 2015 16:42:41 +0000 (11:42 -0500)]
CM3: scripts/generate: Only generate version.h if changed

In preparation of adding header dependency checking, change the
version.h generate script to only generate the file if a new version
needs to be generated, otherwise any file that depends on version.h will
always need to be rebuilt because the file time changes on every build.

Reviewed-and-Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
8 years agoCM3: Makefile: Update default CROSS_COMPILE to arm-linux-gnueabihf-
Dave Gerlach [Tue, 1 Sep 2015 15:08:37 +0000 (10:08 -0500)]
CM3: Makefile: Update default CROSS_COMPILE to arm-linux-gnueabihf-

Update the name of the default CROSS_COMPILE variable to match the
compiler used today by the TI Processors SDK.

Reviewed-and-Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
8 years agoCM3: Makefile: allow CROSS_COMPILE to be defined on environment
Felipe Balbi [Thu, 27 Aug 2015 19:54:24 +0000 (19:54 +0000)]
CM3: Makefile: allow CROSS_COMPILE to be defined on environment

Not everybody will use the exact same toolchain, so
we should let people pass their own CROSS_COMPILE
when calling make.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Remove RSC_INTMEM entries from resource table
Dave Gerlach [Wed, 4 Mar 2015 16:20:15 +0000 (10:20 -0600)]
CM3: Remove RSC_INTMEM entries from resource table

RSC_INTMEM is not accepted into the linux kernel so remove
the entries from the resource table here.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: add trace output for booting rproc
Dave Gerlach [Wed, 4 Mar 2015 16:20:15 +0000 (10:20 -0600)]
CM3: add trace output for booting rproc

Output a debug message when firmware boots so remoteproc can see
it in it's trace log under sysfs.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Bump firmware release version to 0x190
Dave Gerlach [Mon, 15 Dec 2014 18:07:18 +0000 (12:07 -0600)]
CM3: Bump firmware release version to 0x190

This version, 0x190, includes the following changes:
     - Correction to interrupt clearing and disabling
     - Bug fix that caused AM335x CPUIdle to hang

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Fix deep_sleep bit field definition
Dave Gerlach [Thu, 4 Dec 2014 20:28:03 +0000 (14:28 -0600)]
CM3: Fix deep_sleep bit field definition

This patch changes size of res1 member of deep_sleep struct back to two
bits rather than one as changed in commit d7803c4a10 ("CM3: Add
additional bit for prcm int16"). When set to one a strange bit shift is
seen in wake_sources member causing incorrect wake sources to be defined
for each sleep state. Without this patch cpuidle no longer works as
MPU_WAKE bit gets incorrectly set.

9 years agoCM3: Fix low level interrupt configuration
Dave Gerlach [Tue, 26 Aug 2014 14:38:40 +0000 (09:38 -0500)]
CM3: Fix low level interrupt configuration

All interrupt control (enable, disable, clear) has been done using
read/modify/write strategy, however this is incorrect. According to the
ARM Cortex-M3 Devices Generic User Guide, Section 4.2.2-5, these
registers require a write to clear a bit. Because of this, the current
code has been doing each desired action to ALL interrupts held in that
register rather than the one requested.

However, due to the use-case in place, where we never needed to clear an
interrupt when leaving others active, this never manifested as a bug.
This patch fixes interrupt control so that each call clears, enables,
or disables only the interrupt requested.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Bump firmware release version to 0x189 ti2014.10.00
Dave Gerlach [Wed, 17 Sep 2014 21:43:47 +0000 (16:43 -0500)]
CM3: Bump firmware release version to 0x189

This version, 0x189, adds support for the following:
 - IO Daisy Chain wake on am437x

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Add IO wake up support
Keerthy [Thu, 11 Sep 2014 09:29:17 +0000 (14:59 +0530)]
CM3: Add IO wake up support

AM43XX family of processors have the IO wake up feature.
This patch adds support for enabling IO wake up.
Enable IO wake up while configuring the wake sources
and disable the same while clearing the wake sources.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Accommodate additional bit for PRCM int16 interrupt and add PRCM irq realted...
Keerthy [Thu, 11 Sep 2014 09:29:16 +0000 (14:59 +0530)]
CM3: Accommodate additional bit for PRCM int16 interrupt and add PRCM irq realted bit fields.

Expand wake sources mask to include prcm interrupt and add information
about PRM IRQ registers.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Add additional bit for prcm int16
Keerthy [Thu, 11 Sep 2014 09:29:15 +0000 (14:59 +0530)]
CM3: Add additional bit for prcm int16

Add another bit for prcm interrupt now that it can be a valid wake
source.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Do not loop on PRCM interrupt 16
Keerthy [Thu, 11 Sep 2014 09:29:14 +0000 (14:59 +0530)]
CM3: Do not loop on PRCM interrupt 16

Do not loop but on the event of PRCM IO Interrupt
clear the status after handling.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Add PRCM int16 as wake up source
Keerthy [Thu, 11 Sep 2014 09:29:13 +0000 (14:59 +0530)]
CM3: Add PRCM int16 as wake up source

Add PRCM int16 as wake up source.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Bump firmware release version to 0x188 (NEXT)
Dave Gerlach [Mon, 15 Sep 2014 23:28:32 +0000 (18:28 -0500)]
CM3: Bump firmware release version to 0x188 (NEXT)

On next branch add this bumped firmware for updated auxdata region

9 years agoCM3: Update mem regions for auxdata support
Dave Gerlach [Mon, 15 Sep 2014 23:07:10 +0000 (18:07 -0500)]
CM3: Update mem regions for auxdata support

Add auxdata region to linker script to avoid any strange issues with
auxdata being randomly overwritten. This was not a problem with previous
i2c scaling data implementation but seems to be an issue now. Also
adjust trace region to leave room for auxdata.

9 years agoCM3: Add board specific voltage scaling binaries
Dave Gerlach [Fri, 29 Aug 2014 14:21:26 +0000 (09:21 -0500)]
CM3: Add board specific voltage scaling binaries

This CM3 firmware supports voltaeg scaling during low power modes
using i2c sequences sent to the PMIC. These sequences are both board
and PMIC specific. Add binaries containing the proper sequence to be
loaded by the software in use and copied to DMEM. Firmware still can
accept the offset of the wake and sleep sequence in IPC register 5 as
was done previously.

Currently firmware format contains 0x0C57 present as the first two
bytes followed by one byte defining offset to sleep sequence followed by
one byte defining offset to wake sequence. These can be used by software
running on MPU to facilitate loading of the sequences, which immediately
follow the offsets in the binary.

The CM3 i2c code expects each sequence to be a series of I2C transfers
in the form:

u8 length | u8 chip address | u8 byte0/reg address | u8 byte1 | u8 byteN ..

The length indicates the number of bytes to transfer, including the
register address. The length of each transfer is limited by the I2C
buffer size of 32 bytes.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Bump firmware release version to 0x187
Dave Gerlach [Tue, 5 Aug 2014 16:44:20 +0000 (11:44 -0500)]
CM3: Bump firmware release version to 0x187

This version, 0x187, adds support for the following:
 - Further optimized IO DDR config on AM43xx platforms
 - Remoteproc resource table for use with the linux kernel
 - Standby support for am335x and am437x without any need for kernel
   clockdomain control.

Implementations not using the resource table will not be affected by
this, but all future implementations within the linux kernel will use
remoteproc and require this firmware or higher.

9 years agoCM3: clockdomain: Add standby_clkdms to enable standby
Dave Gerlach [Tue, 5 Aug 2014 20:45:39 +0000 (15:45 -0500)]
CM3: clockdomain: Add standby_clkdms to enable standby

Standby mode is a higher power mode than DS0 but can have better wake
latency because PER_PD remains active and therefore does not lose
context.

Certain clockdomains may get disabled by kernel code if they are not in
use but are required for waking MPU from standby. Add functionality
to wake certain clockdomains when resuming from standby and add relevant
clockdomains for both am335x and am43xx.

9 years agoCM3: ddr: Improve DDR IO Config for AM437x Boards
Dave Gerlach [Wed, 9 Jul 2014 20:51:52 +0000 (15:51 -0500)]
CM3: ddr: Improve DDR IO Config for AM437x Boards

Adjust values used for DDR IO Config on for am437x boards for better
power savings and also configure the two additional data io registers
only present on 437x.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
9 years agoCM3: Add resource table definition for use with remoteproc
Dave Gerlach [Wed, 9 Jul 2014 20:51:51 +0000 (15:51 -0500)]
CM3: Add resource table definition for use with remoteproc

Add a resource table so that the remoteproc framework within the Linux
kernel is able to load the firmware when the (Linux) driver probes in
order to specify where the needed memory regions are. Also add a TRACE
resource so that remoteproc can access the LOGBUF from the kernel for
debug output.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Add Tamper swakeup settings master
ankur [Tue, 4 Mar 2014 09:32:41 +0000 (15:02 +0530)]
CM3: AM43XX: Add Tamper swakeup settings

Provision of swakeup from Tamper source is a new addition for
AM43XX lineup SOCs.

So, below things are implemented :-

1. Tamper entry is made into list of swakeup sources.
2. Settings inside Configure/Clear wake-up source APIs.
3. Modified handlers(specific to AM43xx) to add Tamper swakeup.

Signed-off-by: ankur <a-kishore@ti.com>
10 years agoCM3: Bump firmware release version to 0x186
Russ Dill [Thu, 13 Feb 2014 22:52:06 +0000 (14:52 -0800)]
CM3: Bump firmware release version to 0x186

This includes fixes in I2C clock rate calculation for both
AM335x and AM437x. On all platforms, incorrect
calculations led to a frequency of around 520kHz
being used. The duty cycle is also corrected from 35%
to 50%.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: I2C: Fix duty cycle calculations
Russ Dill [Thu, 13 Feb 2014 22:45:43 +0000 (14:45 -0800)]
CM3: I2C: Fix duty cycle calculations

The duty cycle calculations were incorrect leading to a 35%
duty cycle. Rework the calculations to get a 50% duty cycle.

Tested on AM335x (BBB) and AM437x (ePOS EVM)

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: I2C: Fix PER CLKOUTM2 frequency calculation
Russ Dill [Thu, 13 Feb 2014 22:43:47 +0000 (14:43 -0800)]
CM3: I2C: Fix PER CLKOUTM2 frequency calculation

Based on experimental readings of the output I2C frequency,
the method used to calculate the PER CLKOUTM2 frequency
while the PER LL is in bypass was found to be incorrect. The
TRM for both AM437x and AM335x indicate that a divisor is
applied. This was found to not be the case.

Having this divisor in the code bottoms out the SCLL and SCLH
registers and causes the I2C controller to run at the highest
possible frequency possible given the input clock. This turns
out to be ~500kHz, which isn't a problem on most platforms.
However, with the AM437x ePOS EVM, the bus is not stable at
this frequency.

Removing the assumption that this divisor is applied corrects
the calculations of the SCLL and SCLH registers leading to a
correct output frequency.

Tested on AM335x (BBB) and AM437x (ePOS EVM)

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: AM437x: Add XTAL calculation code and support am437x
Russ Dill [Thu, 13 Feb 2014 22:39:07 +0000 (14:39 -0800)]
CM3: AM437x: Add XTAL calculation code and support am437x

The AM437x CONFIG_STATUS register has two places where
the master xtal frequency can be indicated, and a bit showing
where software should read the value from.  Make a function
that works for both instead of open coding it in i2c.c. This
function works for both because the bit that indicates where
to read the value from is always 0 on am335x.

This was causing issues with a miscalculation of i2c fclk
frequency on AM437x.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Update the pre-build binary to support am43xx IO isolation v05.00.00.02
Russ Dill [Sat, 1 Feb 2014 01:22:24 +0000 (17:22 -0800)]
CM3: Update the pre-build binary to support am43xx IO isolation

Firmware version 0x185

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: ddr: Only clear DDR reset line for AM335x
Dave Gerlach [Fri, 31 Jan 2014 21:57:30 +0000 (15:57 -0600)]
CM3: ddr: Only clear DDR reset line for AM335x

DDR reset line on am335x does not behave the same way as that on am43xx
so only clear it for am335x DDR3 boards.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX Add support for IO Isolation
Dave Gerlach [Fri, 31 Jan 2014 21:57:29 +0000 (15:57 -0600)]
CM3: AM43XX Add support for IO Isolation

Allow configuration of PRCM IO Isolation control in order to put IOs
into isolation and use DS0 states of pins. Implementation based on VTT
toggle control for GPIO0. The setting of isolation is controllable from
the A9 and will only be set if bit 10 in the IPC register has been set
from the A9 processor.

This is used to control VTT regulator on AM43xx when it is not connected
to a GPIO other than GPIO0 but can be used to control other things based
on the configuration of the DS_PAD_CONFIG bits inside the CTRL_CONF_*
register corresponding to the desired pin.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agocm3: bug-fix for cm3 version generator script
Tero Kristo [Mon, 27 Jan 2014 13:50:17 +0000 (15:50 +0200)]
cm3: bug-fix for cm3 version generator script

Script was incorrectly using logical OR instead of a binary one, which
resulted in the version being always 0x1 and being rejected by kernel.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
10 years agocm3: License.txt: break lines at 80-characters
Felipe Balbi [Mon, 23 Dec 2013 20:18:50 +0000 (14:18 -0600)]
cm3: License.txt: break lines at 80-characters

It makes it a lot easier to read through the file.

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: utf8-ify License.txt agreement
Felipe Balbi [Mon, 23 Dec 2013 20:18:27 +0000 (14:18 -0600)]
cm3: utf8-ify License.txt agreement

Original file was in some weird character-set,
by converting it to UTF-8, we make sure more
readers are able to read it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: improve Makefile a little more
Felipe Balbi [Mon, 23 Dec 2013 20:17:01 +0000 (14:17 -0600)]
cm3: improve Makefile a little more

after this patch, with a simple make command
we will build both new binaries and output
looks very clean, as below:

$ make
     CC       src/foundation/cm3.o
     CC       src/foundation/exception_handlers.o
     CC       src/foundation/ext_intr_handlers.o
     CC       src/foundation/rtc.o
     CC       src/foundation/startup.o
     CC       src/lib/debug.o
     CC       src/lib/printf.o
     CC       src/lib/puts.o
     CC       src/lib/string.o
     CC       src/pm_services/clockdomain.o
     CC       src/pm_services/clockdomain_335x.o
     CC       src/pm_services/clockdomain_43xx.o
     CC       src/pm_services/ddr.o
     CC       src/pm_services/dpll.o
     CC       src/pm_services/dpll_335x.o
     CC       src/pm_services/dpll_43xx.o
     CC       src/pm_services/hwmod.o
     CC       src/pm_services/hwmod_335x.o
     CC       src/pm_services/hwmod_43xx.o
     CC       src/pm_services/i2c.o
     CC       src/pm_services/ldo.o
     CC       src/pm_services/ldo_335x.o
     CC       src/pm_services/ldo_43xx.o
     CC       src/pm_services/pm_handlers.o
     CC       src/pm_services/powerdomain.o
     CC       src/pm_services/powerdomain_335x.o
     CC       src/pm_services/pm_state_data.o
     CC       src/pm_services/powerdomain_43xx.o
     CC       src/pm_services/prcm_core.o
     CC       src/sys_exec/msg.o
     CC       src/sys_exec/sync.o
     CC       src/sys_exec/sys_init.o
     CC       src/sys_exec/trace.o
     LINK     am335x-pm-firmware.elf
     GEN      am335x-pm-firmware.bin

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: generate version number from Makefile
Felipe Balbi [Mon, 23 Dec 2013 20:17:00 +0000 (14:17 -0600)]
cm3: generate version number from Makefile

This will make it a lot easier to make releases
out of this source code.

In order to make sure we're using the same version
number, this patch also changes Makefile to use
version 0x184.

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: add a script to generate version number
Felipe Balbi [Mon, 23 Dec 2013 20:16:59 +0000 (14:16 -0600)]
cm3: add a script to generate version number

This way we can fix version number in Makefile
only.

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: add tags and *.diff to .gitignore
Felipe Balbi [Mon, 23 Dec 2013 20:16:58 +0000 (14:16 -0600)]
cm3: add tags and *.diff to .gitignore

few extra files which should be ignored.

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: pretty print build sequence
Felipe Balbi [Mon, 23 Dec 2013 20:16:57 +0000 (14:16 -0600)]
cm3: pretty print build sequence

This will make it a lot cleaner to look at
build output.

sample output:

$ make
     CC       src/foundation/cm3.o
     CC       src/foundation/exception_handlers.o
     CC       src/foundation/ext_intr_handlers.o
     CC       src/foundation/rtc.o
     CC       src/foundation/startup.o
     CC       src/lib/debug.o
     CC       src/lib/printf.o
     CC       src/lib/puts.o
     CC       src/lib/string.o
     CC       src/pm_services/clockdomain.o
     CC       src/pm_services/clockdomain_335x.o
     CC       src/pm_services/clockdomain_43xx.o
     CC       src/pm_services/ddr.o
     CC       src/pm_services/dpll.o
     CC       src/pm_services/dpll_335x.o
     CC       src/pm_services/dpll_43xx.o
     CC       src/pm_services/hwmod.o
     CC       src/pm_services/hwmod_335x.o
     CC       src/pm_services/hwmod_43xx.o
     CC       src/pm_services/i2c.o
     CC       src/pm_services/ldo.o
     CC       src/pm_services/ldo_335x.o
     CC       src/pm_services/ldo_43xx.o
     CC       src/pm_services/pm_handlers.o
     CC       src/pm_services/pm_state_data.o
     CC       src/pm_services/powerdomain.o
     CC       src/pm_services/powerdomain_335x.o
     CC       src/pm_services/powerdomain_43xx.o
     CC       src/pm_services/prcm_core.o
     CC       src/sys_exec/msg.o
     CC       src/sys_exec/sync.o
     CC       src/sys_exec/sys_init.o
     CC       src/sys_exec/trace.o
     LINK     am335x-pm-firmware.elf

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agocm3: Makefile doesn't need execute permission
Felipe Balbi [Mon, 23 Dec 2013 20:16:56 +0000 (14:16 -0600)]
cm3: Makefile doesn't need execute permission

No functional changes, just a chmod.

Signed-off-by: Felipe Balbi <balbi@ti.com>
10 years agoCM3: Version 0x184 - Additional am43xx support ti2013.12.00 v05.00.00.01
Russ Dill [Wed, 11 Dec 2013 16:14:50 +0000 (08:14 -0800)]
CM3: Version 0x184 - Additional am43xx support

Firmware version 0x184

This adds several fixes and improvements for am43xx.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: AM43XX: Add missing hwmods
Dave Gerlach [Fri, 6 Dec 2013 21:10:04 +0000 (15:10 -0600)]
CM3: AM43XX: Add missing hwmods

IEEE5000 and OCPWP added to list of essential hwmods to idle before
attempting DS0 entry.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Add state data to shut off upper OCMC during DS0
Dave Gerlach [Fri, 6 Dec 2013 21:10:03 +0000 (15:10 -0600)]
CM3: AM43XX: Add state data to shut off upper OCMC during DS0

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: powerdomain: Add ability to shut off upper OCMC
Dave Gerlach [Fri, 6 Dec 2013 21:10:02 +0000 (15:10 -0600)]
CM3: AM43XX: powerdomain: Add ability to shut off upper OCMC

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Allow CORE_SRAM_LDO to be put in retention
Dave Gerlach [Fri, 6 Dec 2013 21:10:01 +0000 (15:10 -0600)]
CM3: AM43XX: Allow CORE_SRAM_LDO to be put in retention

Same core_sram_ldo code will work for am43xx as well so add it to check
before running code.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Update ds save and restore functions
Dave Gerlach [Fri, 6 Dec 2013 21:10:00 +0000 (15:10 -0600)]
CM3: AM43XX: Update ds save and restore functions

ds_save and ds_restore do not need to be only run for am33xx, same
functions will work for am43xx as well.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Add DDR ioconfig for LPDDR2
Dave Gerlach [Fri, 6 Dec 2013 21:09:59 +0000 (15:09 -0600)]
CM3: AM43XX: Add DDR ioconfig for LPDDR2

Add adjusted values to configure DDR IOs for LPDDR2 on AM43xx.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Add PLL registers and bits
Dave Gerlach [Fri, 6 Dec 2013 21:09:58 +0000 (15:09 -0600)]
CM3: AM43XX: Add PLL registers and bits

Add proper data to allow for power down and bypass of AM43xx plls.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: AM43XX: Cleanup AM43XX clockdomains
Dave Gerlach [Fri, 6 Dec 2013 21:09:57 +0000 (15:09 -0600)]
CM3: AM43XX: Cleanup AM43XX clockdomains

Some clockdomains did not apply to AM43XX that were present on AM33XX

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: Add timeouts for hwmod enable and disable
Dave Gerlach [Fri, 6 Dec 2013 21:09:56 +0000 (15:09 -0600)]
CM3: Add timeouts for hwmod enable and disable

If a hwmod cannot be enabled or disabled, timeout eventually and
continue. Timeout will be reflected in kernel error message due to
powerdomain not transitioning.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: Fix A8 Parameter Mask
Hebbar, Gururaja [Fri, 6 Dec 2013 21:09:53 +0000 (15:09 -0600)]
CM3: Fix A8 Parameter Mask

VTT GPIO PIN parameter is 6 bits and so the mask should be 0x3f & not
0x2f.

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
10 years agoCM3: Bump version and update the pre-built binary for I2C fixes
Russ Dill [Mon, 9 Dec 2013 20:36:09 +0000 (12:36 -0800)]
CM3: Bump version and update the pre-built binary for I2C fixes

Firmware version 0x183

The I2C suspend/resume write code had a couple bugs. One could cause a crash
on resume in the kernel, the other could cause a failure to resume due to the
resume sequence being sent out too fast.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: I2C: Move wake_handler to before the re-enabling of DPLLs
Russ Dill [Thu, 5 Dec 2013 23:08:14 +0000 (15:08 -0800)]
CM3: I2C: Move wake_handler to before the re-enabling of DPLLs

The wake handler calculates frequencies assuming the DPLL is in
bypass.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: I2C: Restore SCLH register properly
Russ Dill [Thu, 5 Dec 2013 23:07:28 +0000 (15:07 -0800)]
CM3: I2C: Restore SCLH register properly

10 years agoAdd debug support
Russ Dill [Thu, 5 Dec 2013 23:06:51 +0000 (15:06 -0800)]
Add debug support

10 years agoCM3: Leave I2C IP block the way we found it
Russ Dill [Mon, 25 Nov 2013 15:49:02 +0000 (07:49 -0800)]
CM3: Leave I2C IP block the way we found it

If we forcibly disable the HWMOD and the kernel expects it to be active, a
crash will occur. Save the original state and put it back properly. Additionally,
don't muck with the state at all if we don't need to.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Add hwmod_is_enabled check
Russ Dill [Mon, 25 Nov 2013 15:47:09 +0000 (07:47 -0800)]
CM3: Add hwmod_is_enabled check

This is needed so that if a IP block (such as I2C) is needed by the CM3 firmware,
it can be put back to its original state.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Update the pre-built binary with V2 command support v05.00.00.00
Russ Dill [Fri, 23 Aug 2013 11:20:39 +0000 (04:20 -0700)]
CM3: Update the pre-built binary with V2 command support

Firmware version 0x182

- V2 command support
- AM437X - Basic DS0 support
- I2C sleep/wake sequence support
- Return wakeup reason

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoAM335X: CM3: Add CPU idle handlers.
Russ Dill [Thu, 22 Aug 2013 21:39:38 +0000 (14:39 -0700)]
AM335X: CM3: Add CPU idle handlers.

This commit adds support for CPU idle modes. The wake source used during
CPU idle is MPU_WAKE so more of the SoC needs to be running as compared
to deep sleep modes.

Signed-off-by: Russ Dill <russ.dill@ti.com>
10 years agoCM3: Remove redundant rtc_timeout_val range check.
Russ Dill [Thu, 22 Aug 2013 07:58:25 +0000 (00:58 -0700)]
CM3: Remove redundant rtc_timeout_val range check.

The rtc_timeout_val field is 4 bits long. The RTC_TIMEOUT_MAX
val is 0xf. The field can never contain a value larger than 0xf.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Only re-enable master oscillator if it was disabled.
Russ Dill [Tue, 20 Aug 2013 10:09:39 +0000 (03:09 -0700)]
CM3: Only re-enable master oscillator if it was disabled.

This prepares the generic_wake_handler function to be shared by
cpu idle.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Reset IPC param registers at firmware boot
Russ Dill [Tue, 20 Aug 2013 10:02:30 +0000 (03:02 -0700)]
CM3: Reset IPC param registers at firmware boot

This prevents stale or uninitialized values from causing the I2C
code to think something is there.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move memory config globals to msg.c
Russ Dill [Tue, 20 Aug 2013 09:36:36 +0000 (02:36 -0700)]
CM3: Move memory config globals to msg.c

There should really only be one declaration for globals.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Remove unnecessary include statements.
Russ Dill [Tue, 20 Aug 2013 12:35:29 +0000 (05:35 -0700)]
CM3: Remove unnecessary include statements.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Remove now unused bits from prm335x.h
Russ Dill [Tue, 20 Aug 2013 09:16:26 +0000 (02:16 -0700)]
CM3: Remove now unused bits from prm335x.h

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Add functionality to powerdomain to read current state.
Russ Dill [Tue, 20 Aug 2013 09:15:45 +0000 (02:15 -0700)]
CM3: Add functionality to powerdomain to read current state.

This allows pm_handlers to not include any am335x headers.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move LDO register bits from prm335x.h to ldo.c
Russ Dill [Tue, 20 Aug 2013 09:07:25 +0000 (02:07 -0700)]
CM3: Move LDO register bits from prm335x.h to ldo.c

This allows ldo.c to not include any am335x or am43xx
specific headers.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoAM335x: CM3: Rename prmam335x.h to prm335x.h for consistency.
Russ Dill [Tue, 20 Aug 2013 09:04:58 +0000 (02:04 -0700)]
AM335x: CM3: Rename prmam335x.h to prm335x.h for consistency.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Break apart prcm.h
Russ Dill [Tue, 20 Aug 2013 09:00:31 +0000 (02:00 -0700)]
CM3: Break apart prcm.h

This breaks prcm.h into cm335x.h and cm43xx.h. This matches more closely
with the linux kernel and keeps am335x and am43xx defines separated.

Move the DPLL defines from prcm.h into dpll.c.
Move the DDR defines into ddr.c.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Get div for I2C from dpll helper functions.
Russ Dill [Tue, 20 Aug 2013 08:58:27 +0000 (01:58 -0700)]
CM3: Get div for I2C from dpll helper functions.

This eliminates the need for i2c.c to know the DPLL_PERIPH
address.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Remove unused system_am335.c
Russ Dill [Tue, 20 Aug 2013 08:34:30 +0000 (01:34 -0700)]
CM3: Remove unused system_am335.c

This code has been sitting as a skeleton since initial checkin,
if someone wants to fill it in, it'll still be in the git history.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Rename device_am335x.h device_common.h
Russ Dill [Tue, 20 Aug 2013 14:09:38 +0000 (07:09 -0700)]
CM3: Rename device_am335x.h device_common.h

Now that device_am335x only contains macros that are common
between am335x and am43xx, rename it to reflect such.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Rename constants that are CM3 specific to a CM3 namespace.
Russ Dill [Tue, 20 Aug 2013 14:07:02 +0000 (07:07 -0700)]
CM3: Rename constants that are CM3 specific to a CM3 namespace.

The interrupt numbers and internal memory areas are the same on
both am43xx and am335x. Name them as CM3_ and not AM335X_
and put them in a device_cm3.h header.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move RTC regs from device_am335x.h to rtc.h
Russ Dill [Tue, 20 Aug 2013 08:01:22 +0000 (01:01 -0700)]
CM3: Move RTC regs from device_am335x.h to rtc.h

These aren't SoC specific, so move them into rtc.h

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move I2C reg offsets from device_am335x to i2c.c
Russ Dill [Tue, 20 Aug 2013 08:00:52 +0000 (01:00 -0700)]
CM3: Move I2C reg offsets from device_am335x to i2c.c

These aren't SoC specific, so move them into i2c.c

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move usage of RTCSS_BASE into rtc.c
Russ Dill [Tue, 20 Aug 2013 07:53:23 +0000 (00:53 -0700)]
CM3: Move usage of RTCSS_BASE into rtc.c

This will make it easier to support an rtc with a different
address, as may be the case we am43xx.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Breakout IO functions into separate header.
Russ Dill [Tue, 20 Aug 2013 07:47:38 +0000 (00:47 -0700)]
CM3: Breakout IO functions into separate header.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Rename GPIO_BASE to GPIO0_BASE.
Russ Dill [Tue, 20 Aug 2013 07:40:20 +0000 (00:40 -0700)]
CM3: Rename GPIO_BASE to GPIO0_BASE.

Reflect properly that this is just the first GPIO bank.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Remove un-required includes of system_am335.h
Russ Dill [Tue, 20 Aug 2013 07:36:13 +0000 (00:36 -0700)]
CM3: Remove un-required includes of system_am335.h

Now that system_am335 just has stuff specific to system_am335.c,
we can remove a bunch of includes to it from the codebase.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move prototypes from system_am335 to i2c.h
Russ Dill [Tue, 20 Aug 2013 07:33:24 +0000 (00:33 -0700)]
CM3: Move prototypes from system_am335 to i2c.h

Move i2c.c prototypes from system_am335.h to i2c.h.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move prototypes from system_am335 to rtc.h
Russ Dill [Tue, 20 Aug 2013 07:31:56 +0000 (00:31 -0700)]
CM3: Move prototypes from system_am335 to rtc.h

Move rtc.c prototypes from system_am335.h to rtc.h.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move prototypes from system_am335 to sync.h
Russ Dill [Tue, 20 Aug 2013 07:29:58 +0000 (00:29 -0700)]
CM3: Move prototypes from system_am335 to sync.h

Move sync.c prototypes from system_am335 to sync.h.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move prototypes from system_am335 to trace.h
Russ Dill [Tue, 20 Aug 2013 07:26:53 +0000 (00:26 -0700)]
CM3: Move prototypes from system_am335 to trace.h

Move prototypes specific to trace.c from system_am335.h
to trace.h.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move things from system_am335 to pm_handlers.h
Russ Dill [Tue, 20 Aug 2013 07:24:08 +0000 (00:24 -0700)]
CM3: Move things from system_am335 to pm_handlers.h

Move prototypes and macros related to pm_handlers.c from
system_am335x.h into pm_handlers.h

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move relevant prototypes from system_am335 to prcm_core.h
Russ Dill [Tue, 20 Aug 2013 14:00:37 +0000 (07:00 -0700)]
CM3: Move relevant prototypes from system_am335 to prcm_core.h

Move prototypes and variables that are relevant for prcm_core.c from
system_am335.h to prcm_core.h.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move BITBAND defines for WAKE into prcm_core.c
Russ Dill [Tue, 20 Aug 2013 13:59:23 +0000 (06:59 -0700)]
CM3: Move BITBAND defines for WAKE into prcm_core.c

They are only used in prcm_core.c, so move them there.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Remove unused variables and macros from system_am335x.h
Russ Dill [Tue, 20 Aug 2013 13:56:31 +0000 (06:56 -0700)]
CM3: Remove unused variables and macros from system_am335x.h

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Create msg.h header for msg.c
Russ Dill [Tue, 20 Aug 2013 13:55:12 +0000 (06:55 -0700)]
CM3: Create msg.h header  for msg.c

Collect together the function prototypes, structs, and macros associated with
msg.c into an msg.h header.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Rename low_power.h to prcm_core.h to match c file.
Russ Dill [Tue, 20 Aug 2013 13:51:54 +0000 (06:51 -0700)]
CM3: Rename low_power.h to prcm_core.h to match c file.

This makes the codebase easier to follow.
Also, remove the header from places it isn't needed.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Move state_data into it's own file
Russ Dill [Tue, 20 Aug 2013 05:58:58 +0000 (22:58 -0700)]
CM3: Move state_data into it's own file

This reduces clutter in prcm_core.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Breakout LDO data for am335x/am43xx.
Russ Dill [Tue, 20 Aug 2013 05:48:17 +0000 (22:48 -0700)]
CM3: Breakout LDO data for am335x/am43xx.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Make LDO interface generic and separate am335x/am43xx
Russ Dill [Tue, 20 Aug 2013 05:42:25 +0000 (22:42 -0700)]
CM3: Make LDO interface generic and separate am335x/am43xx

This makes the LDO interface generic and prepares for a
am335x/am43xx split. The removal of the ES1_0 check is
ok because the code that calls it already checks for that.

Future work might include a flag indicating that an LDO can
or cannot be put into retention.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Breakout LDO control from prcm_core.
Russ Dill [Tue, 20 Aug 2013 05:17:31 +0000 (22:17 -0700)]
CM3: Breakout LDO control from prcm_core.

PRCM core is getting too big to be easily readable, break out the pieces.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Replace empty wrapper functions in hwmod.c with simple calls.
Russ Dill [Tue, 20 Aug 2013 11:02:34 +0000 (04:02 -0700)]
CM3: Replace empty wrapper functions in hwmod.c with simple calls.

This increases consistency, as some hwmods have their own special
function call, and some use the hwmod_state_change interface.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Replace empty wrapper functions in clockdomain.c for simple calls.
Russ Dill [Tue, 20 Aug 2013 04:59:07 +0000 (21:59 -0700)]
CM3: Replace empty wrapper functions in clockdomain.c for simple calls.

This introduces some consistency, as it be a bit weird to have
customized function calls for some clockdomains, but not others.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Rename pm_init to pm_reset to better match it's functionality.
Russ Dill [Tue, 20 Aug 2013 04:58:29 +0000 (21:58 -0700)]
CM3: Rename pm_init to pm_reset to better match it's functionality.

This function is called to reset all the state values to their default.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Breakout dpll data for am335x/am43xx.
Russ Dill [Tue, 20 Aug 2013 04:46:10 +0000 (21:46 -0700)]
CM3: Breakout dpll data for am335x/am43xx.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Rename am33xx_power_up/down_plls to be more generic.
Russ Dill [Tue, 20 Aug 2013 04:38:42 +0000 (21:38 -0700)]
CM3: Rename am33xx_power_up/down_plls to be more generic.

Once am43xx support is more complete, this will be supported on both platforms.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Break out separate am335x/am43xx DPLL functionality further.
Russ Dill [Tue, 20 Aug 2013 04:35:22 +0000 (21:35 -0700)]
CM3: Break out separate am335x/am43xx DPLL functionality further.

The am43xx support is a bit of a skeleton right now.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
10 years agoCM3: Add missing DPLL reset function.
Russ Dill [Tue, 20 Aug 2013 04:26:24 +0000 (21:26 -0700)]
CM3: Add missing DPLL reset function.

We store state, but don't reset that state on firmware reset, fix that.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>