Add Reset Support for omap3.
Subsystems (2)
PATCH 1/1 Add Reset Support for omap3.
Inspired from reset_cpu in omap4_generic.c.
--- arch/arm/mach-omap/include/mach/omap3-silicon.h | 3 +++ arch/arm/mach-omap/omap3_generic.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-omap/include/mach/omap3-silicon.h +3 -0
@@ -132,5 +132,8 @@#define OMAP_SDRC_CS0 0x80000000#define OMAP_SDRC_CS1 0xA0000000 +/* PRM */ +#define PRM_RSTCTRL_RESET 0x04 +#endif /* __ASM_ARCH_OMAP3_H */
arch/arm/mach-omap/omap3_generic.c +3 -2
@@ -59,8 +59,9 @@*/ void __noreturn reset_cpu (unsigned long addr) { -/* FIXME: Enable WDT and cause reset */ -hang (); +writel (PRM_RSTCTRL_RESET ,PRM_REG (RSTCTRL )); + +while (1 ); }EXPORT_SYMBOL (reset_cpu);
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 Add omap_hsmmc platform data.
Add platform data to specify maximum frequency of hsmmc interface which can be restricted due to external level shifters.
--- arch/arm/mach-omap/include/mach/omap_hsmmc.h | 28 ++++++++++++++++++++++++++ drivers/mci/omap_hsmmc.c | 10 ++++++++- 2 files changed, 37 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-omap/include/mach/omap_hsmmc.h
arch/arm/mach-omap/include/mach/omap_hsmmc.h new file +28 -0
@@ -0,0 +1,28 @@ +/** +* @file +* @brief This file contains exported structure for OMAP hsmmc +* +* FileName: include/asm-arm/arch-omap/omap_hsmmc.h +* +* OMAP3 and OMAP4 has a MMC/SD controller embedded. +* This file provides the platform data structure required to +* addapt to platform specialities. +*/ +/* +* (C) Copyright 2011 +* Phytec Messtechnik GmbH, <www.phytec.de> +* Juergen Kilb <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_OMAP_HSMMC_H +#define __ASM_OMAP_HSMMC_H + +/** omapmmc platform data structure */ +struct omap_hsmmc_platform_data { +unsigned f_max;/* host interface upper limit */ +}; +#endif /* __ASM_OMAP_HSMMC_H */
drivers/mci/omap_hsmmc.c +9 -1
@@ -31,6 +31,8 @@#include <errno.h> #include <asm/io.h> +#include <mach/omap_hsmmc.h> +struct hsmmc {unsigned char res1[0x10 ];unsigned int sysconfig;/* 0x10 */
@@ -549,6 +551,7 @@ static void mmc_set_ios(struct mci_host *mci, struct device_d *dev,static int omap_mmc_probe (struct device_d *dev) {struct omap_hsmmc *hsmmc; +struct omap_hsmmc_platform_data *pdata; hsmmc =xzalloc (sizeof (*hsmmc));
@@ -564,7 +567,12 @@ static int omap_mmc_probe(struct device_d *dev) hsmmc->mci.voltages =MMC_VDD_32_33 |MMC_VDD_33_34 ; hsmmc->mci.f_min =400000 ; - hsmmc->mci.f_max =52000000 ; + + pdata = (struct omap_hsmmc_platform_data *)dev->platform_data; +if (pdata->f_max) + hsmmc->mci.f_max = pdata->f_max; +else + hsmmc->mci.f_max =52000000 ;mci_register (&hsmmc->mci);
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 Added helper function to get CS1 base address.
In reply to Juergen KilbThis helper function can be used for automatic
SDDR configuration based on register settings
made by a previously first stage bootloader
i.e. x-loader.
--- arch/arm/mach-omap/include/mach/sys_info.h | 1 + arch/arm/mach-omap/omap3_generic.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/mach-omap/include/mach/sys_info.h +1 -0
@@ -91,6 +91,7 @@u32 get_cpu_type (void );u32 get_cpu_rev (void );u32 get_sdr_cs_size (u32 offset); +u32 get_sdr_cs1_base (void );inline u32 get_sysboot_value (void );u32 get_gpmc0_base (void );u32 get_base (void );
arch/arm/mach-omap/omap3_generic.c +19 -0
@@ -178,7 +178,26 @@ u32 get_sdr_cs_size(u32 offset) size *=2 * (1024 *1024 );/* find size in MB */ return size; } +EXPORT_SYMBOL (get_sdr_cs_size); +/** +* @brief base address of chip select 1 (cs0 is defined at 0x80000000) +* +* @return return the CS1 base address. +*/ +u32 get_sdr_cs1_base (void ) +{ +u32 base; +u32 cs_cfg; + cs_cfg =readl (SDRC_REG (CS_CFG )); +/* get ram size field */ + base = (cs_cfg &0x0000000F ) <<2 ;/* get CS1STARTHIGH */ + base = base | ((cs_cfg &0x00000300 ) >>8 );/* get CS1STARTLOW */ + base = base <<25 ; + base +=0x80000000 ; +return base; +} +EXPORT_SYMBOL (get_sdr_cs1_base);/** * @brief Get the initial SYSBOOT value *
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 Corrected ns16550 access at all omap based boards.
In reply to Juergen KilbCommit c71a77ab8 (ns16550: switch to resource) has introduced generic read/write access to 16550 register and a 'shift' parameter to allign register index to physicall registers.
The correct 'shift' value was missing in all omap based boards. Corrected this to 2 which has fixed the problem.
Tested on a PCM-049 phyCORE-OMAP4 board.
--- arch/arm/boards/omap/board-beagle.c | 1 + arch/arm/boards/omap/board-omap3evm.c | 1 + arch/arm/boards/omap/board-sdp343x.c | 1 + arch/arm/boards/panda/board.c | 1 + arch/arm/boards/pcm049/board.c | 1 + 5 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/boards/omap/board-beagle.c +1 -0
@@ -237,6 +237,7 @@ void board_init(void)static struct NS16550_plat serial_plat = { .clock =48000000 ,/* 48MHz (APLL96/2) */ + .shift =2 , };/**
arch/arm/boards/omap/board-omap3evm.c +1 -0
@@ -213,6 +213,7 @@ void board_init(void)static struct NS16550_plat serial_plat = { .clock =48000000 ,/* 48MHz (APLL96/2) */ + .shift =2 , };/**
arch/arm/boards/omap/board-sdp343x.c +1 -0
@@ -605,6 +605,7 @@ static void mux_config(void)static struct NS16550_plat serial_plat = { .clock =48000000 ,/* 48MHz (APLL96/2) */ + .shift =2 , };/**
arch/arm/boards/panda/board.c +1 -0
@@ -32,6 +32,7 @@ static int board_revision;static struct NS16550_plat serial_plat = { .clock =48000000 ,/* 48MHz (APLL96/2) */ + .shift =2 , };static int panda_console_init (void )
arch/arm/boards/pcm049/board.c +1 -0
@@ -43,6 +43,7 @@static struct NS16550_plat serial_plat = { .clock =48000000 ,/* 48MHz (APLL96/2) */ + .shift =2 , };static int pcm049_console_init (void )
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi Jürgen,
Applied the first three patches to -next, the fourth to master.
Sascha
Quoted 46 lines · Juergen Kilb
Inspired from
reset_cpuinomap4_generic.c.Signed-off-by Juergen Kilb <[email protected]>--- arch/arm/mach-omap/include/mach/omap3-silicon.h | 3 +++ arch/arm/mach-omap/omap3_generic.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-)arch/arm/mach-omap/include/mach/omap3-silicon.h +3
-0@@ -132,5 +132,8 @@#define OMAP_SDRC_CS0 0x80000000#define OMAP_SDRC_CS1 0xA0000000 +/* PRM */ +#define PRM_RSTCTRL_RESET 0x04 +#endif /* __ASM_ARCH_OMAP3_H */ arch/arm/mach-omap/omap3_generic.c +3
-2@@ -59,8 +59,9 @@*/ void __noreturn reset_cpu (unsigned long addr) { -/* FIXME: Enable WDT and cause reset */ -hang (); +writel (PRM_RSTCTRL_RESET ,PRM_REG (RSTCTRL )); + +while (1 ); }EXPORT_SYMBOL (reset_cpu);Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox