2009-12-03 13:16:33 +00:00
|
|
|
|
/*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <common.h>
|
2011-07-27 10:35:44 +00:00
|
|
|
|
#include <sizes.h>
|
2010-12-03 11:56:09 +00:00
|
|
|
|
#include <init.h>
|
2011-09-22 17:02:57 +00:00
|
|
|
|
#include <io.h>
|
2012-09-23 20:04:10 +00:00
|
|
|
|
#include <mach/weim.h>
|
2012-10-11 07:09:29 +00:00
|
|
|
|
#include <mach/imx35-regs.h>
|
2010-08-16 14:10:33 +00:00
|
|
|
|
#include <mach/iim.h>
|
2012-09-30 16:14:08 +00:00
|
|
|
|
#include <mach/revision.h>
|
2010-05-14 02:15:17 +00:00
|
|
|
|
#include <mach/generic.h>
|
2009-12-03 13:16:33 +00:00
|
|
|
|
|
2012-09-23 20:04:10 +00:00
|
|
|
|
void imx35_setup_weimcs(size_t cs, unsigned upper, unsigned lower,
|
|
|
|
|
unsigned additional)
|
|
|
|
|
{
|
|
|
|
|
writel(upper, MX35_WEIM_BASE_ADDR + (cs * 0x10) + 0x0);
|
|
|
|
|
writel(lower, MX35_WEIM_BASE_ADDR + (cs * 0x10) + 0x4);
|
|
|
|
|
writel(additional, MX35_WEIM_BASE_ADDR + (cs * 0x10) + 0x8);
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-30 16:14:08 +00:00
|
|
|
|
static void imx35_silicon_revision(void)
|
2010-05-14 02:15:17 +00:00
|
|
|
|
{
|
|
|
|
|
uint32_t reg;
|
2012-09-22 13:13:57 +00:00
|
|
|
|
reg = readl(MX35_IIM_BASE_ADDR + IIM_SREV);
|
2012-04-18 20:02:44 +00:00
|
|
|
|
/* 0×00 = TO 1.0, First silicon */
|
|
|
|
|
reg += IMX_CHIP_REV_1_0;
|
2010-05-14 02:15:17 +00:00
|
|
|
|
|
2012-10-07 12:09:52 +00:00
|
|
|
|
imx_set_silicon_revision("i.MX35", reg & 0xFF);
|
2010-05-14 02:15:17 +00:00
|
|
|
|
}
|
2010-12-03 11:56:09 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* There are some i.MX35 CPUs in the wild, comming with bogus L2 cache settings.
|
|
|
|
|
* These misconfigured CPUs will run amok immediately when the L2 cache gets
|
|
|
|
|
* enabled. Workaraound is to setup the correct register setting prior enabling
|
|
|
|
|
* the L2 cache. This should not hurt already working CPUs, as they are using the
|
|
|
|
|
* same value
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define L2_MEM_VAL 0x10
|
|
|
|
|
|
2013-06-23 13:00:28 +00:00
|
|
|
|
int imx35_init(void)
|
2010-12-03 11:56:09 +00:00
|
|
|
|
{
|
2012-09-22 13:13:57 +00:00
|
|
|
|
writel(0x515, MX35_CLKCTL_BASE_ADDR + L2_MEM_VAL);
|
2010-12-03 11:56:09 +00:00
|
|
|
|
|
2012-09-30 16:14:08 +00:00
|
|
|
|
imx35_silicon_revision();
|
|
|
|
|
|
2013-03-14 17:38:44 +00:00
|
|
|
|
imx35_boot_save_loc((void *)MX35_CCM_BASE_ADDR);
|
2012-10-01 20:35:54 +00:00
|
|
|
|
|
2013-06-23 13:00:28 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int imx35_devices_init(void)
|
|
|
|
|
{
|
2012-09-22 13:13:57 +00:00
|
|
|
|
add_generic_device("imx_iim", 0, NULL, MX35_IIM_BASE_ADDR, SZ_4K,
|
2011-07-27 10:35:44 +00:00
|
|
|
|
IORESOURCE_MEM, NULL);
|
|
|
|
|
|
2012-09-30 15:44:06 +00:00
|
|
|
|
add_generic_device("imx-iomuxv3", 0, NULL, MX35_IOMUXC_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
|
2012-09-22 13:14:15 +00:00
|
|
|
|
add_generic_device("imx35-ccm", 0, NULL, MX35_CCM_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
|
2012-09-22 13:13:57 +00:00
|
|
|
|
add_generic_device("imx31-gpt", 0, NULL, MX35_GPT1_BASE_ADDR, 0x100, IORESOURCE_MEM, NULL);
|
2013-02-15 15:41:41 +00:00
|
|
|
|
add_generic_device("imx31-gpio", 0, NULL, MX35_GPIO1_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
|
|
|
|
|
add_generic_device("imx31-gpio", 1, NULL, MX35_GPIO2_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
|
|
|
|
|
add_generic_device("imx31-gpio", 2, NULL, MX35_GPIO3_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
|
2012-10-05 09:36:56 +00:00
|
|
|
|
add_generic_device("imx21-wdt", 0, NULL, MX35_WDOG_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL);
|
2012-11-27 15:47:36 +00:00
|
|
|
|
add_generic_device("imx35-esdctl", 0, NULL, MX35_ESDCTL_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
|
2012-09-03 08:18:09 +00:00
|
|
|
|
|
2011-07-27 10:35:44 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|