Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 018b7324 authored by Tony Lindgren's avatar Tony Lindgren
Browse files

Merge branch 'omap-for-v4.13/legacy-v2' into omap-for-v4.13/soc-v3

parents c76e4d2e 0e78b121
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -69,7 +69,6 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o


# OPP table initialization
# OPP table initialization
ifeq ($(CONFIG_PM_OPP),y)
ifeq ($(CONFIG_PM_OPP),y)
obj-y					+= opp.o
obj-$(CONFIG_ARCH_OMAP3)		+= opp3xxx_data.o
obj-$(CONFIG_ARCH_OMAP3)		+= opp3xxx_data.o
obj-$(CONFIG_ARCH_OMAP4)		+= opp4xxx_data.o
obj-$(CONFIG_ARCH_OMAP4)		+= opp4xxx_data.o
endif
endif
@@ -220,9 +219,6 @@ obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o
obj-$(CONFIG_SOC_OMAP5)			+= omap_hwmod_54xx_data.o
obj-$(CONFIG_SOC_OMAP5)			+= omap_hwmod_54xx_data.o
obj-$(CONFIG_SOC_DRA7XX)		+= omap_hwmod_7xx_data.o
obj-$(CONFIG_SOC_DRA7XX)		+= omap_hwmod_7xx_data.o


# EMU peripherals
obj-$(CONFIG_HW_PERF_EVENTS)		+= pmu.o

# OMAP2420 MSDI controller integration support ("MMC")
# OMAP2420 MSDI controller integration support ("MMC")
obj-$(CONFIG_SOC_OMAP2420)		+= msdi.o
obj-$(CONFIG_SOC_OMAP2420)		+= msdi.o


+6 −8
Original line number Original line Diff line number Diff line
@@ -53,14 +53,12 @@ static u32 board_caps;


static void board_check_revision(void)
static void board_check_revision(void)
{
{
	if (of_have_populated_dt()) {
	if (of_machine_is_compatible("nokia,n800"))
	if (of_machine_is_compatible("nokia,n800"))
		board_caps = NOKIA_N800;
		board_caps = NOKIA_N800;
	else if (of_machine_is_compatible("nokia,n810"))
	else if (of_machine_is_compatible("nokia,n810"))
		board_caps = NOKIA_N810;
		board_caps = NOKIA_N810;
	else if (of_machine_is_compatible("nokia,n810-wimax"))
	else if (of_machine_is_compatible("nokia,n810-wimax"))
		board_caps = NOKIA_N810_WIMAX;
		board_caps = NOKIA_N810_WIMAX;
	}


	if (!board_caps)
	if (!board_caps)
		pr_err("Unknown board\n");
		pr_err("Unknown board\n");
+0 −175
Original line number Original line Diff line number Diff line
@@ -36,130 +36,6 @@
#define L3_MODULES_MAX_LEN 12
#define L3_MODULES_MAX_LEN 12
#define L3_MODULES 3
#define L3_MODULES 3


static int __init omap3_l3_init(void)
{
	struct omap_hwmod *oh;
	struct platform_device *pdev;
	char oh_name[L3_MODULES_MAX_LEN];

	/*
	 * To avoid code running on other OMAPs in
	 * multi-omap builds
	 */
	if (!(cpu_is_omap34xx()) || of_have_populated_dt())
		return -ENODEV;

	snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");

	oh = omap_hwmod_lookup(oh_name);

	if (!oh)
		pr_err("could not look up %s\n", oh_name);

	pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0);

	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);

	return PTR_ERR_OR_ZERO(pdev);
}
omap_postcore_initcall(omap3_l3_init);

static inline void omap_init_sti(void) {}

#if IS_ENABLED(CONFIG_SPI_OMAP24XX)

#include <linux/platform_data/spi-omap2-mcspi.h>

static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
{
	struct platform_device *pdev;
	char *name = "omap2_mcspi";
	struct omap2_mcspi_platform_config *pdata;
	static int spi_num;
	struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr;

	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
	if (!pdata) {
		pr_err("Memory allocation for McSPI device failed\n");
		return -ENOMEM;
	}

	pdata->num_cs = mcspi_attrib->num_chipselect;
	switch (oh->class->rev) {
	case OMAP2_MCSPI_REV:
	case OMAP3_MCSPI_REV:
			pdata->regs_offset = 0;
			break;
	case OMAP4_MCSPI_REV:
			pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET;
			break;
	default:
			pr_err("Invalid McSPI Revision value\n");
			kfree(pdata);
			return -EINVAL;
	}

	spi_num++;
	pdev = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata));
	WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
				name, oh->name);
	kfree(pdata);
	return 0;
}

static void omap_init_mcspi(void)
{
	omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL);
}

