Skip to content

Commit

Permalink
Merge tag 'davinci-for-v5.6/soc' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/nsekhar/linux-davinci into arm/late

DaVinci SoC updates for v5.6 include migrating DM365 SoC to use
drivers/clocksource based driver for timer. This leads to removal
of machine specific timer driver.

There are two patches adding missing fixed regulators for audio codecs
on DM365 and DM644x EVMs.

* tag 'davinci-for-v5.6/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: dm644x-evm: Add Fixed regulators needed for tlv320aic33
  ARM: davinci: dm365-evm: Add Fixed regulators needed for tlv320aic3101
  ARM: davinci: remove legacy timer support
  ARM: davinci: dm365: switch to using the clocksource driver
  clocksource: davinci: only enable clockevents once tim34 is initialized

Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Olof Johansson <[email protected]>
  • Loading branch information
olofj committed Jan 27, 2020
2 parents 19d52e9 + 5e06d19 commit a832eb2
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 483 deletions.
3 changes: 1 addition & 2 deletions arch/arm/mach-davinci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include

# Common objects
obj-y := time.o serial.o usb.o \
common.o sram.o
obj-y := serial.o usb.o common.o sram.o

obj-$(CONFIG_DAVINCI_MUX) += mux.o

Expand Down
20 changes: 20 additions & 0 deletions arch/arm/mach-davinci/board-dm365-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <linux/spi/eeprom.h>
#include <linux/v4l2-dv-timings.h>
#include <linux/platform_data/ti-aemif.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -245,6 +247,19 @@ static struct davinci_i2c_platform_data i2c_pdata = {
.bus_delay = 0 /* usec */,
};

/* Fixed regulator support */
static struct regulator_consumer_supply fixed_supplies_3_3v[] = {
/* Baseboard 3.3V: 5V -> TPS767D301 -> 3.3V */
REGULATOR_SUPPLY("AVDD", "1-0018"),
REGULATOR_SUPPLY("DRVDD", "1-0018"),
REGULATOR_SUPPLY("IOVDD", "1-0018"),
};

static struct regulator_consumer_supply fixed_supplies_1_8v[] = {
/* Baseboard 1.8V: 5V -> TPS767D301 -> 1.8V */
REGULATOR_SUPPLY("DVDD", "1-0018"),
};

static int dm365evm_keyscan_enable(struct device *dev)
{
return davinci_cfg_reg(DM365_KEYSCAN);
Expand Down Expand Up @@ -800,6 +815,11 @@ static __init void dm365_evm_init(void)
if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);

regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v,
ARRAY_SIZE(fixed_supplies_1_8v), 1800000);
regulator_register_always_on(1, "fixed-dummy", fixed_supplies_3_3v,
ARRAY_SIZE(fixed_supplies_3_3v), 3300000);

nvmem_add_cell_table(&davinci_nvmem_cell_table);
nvmem_add_cell_lookups(&davinci_nvmem_cell_lookup, 1);

Expand Down
20 changes: 20 additions & 0 deletions arch/arm/mach-davinci/board-dm644x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <linux/v4l2-dv-timings.h>
#include <linux/export.h>
#include <linux/leds.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>

#include <media/i2c/tvp514x.h>

Expand Down Expand Up @@ -653,6 +655,19 @@ static struct i2c_board_info __initdata i2c_info[] = {
},
};

/* Fixed regulator support */
static struct regulator_consumer_supply fixed_supplies_3_3v[] = {
/* Baseboard 3.3V: 5V -> TPS54310PWP -> 3.3V */
REGULATOR_SUPPLY("AVDD", "1-001b"),
REGULATOR_SUPPLY("DRVDD", "1-001b"),
};

static struct regulator_consumer_supply fixed_supplies_1_8v[] = {
/* Baseboard 1.8V: 5V -> TPS54310PWP -> 1.8V */
REGULATOR_SUPPLY("IOVDD", "1-001b"),
REGULATOR_SUPPLY("DVDD", "1-001b"),
};

#define DM644X_I2C_SDA_PIN GPIO_TO_PIN(2, 12)
#define DM644X_I2C_SCL_PIN GPIO_TO_PIN(2, 11)

Expand Down Expand Up @@ -831,6 +846,11 @@ static __init void davinci_evm_init(void)

dm644x_register_clocks();

regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v,
ARRAY_SIZE(fixed_supplies_1_8v), 1800000);
regulator_register_always_on(1, "fixed-dummy", fixed_supplies_3_3v,
ARRAY_SIZE(fixed_supplies_3_3v), 3300000);

dm644x_init_devices();

ret = dm644x_gpio_register();
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/devices-da8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <mach/common.h>
#include <mach/cputype.h>
#include <mach/da8xx.h>
#include <mach/time.h>

#include "asp.h"
#include "cpuidle.h"
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/mach-davinci/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <mach/hardware.h>
#include <mach/cputype.h>
#include <mach/mux.h>
#include <mach/time.h>

#include "davinci.h"
#include "irqs.h"
Expand Down Expand Up @@ -303,21 +302,3 @@ int davinci_gpio_register(struct resource *res, int size, void *pdata)
davinci_gpio_device.dev.platform_data = pdata;
return platform_device_register(&davinci_gpio_device);
}

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

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

struct davinci_timer_instance davinci_timer_instance[2] = {
{
.base = DAVINCI_TIMER0_BASE,
.bottom_irq = DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12),
.top_irq = DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34),
},
{
.base = DAVINCI_TIMER1_BASE,
.bottom_irq = DAVINCI_INTC_IRQ(IRQ_TINT1_TINT12),
.top_irq = DAVINCI_INTC_IRQ(IRQ_TINT1_TINT34),
},
};

22 changes: 15 additions & 7 deletions arch/arm/mach-davinci/dm365.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#include <mach/cputype.h>
#include <mach/mux.h>
#include <mach/serial.h>
#include <mach/time.h>

#include <clocksource/timer-davinci.h>

#include "asp.h"
#include "davinci.h"
Expand Down Expand Up @@ -660,10 +661,16 @@ static struct davinci_id dm365_ids[] = {
},
};

static struct davinci_timer_info dm365_timer_info = {
.timers = davinci_timer_instance,
.clockevent_id = T0_BOT,
.clocksource_id = T0_TOP,
/*
* Bottom half of timer0 is used for clockevent, top half is used for
* clocksource.
*/
static const struct davinci_timer_cfg dm365_timer_cfg = {
.reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_128),
.irq = {
DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
},
};

#define DM365_UART1_BASE (IO_PHYS + 0x106000)
Expand Down Expand Up @@ -723,7 +730,6 @@ static const struct davinci_soc_info davinci_soc_info_dm365 = {
.pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
.pinmux_pins = dm365_pins,
.pinmux_pins_num = ARRAY_SIZE(dm365_pins),
.timer_info = &dm365_timer_info,
.emac_pdata = &dm365_emac_pdata,
.sram_dma = 0x00010000,
.sram_len = SZ_32K,
Expand Down Expand Up @@ -771,6 +777,7 @@ void __init dm365_init_time(void)
{
void __iomem *pll1, *pll2, *psc;
struct clk *clk;
int rv;

clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM365_REF_FREQ);

Expand All @@ -789,7 +796,8 @@ void __init dm365_init_time(void)
return;
}

davinci_timer_init(clk);
rv = davinci_timer_register(clk, &dm365_timer_cfg);
WARN(rv, "Unable to register the timer: %d\n", rv);
}

void __init dm365_register_clocks(void)
Expand Down
17 changes: 0 additions & 17 deletions arch/arm/mach-davinci/include/mach/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@
#define DAVINCI_INTC_START NR_IRQS
#define DAVINCI_INTC_IRQ(_irqnum) (DAVINCI_INTC_START + (_irqnum))

void davinci_timer_init(struct clk *clk);

struct davinci_timer_instance {
u32 base;
u32 bottom_irq;
u32 top_irq;
unsigned long cmp_off;
unsigned int cmp_irq;
};

struct davinci_timer_info {
struct davinci_timer_instance *timers;
unsigned int clockevent_id;
unsigned int clocksource_id;
};

struct davinci_gpio_controller;

/*
Expand All @@ -58,7 +42,6 @@ struct davinci_soc_info {
u32 pinmux_base;
const struct mux_config *pinmux_pins;
unsigned long pinmux_pins_num;
struct davinci_timer_info *timer_info;
int gpio_type;
u32 gpio_base;
unsigned gpio_num;
Expand Down
33 changes: 0 additions & 33 deletions arch/arm/mach-davinci/include/mach/time.h

This file was deleted.

Loading

0 comments on commit a832eb2

Please sign in to comment.