aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Bedarkar <rahul.bedarkar@imgtec.com>2016-02-02 09:42:58 +0530
committerRahul Bedarkar <rahul.bedarkar@imgtec.com>2016-02-02 09:42:58 +0530
commit624d06c951529c2447140d01e66ef5ccde3fb9b4 (patch)
tree80451a0b4a910602a3524806e016245e2170a978
parent8769605e1396d781c24e91c4b5b6966b360c2017 (diff)
parent8f7b3c6260bbea6dfb0d353eeeaad2b29919a4be (diff)
downloadv4.1-624d06c951529c2447140d01e66ef5ccde3fb9b4.tar.gz
Merge remote-tracking branch 'imgsystems/4.1-imgworks' into 'imgsystems/4.1-imgsystems'
Change-Id: Ia851821dfa0137217ac48f8852d484bcefd8b4fc Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
-rw-r--r--arch/mips/pistachio/init.c25
-rw-r--r--drivers/clk/pistachio/clk-pistachio.c3
-rw-r--r--drivers/misc/atu/atu_clk_maintainer.c1
-rw-r--r--drivers/soc/img/connectivity/img-hostport.c11
-rw-r--r--drivers/spi/spi-img-spfi.c3
-rw-r--r--include/dt-bindings/clock/pistachio-clk.h1
-rw-r--r--sound/soc/img/pistachio.c17
7 files changed, 45 insertions, 16 deletions
diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
index 40cea1207fe..b9e0442f7bb 100644
--- a/arch/mips/pistachio/init.c
+++ b/arch/mips/pistachio/init.c
@@ -2,6 +2,7 @@
* Pistachio platform setup
*
* Copyright (C) 2014 Google, Inc.
+ * Copyright (C) 2016 Imagination Technologies
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -9,6 +10,7 @@
*/
#include <linux/init.h>
+#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
@@ -25,9 +27,28 @@
#include <asm/smp-ops.h>
#include <asm/traps.h>
+/*
+ * Core revision register decoding
+ * Bits 23 to 20: Major rev
+ * Bits 15 to 8: Minor rev
+ * Bits 7 to 0: Maintenance rev
+ */
+#define PISTACHIO_CORE_REV_REG 0xB81483D0
+#define PISTACHIO_CORE_REV_A1 0x00100006
+#define PISTACHIO_CORE_REV_B0 0x00100106
+
const char *get_system_type(void)
{
- return "IMG Pistachio SoC";
+ u32 core_rev;
+
+ core_rev = __raw_readl((const void *)PISTACHIO_CORE_REV_REG);
+
+ if (core_rev == PISTACHIO_CORE_REV_B0)
+ return "IMG Pistachio SoC (B0)";
+ else if (core_rev == PISTACHIO_CORE_REV_A1)
+ return "IMG_Pistachio SoC (A1)";
+ else
+ return "IMG_Pistachio SoC";
}
static void __init plat_setup_iocoherency(void)
@@ -105,6 +126,8 @@ void __init prom_init(void)
mips_cm_probe();
mips_cpc_probe();
register_cps_smp_ops();
+
+ pr_info("SoC Type: %s\n", get_system_type());
}
void __init prom_free_prom_memory(void)
diff --git a/drivers/clk/pistachio/clk-pistachio.c b/drivers/clk/pistachio/clk-pistachio.c
index fd64bd93625..7271c4eba75 100644
--- a/drivers/clk/pistachio/clk-pistachio.c
+++ b/drivers/clk/pistachio/clk-pistachio.c
@@ -44,7 +44,7 @@ static struct pistachio_gate pistachio_gates[] __initdata = {
GATE(CLK_AUX_ADC_INTERNAL, "aux_adc_internal", "sys_internal_div",
0x104, 22),
GATE(CLK_AUX_ADC, "aux_adc", "aux_adc_div", 0x104, 23),
- GATE(CLK_SD_HOST, "sd_host", "sd_host_div", 0x104, 24),
+ GATE(CLK_SD_HOST, "sd_host", "sd_host_div4", 0x104, 24),
GATE(CLK_BT, "bt", "bt_div", 0x104, 25),
GATE(CLK_BT_DIV4, "bt_div4", "bt_div4_div", 0x104, 26),
GATE(CLK_BT_DIV8, "bt_div8", "bt_div8_div", 0x104, 27),
@@ -54,6 +54,7 @@ static struct pistachio_gate pistachio_gates[] __initdata = {
static struct pistachio_fixed_factor pistachio_ffs[] __initdata = {
FIXED_FACTOR(CLK_WIFI_DIV4, "wifi_div4", "wifi_pll", 4),
FIXED_FACTOR(CLK_WIFI_DIV8, "wifi_div8", "wifi_pll", 8),
+ FIXED_FACTOR(CLK_SDHOST_DIV4, "sd_host_div4", "sd_host_div", 4),
};
static struct pistachio_div pistachio_divs[] __initdata = {
diff --git a/drivers/misc/atu/atu_clk_maintainer.c b/drivers/misc/atu/atu_clk_maintainer.c
index e7c61322abe..a957e3a0210 100644
--- a/drivers/misc/atu/atu_clk_maintainer.c
+++ b/drivers/misc/atu/atu_clk_maintainer.c
@@ -639,7 +639,6 @@ static int atu_adjtimex(struct timex *txc)
int dir;
freq = txc->freq;
- freq = (freq * NSEC_PER_USEC) >> 16;
if (freq < 0) {
dir = -1;
diff --git a/drivers/soc/img/connectivity/img-hostport.c b/drivers/soc/img/connectivity/img-hostport.c
index ee2b8ba8243..0c8c496884e 100644
--- a/drivers/soc/img/connectivity/img-hostport.c
+++ b/drivers/soc/img/connectivity/img-hostport.c
@@ -179,7 +179,7 @@ static u8 id_to_field(int id)
static void notify_common(u16 user_data, int user_id, gen_handler poke_ready,
void *poke_ready_arg)
{
- dbgn("snd -- %d:%d:%02X", user_id, user_id, user_data);
+ trace_printk("img-hostport: snd -- %d:%d:%02X\n", user_id, user_id, user_data);
if (poke_ready)
poke_ready(poke_ready_arg);
iowrite32(0x87 << 24 | user_data << 8 | id_to_field(user_id),
@@ -201,27 +201,28 @@ static irqreturn_t hal_irq_handler(int irq, void *p)
/* TODO: need to change that to support platforms other that 32 bit */
first_bit = (reg_value & (1 << 31)) >> 31;
if (0 == first_bit) {
- err("unexpected spurious interrupt detected!\n");
+ trace_printk("img-hostport: unexpected spurious interrupt detected (0x%08X)!\n",
+ reg_value);
goto exit;
}
callee_id = CALLEE(reg_value);
caller_id = CALLER(reg_value);
user_message = USERMSG(reg_value);
- dbgn("rcv -- %d:%d:%02X", callee_id, caller_id, user_message);
+ trace_printk("img-hostport: rcv -%c %d:%d:%02X\n", first_bit ? '-' : '*', callee_id, caller_id, user_message);
/*
* callee_id is tainted, therefore must be checked.
*/
if (callee_id > MAX_ENDPOINT_ID) {
- errn("endpoint with id = %u doesn't exist", callee_id);
+ trace_printk("img-hostport: endpoint with id = %u doesn't exist\n", callee_id);
goto deassert;
}
handler = module->endpoints.f[callee_id];
handler_in_use = module->endpoints.in_use + callee_id;
if (NULL == handler) {
- errn("endpoint with id = %u not registered", callee_id);
+ trace_printk("img-hostport: endpoint with id = %u not registered\n", callee_id);
goto deassert;
}
spin_lock_irqsave(handler_in_use, flags);
diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index c31195892ed..b16ba2c056b 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -437,6 +437,9 @@ static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg)
u32 val;
val = spfi_readl(spfi, SPFI_PORT_STATE);
+ val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK <<
+ SPFI_PORT_STATE_DEV_SEL_SHIFT);
+ val |= msg->spi->chip_select << SPFI_PORT_STATE_DEV_SEL_SHIFT;
if (msg->spi->mode & SPI_CPHA)
val |= SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select);
else
diff --git a/include/dt-bindings/clock/pistachio-clk.h b/include/dt-bindings/clock/pistachio-clk.h
index dfda0c330d2..bfb915dfe92 100644
--- a/include/dt-bindings/clock/pistachio-clk.h
+++ b/include/dt-bindings/clock/pistachio-clk.h
@@ -21,6 +21,7 @@
/* Fixed-factor clocks */
#define CLK_WIFI_DIV4 16
#define CLK_WIFI_DIV8 17
+#define CLK_SDHOST_DIV4 18
/* Gate clocks */
#define CLK_MIPS 32
diff --git a/sound/soc/img/pistachio.c b/sound/soc/img/pistachio.c
index 1a8a6d70028..e4b6546f450 100644
--- a/sound/soc/img/pistachio.c
+++ b/sound/soc/img/pistachio.c
@@ -30,10 +30,10 @@
#include "pistachio-event-timer.h"
-#define PLL_RATE_8000_16000_32000_48000_96000_192000 147456000
-#define PLL_RATE_11025_22050_44100_64000_88200_176400 135475200
-#define PISTACHIO_MAX_DIV 256
-#define PISTACHIO_MIN_MCLK_FREQ (135475200 / 256)
+#define PISTACHIO_PLL_RATE_A 147456000
+#define PISTACHIO_PLL_RATE_B 135475200
+#define PISTACHIO_MAX_DIV 256
+#define PISTACHIO_MIN_MCLK_FREQ (135475200 / 256)
#define PISTACHIO_CLOCK_MASTER_EXT -1
#define PISTACHIO_CLOCK_MASTER_LOOPBACK -2
@@ -398,16 +398,16 @@ static inline int pistachio_card_get_pll_rate(unsigned int rate)
case 16000:
case 32000:
case 48000:
+ case 64000:
case 96000:
case 192000:
- return PLL_RATE_8000_16000_32000_48000_96000_192000;
+ return PISTACHIO_PLL_RATE_A;
case 11025:
case 22050:
case 44100:
- case 64000:
case 88200:
case 176400:
- return PLL_RATE_11025_22050_44100_64000_88200_176400;
+ return PISTACHIO_PLL_RATE_B;
default:
return -EINVAL;
}
@@ -455,6 +455,7 @@ static int pistachio_card_change_rate(struct pistachio_card *pbc,
int ret;
mutex_lock(&pbc->rate_mutex);
+ *active_rate = 0;
ret = _pistachio_card_change_rate(pbc, rate, i2s);
if (!ret)
*active_rate = rate;
@@ -1543,7 +1544,7 @@ static int pistachio_card_init_rates(struct pistachio_card *pbc)
unsigned int rate;
int ret;
- rate = PLL_RATE_11025_22050_44100_64000_88200_176400;
+ rate = PISTACHIO_PLL_RATE_B;
ret = clk_set_rate(pbc->audio_pll, rate);
if (ret)
return ret;