#else
static inline void omap_init_mcspi(void) {}
#endif

/**
 * omap_init_rng - bind the RNG hwmod to the RNG omap_device
 *
 * Bind the RNG hwmod to the RNG omap_device.  No return value.
 */
static void __init omap_init_rng(void)
{
	struct omap_hwmod *oh;
	struct platform_device *pdev;

	oh = omap_hwmod_lookup("rng");
	if (!oh)
		return;

	pdev = omap_device_build("omap_rng", -1, oh, NULL, 0);
	WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
}

static void __init omap_init_sham(void)
{
	struct omap_hwmod *oh;
	struct platform_device *pdev;

	oh = omap_hwmod_lookup("sham");
	if (!oh)
		return;

	pdev = omap_device_build("omap-sham", -1, oh, NULL, 0);
	WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n");
}

static void __init omap_init_aes(void)
{
	struct omap_hwmod *oh;
	struct platform_device *pdev;

	oh = omap_hwmod_lookup("aes");
	if (!oh)
		return;

	pdev = omap_device_build("omap-aes", -1, oh, NULL, 0);
	WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n");
}

/*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------*/


#if IS_ENABLED(CONFIG_VIDEO_OMAP2_VOUT)
#if IS_ENABLED(CONFIG_VIDEO_OMAP2_VOUT)
@@ -185,54 +61,3 @@ int __init omap_init_vout(void)
#else
#else
int __init omap_init_vout(void) { return 0; }
int __init omap_init_vout(void) { return 0; }
#endif
#endif

/*-------------------------------------------------------------------------*/

static int __init omap2_init_devices(void)
{
	/* Enable dummy states for those platforms without pinctrl support */
	if (!of_have_populated_dt())
		pinctrl_provide_dummies();

	/* If dtb is there, the devices will be created dynamically */
	if (!of_have_populated_dt()) {
		/*
		 * please keep these calls, and their implementations above,
		 * in alphabetical order so they're easier to sort through.
		 */
		omap_init_mcspi();
		omap_init_sham();
		omap_init_aes();
		omap_init_rng();
	}
	omap_init_sti();

	return 0;
}
omap_arch_initcall(omap2_init_devices);

static int __init omap_gpmc_init(void)
{
	struct omap_hwmod *oh;
	struct platform_device *pdev;
	char *oh_name = "gpmc";

	/*
	 * if the board boots up with a populated DT, do not
	 * manually add the device from this initcall
	 */
	if (of_have_populated_dt())
		return -ENODEV;

	oh = omap_hwmod_lookup(oh_name);
	if (!oh) {
		pr_err("Could not look up %s\n", oh_name);
		return -ENODEV;
	}

	pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0);
	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);

	return PTR_ERR_OR_ZERO(pdev);
}
omap_postcore_initcall(omap_gpmc_init);
+14 −45
Original line number Original line Diff line number Diff line
@@ -493,66 +493,38 @@ void __init omap3_init_early(void)
	omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000));
	omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000));
	omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
	omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
			       OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE));
			       OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE));
	/* XXX: remove these once OMAP3 is DT only */
	if (!of_have_populated_dt()) {
		omap2_set_globals_control(
			OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE));
		omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE));
		omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
				     NULL);
	}
	omap2_control_base_init();
	omap2_control_base_init();
	omap3xxx_check_revision();
	omap3xxx_check_revision();
	omap3xxx_check_features();
	omap3xxx_check_features();
	omap2_prcm_base_init();
	omap2_prcm_base_init();
	/* XXX: remove these once OMAP3 is DT only */
	if (!of_have_populated_dt()) {
		omap3xxx_prm_init(NULL);
		omap3xxx_cm_init(NULL);
	}
	omap3xxx_voltagedomains_init();
	omap3xxx_voltagedomains_init();
	omap3xxx_powerdomains_init();
	omap3xxx_powerdomains_init();
	omap3xxx_clockdomains_init();
	omap3xxx_clockdomains_init();
	omap3xxx_hwmod_init();
	omap3xxx_hwmod_init();
	omap_hwmod_init_postsetup();
	omap_hwmod_init_postsetup();
	if (!of_have_populated_dt()) {
		omap3_control_legacy_iomap_init();
		if (soc_is_am35xx())
			omap_clk_soc_init = am35xx_clk_legacy_init;
		else if (cpu_is_omap3630())
			omap_clk_soc_init = omap36xx_clk_legacy_init;
		else if (omap_rev() == OMAP3430_REV_ES1_0)
			omap_clk_soc_init = omap3430es1_clk_legacy_init;
		else
			omap_clk_soc_init = omap3430_clk_legacy_init;
	}
}
}


