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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
CM3: Update the pre-build binary to support am43xx IO isolation
Firmware version 0x185
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Firmware version 0x185
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
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>
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>
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>
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>
It makes it a lot easier to read through the file.
Signed-off-by: Felipe Balbi <balbi@ti.com>
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>
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>
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>
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>
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>
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>
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>
This way we can fix version number in Makefile
only.
Signed-off-by: Felipe Balbi <balbi@ti.com>
cm3: add tags and *.diff to .gitignore
few extra files which should be ignored.
Signed-off-by: Felipe Balbi <balbi@ti.com>
few extra files which should be ignored.
Signed-off-by: Felipe Balbi <balbi@ti.com>
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>
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>
cm3: Makefile doesn't need execute permission
No functional changes, just a chmod.
Signed-off-by: Felipe Balbi <balbi@ti.com>
No functional changes, just a chmod.
Signed-off-by: Felipe Balbi <balbi@ti.com>
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>
Firmware version 0x184
This adds several fixes and improvements for am43xx.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
IEEE5000 and OCPWP added to list of essential hwmods to idle before
attempting DS0 entry.
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
CM3: AM43XX: Add state data to shut off upper OCMC during DS0
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
CM3: AM43XX: powerdomain: Add ability to shut off upper OCMC
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
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>
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>
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>
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>
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>
Add adjusted values to configure DDR IOs for LPDDR2 on AM43xx.
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
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>
Add proper data to allow for power down and bypass of AM43xx plls.
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
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>
Some clockdomains did not apply to AM43XX that were present on AM33XX
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
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>
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>
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>
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>
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>
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>
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>
The wake handler calculates frequencies assuming the DPLL is in
bypass.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: I2C: Restore SCLH register properly
Add debug support
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This prepares the generic_wake_handler function to be shared by
cpu idle.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
There should really only be one declaration for globals.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Remove unnecessary include statements.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Remove now unused bits from prm335x.h
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
This allows pm_handlers to not include any am335x headers.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
This allows ldo.c to not include any am335x or am43xx
specific headers.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
AM335x: CM3: Rename prmam335x.h to prm335x.h for consistency.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
This eliminates the need for i2c.c to know the DPLL_PERIPH
address.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
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>
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>
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>
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>
These aren't SoC specific, so move them into rtc.h
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
These aren't SoC specific, so move them into i2c.c
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
CM3: Breakout IO functions into separate header.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
Reflect properly that this is just the first GPIO bank.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
Move i2c.c prototypes from system_am335.h to i2c.h.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
Move rtc.c prototypes from system_am335.h to rtc.h.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
Move sync.c prototypes from system_am335 to sync.h.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
Move prototypes specific to trace.c from system_am335.h
to trace.h.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
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>
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>
They are only used in prcm_core.c, so move them there.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Remove unused variables and macros from system_am335x.h
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
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>
CM3: Move state_data into it's own file
This reduces clutter in prcm_core.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This reduces clutter in prcm_core.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout LDO data for am335x/am43xx.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
PRCM core is getting too big to be easily readable, break out the pieces.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
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>
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>
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>
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>
This function is called to reset all the state values to their default.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout dpll data for am335x/am43xx.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
Once am43xx support is more complete, this will be supported on both platforms.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
The am43xx support is a bit of a skeleton right now.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
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>
We store state, but don't reset that state on firmware reset, fix that.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Rework dpll struct to prepare for am335x/am43xx split.
Combine the information on the different parts of the DPLLs into
one struct. This will make the am335x/am43xx split easier.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Combine the information on the different parts of the DPLLs into
one struct. This will make the am335x/am43xx split easier.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Use enumeration for DPLL index
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Use clockdomain active check in rtc_enable_check.
This utilizes the new clkdm framework, keeping the IP register
addresses and accesses isolated.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This utilizes the new clkdm framework, keeping the IP register
addresses and accesses isolated.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Add check for if a clockdomain is active.
This will be used by the RTC code to check if it's clock domain
is active.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This will be used by the RTC code to check if it's clock domain
is active.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
AM335X: CM3: Add RTC clockdomain for am335x.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout DDR functions 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>
PRCM core is getting too big to be easily readable, break out the pieces.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout dpll 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>
PRCM core is getting too big to be easily readable, break out the pieces.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout powerdomain data for am335x/am43xx.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Use powerdomain_id enumeration for PD_MPU/PD_PER
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Formalize register contents bitfields as unsigned int
This avoids any ambiguities with right shifts of the contents of registers.
Also fix the ordering rtc_reg_write to match raw_write.
GCC can also do some "interesting" optimizations with bitfields:
struct foo { int a:2; };
struct bar { unsigned int a:2; };
int test(struct foo *foo, struct bar *bar)
{
if (foo->a == 0x3)
return 1;
if (bar->a == 0x3)
return 2;
return 0;
}
Compiles to:
0: e5d10000 ldrb r0, [r1]
4: e2000003 and r0, r0, #3
8: e3500003 cmp r0, #3
c: 03a00002 moveq r0, #2
10: 13a00000 movne r0, #0
14: e12fff1e bx lr
GCC assumed that a 2 bit signed bitfield can never equal 0x3 and
compiled it out. Since none of the bitfields are intended to hold
signed values, make them unsigned.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This avoids any ambiguities with right shifts of the contents of registers.
Also fix the ordering rtc_reg_write to match raw_write.
GCC can also do some "interesting" optimizations with bitfields:
struct foo { int a:2; };
struct bar { unsigned int a:2; };
int test(struct foo *foo, struct bar *bar)
{
if (foo->a == 0x3)
return 1;
if (bar->a == 0x3)
return 2;
return 0;
}
Compiles to:
0: e5d10000 ldrb r0, [r1]
4: e2000003 and r0, r0, #3
8: e3500003 cmp r0, #3
c: 03a00002 moveq r0, #2
10: 13a00000 movne r0, #0
14: e12fff1e bx lr
GCC assumed that a 2 bit signed bitfield can never equal 0x3 and
compiled it out. Since none of the bitfields are intended to hold
signed values, make them unsigned.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout powerdomains 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>
PRCM core is getting too big to be easily readable, break out the pieces.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Create consistent naming s/module/hwmod
In kernel speak, the SoC modules are know as hwmods. Use this name
throughout as it is much less generic than module.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
In kernel speak, the SoC modules are know as hwmods. Use this name
throughout as it is much less generic than module.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout hwmod data for am335x/am43xx.
This splits out the am335x and am43xx specific code from the
hwmod core.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This splits out the am335x and am43xx specific code from the
hwmod core.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout hwmod 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>
PRCM core is getting too big to be easily readable, break out the pieces.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout clockdomain data for am335x/am43xx.
This splits out the am335x and am43xx specific code from the
clockdomain core.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This splits out the am335x and am43xx specific code from the
clockdomain core.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Breakout clockdomains 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>
PRCM core is getting too big to be easily readable, break out the pieces.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Move var_mod to device_am335x.h
This is the first step in breaking up prcm_core.c
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This is the first step in breaking up prcm_core.c
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Enable/disable clkdms by ID.
This simplifies the am335x/am43xx split.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This simplifies the am335x/am43xx split.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Enable/disable hwmods by ID.
This simplifies the am335x/am43xx split.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This simplifies the am335x/am43xx split.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Track CLKCTRL by hwmod to abstract am43xx/am33xx
This moves towards abstracting out the differences between am335x
and am43xx. The caller can specify a 'HWMOD_I2C0' instead of the
register address.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This moves towards abstracting out the differences between am335x
and am43xx. The caller can specify a 'HWMOD_I2C0' instead of the
register address.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Reorganize PWRSTST and PWRSTCTRL registers under structs for am335x/am43xx
This works towards allowing the am335x and am43xx specific portions to be
contained in separate files.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
This works towards allowing the am335x and am43xx specific portions to be
contained in separate files.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Add clkdms_state_change to make a am335x/am43xx split easier.
Rather than open coding the enabling and disabling of a list of
registers, have a loop do it. In the future, the register lists
can be assigned based on SoC type.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Rather than open coding the enabling and disabling of a list of
registers, have a loop do it. In the future, the register lists
can be assigned based on SoC type.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
CM3: Add modules_state_change to make a am335x/am43xx split easier.
Rather than open coding the enabling and disabling of a list of
registers, have a loop do it. In the future, the register lists
can be assigned based on SoC type.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Rather than open coding the enabling and disabling of a list of
registers, have a loop do it. In the future, the register lists
can be assigned based on SoC type.
Signed-off-by: Russ Dill <Russ.Dill@ti.com>