void __init omap3430_init_early(void)
void __init omap3430_init_early(void)
{
{
	omap3_init_early();
	omap3_init_early();
	if (of_have_populated_dt())
	omap_clk_soc_init = omap3430_dt_clk_init;
	omap_clk_soc_init = omap3430_dt_clk_init;
}
}


void __init omap35xx_init_early(void)
void __init omap35xx_init_early(void)
{
{
	omap3_init_early();
	omap3_init_early();
	if (of_have_populated_dt())
	omap_clk_soc_init = omap3430_dt_clk_init;
	omap_clk_soc_init = omap3430_dt_clk_init;
}
}


void __init omap3630_init_early(void)
void __init omap3630_init_early(void)
{
{
	omap3_init_early();
	omap3_init_early();
	if (of_have_populated_dt())
	omap_clk_soc_init = omap3630_dt_clk_init;
	omap_clk_soc_init = omap3630_dt_clk_init;
}
}


void __init am35xx_init_early(void)
void __init am35xx_init_early(void)
{
{
	omap3_init_early();
	omap3_init_early();
	if (of_have_populated_dt())
	omap_clk_soc_init = am35xx_dt_clk_init;
	omap_clk_soc_init = am35xx_dt_clk_init;
}
}


@@ -628,7 +600,6 @@ void __init ti816x_init_early(void)
	ti816x_clockdomains_init();
	ti816x_clockdomains_init();
	dm816x_hwmod_init();
	dm816x_hwmod_init();
	omap_hwmod_init_postsetup();
	omap_hwmod_init_postsetup();
	if (of_have_populated_dt())
	omap_clk_soc_init = dm816x_dt_clk_init;
	omap_clk_soc_init = dm816x_dt_clk_init;
}
}
#endif
#endif
@@ -785,7 +756,6 @@ int __init omap_clk_init(void)


	omap2_clk_setup_ll_ops();
	omap2_clk_setup_ll_ops();


	if (of_have_populated_dt()) {
	ret = omap_control_init();
	ret = omap_control_init();
	if (ret)
	if (ret)
		return ret;
		return ret;
@@ -799,7 +769,6 @@ int __init omap_clk_init(void)
	ti_dt_clk_init_retry_clks();
	ti_dt_clk_init_retry_clks();


	ti_dt_clockdomains_setup();
	ti_dt_clockdomains_setup();
	}


	ret = omap_clk_soc_init();
	ret = omap_clk_soc_init();


+0 −70
Original line number Original line Diff line number Diff line
@@ -53,73 +53,3 @@ void __init omap3_mcbsp_init_pdata_callback(


	pdata->force_ick_on = omap3_mcbsp_force_ick_on;
	pdata->force_ick_on = omap3_mcbsp_force_ick_on;
}
}

static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
{
	int id, count = 1;
	char *name = "omap-mcbsp";
	struct omap_hwmod *oh_device[2];
	struct omap_mcbsp_platform_data *pdata = NULL;
	struct platform_device *pdev;

	sscanf(oh->name, "mcbsp%d", &id);

	pdata = kzalloc(sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL);
	if (!pdata) {
		pr_err("%s: No memory for mcbsp\n", __func__);
		return -ENOMEM;
	}

	pdata->reg_step = 4;
	if (oh->class->rev < MCBSP_CONFIG_TYPE2) {
		pdata->reg_size = 2;
	} else {
		pdata->reg_size = 4;
		pdata->has_ccr = true;
	}

	if (oh->class->rev == MCBSP_CONFIG_TYPE2) {
		/* The FIFO has 128 locations */
		pdata->buffer_size = 0x80;
	} else if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
		if (id == 2)
			/* The FIFO has 1024 + 256 locations */
			pdata->buffer_size = 0x500;
		else
			/* The FIFO has 128 locations */
			pdata->buffer_size = 0x80;
	} else if (oh->class->rev == MCBSP_CONFIG_TYPE4) {
		/* The FIFO has 128 locations for all instances */
		pdata->buffer_size = 0x80;
	}

	if (oh->class->rev >= MCBSP_CONFIG_TYPE3)
		pdata->has_wakeup = true;

	oh_device[0] = oh;

	if (oh->dev_attr) {
		oh_device[1] = omap_hwmod_lookup((
		(struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone);
		pdata->force_ick_on = omap3_mcbsp_force_ick_on;
		count++;
	}
	pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
				    sizeof(*pdata));
	kfree(pdata);
	if (IS_ERR(pdev))  {
		pr_err("%s: Can't build omap_device for %s:%s.\n", __func__,
					name, oh->name);
		return PTR_ERR(pdev);
	}
	return 0;
}

static int __init omap2_mcbsp_init(void)
{
	if (!of_have_populated_dt())
		omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL);

	return 0;
}
omap_arch_initcall(omap2_mcbsp_init);
Loading