aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/micropatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/micropatch.c')
-rw-r--r--arch/powerpc/sysdev/micropatch.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/arch/powerpc/sysdev/micropatch.c b/arch/powerpc/sysdev/micropatch.c
index d8d602840757..c0bb76ef7242 100644
--- a/arch/powerpc/sysdev/micropatch.c
+++ b/arch/powerpc/sysdev/micropatch.c
@@ -4,6 +4,7 @@
4 * also relocates SMC2, but this would require additional changes 4 * also relocates SMC2, but this would require additional changes
5 * to uart.c, so I am holding off on that for a moment. 5 * to uart.c, so I am holding off on that for a moment.
6 */ 6 */
7#include <linux/init.h>
7#include <linux/errno.h> 8#include <linux/errno.h>
8#include <linux/sched.h> 9#include <linux/sched.h>
9#include <linux/kernel.h> 10#include <linux/kernel.h>
@@ -16,6 +17,7 @@
16#include <asm/page.h> 17#include <asm/page.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>
18#include <asm/8xx_immap.h> 19#include <asm/8xx_immap.h>
20#include <asm/cpm.h>
19#include <asm/cpm1.h> 21#include <asm/cpm1.h>
20 22
21/* 23/*
@@ -24,7 +26,7 @@
24 26
25#ifdef CONFIG_I2C_SPI_UCODE_PATCH 27#ifdef CONFIG_I2C_SPI_UCODE_PATCH
26 28
27uint patch_2000[] = { 29static uint patch_2000[] __initdata = {
28 0x7FFFEFD9, 30 0x7FFFEFD9,
29 0x3FFD0000, 31 0x3FFD0000,
30 0x7FFB49F7, 32 0x7FFB49F7,
@@ -143,7 +145,7 @@ uint patch_2000[] = {
143 0x5F8247F8 145 0x5F8247F8
144}; 146};
145 147
146uint patch_2f00[] = { 148static uint patch_2f00[] __initdata = {
147 0x3E303430, 149 0x3E303430,
148 0x34343737, 150 0x34343737,
149 0xABF7BF9B, 151 0xABF7BF9B,
@@ -182,7 +184,7 @@ uint patch_2f00[] = {
182 184
183#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH 185#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH
184 186
185uint patch_2000[] = { 187static uint patch_2000[] __initdata = {
186 0x3fff0000, 188 0x3fff0000,
187 0x3ffd0000, 189 0x3ffd0000,
188 0x3ffb0000, 190 0x3ffb0000,
@@ -505,7 +507,7 @@ uint patch_2000[] = {
505 0x6079e2bb 507 0x6079e2bb
506}; 508};
507 509
508uint patch_2f00[] = { 510static uint patch_2f00[] __initdata = {
509 0x30303030, 511 0x30303030,
510 0x3e3e3434, 512 0x3e3e3434,
511 0xabbf9b99, 513 0xabbf9b99,
@@ -572,7 +574,7 @@ uint patch_2f00[] = {
572 0xf22f3f23 574 0xf22f3f23
573}; 575};
574 576
575uint patch_2e00[] = { 577static uint patch_2e00[] __initdata = {
576 0x27eeeeee, 578 0x27eeeeee,
577 0xeeeeeeee, 579 0xeeeeeeee,
578 0xeeeeeeee, 580 0xeeeeeeee,
@@ -598,7 +600,7 @@ uint patch_2e00[] = {
598 600
599#ifdef CONFIG_USB_SOF_UCODE_PATCH 601#ifdef CONFIG_USB_SOF_UCODE_PATCH
600 602
601uint patch_2000[] = { 603static uint patch_2000[] __initdata = {
602 0x7fff0000, 604 0x7fff0000,
603 0x7ffd0000, 605 0x7ffd0000,
604 0x7ffb0000, 606 0x7ffb0000,
@@ -613,21 +615,25 @@ uint patch_2000[] = {
613 0x60750000 615 0x60750000
614}; 616};
615 617
616uint patch_2f00[] = { 618static uint patch_2f00[] __initdata = {
617 0x3030304c, 619 0x3030304c,
618 0xcab9e441, 620 0xcab9e441,
619 0xa1aaf220 621 0xa1aaf220
620}; 622};
621#endif 623#endif
622 624
623void 625void __init cpm_load_patch(cpm8xx_t *cp)
624cpm_load_patch(cpm8xx_t *cp)
625{ 626{
626 volatile uint *dp; /* Dual-ported RAM. */ 627 volatile uint *dp; /* Dual-ported RAM. */
627 volatile cpm8xx_t *commproc; 628 volatile cpm8xx_t *commproc;
629#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \
630 defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
628 volatile iic_t *iip; 631 volatile iic_t *iip;
629 volatile spi_t *spp; 632 volatile struct spi_pram *spp;
633#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH
630 volatile smc_uart_t *smp; 634 volatile smc_uart_t *smp;
635#endif
636#endif
631 int i; 637 int i;
632 638
633 commproc = cp; 639 commproc = cp;
@@ -668,8 +674,8 @@ cpm_load_patch(cpm8xx_t *cp)
668 /* Put SPI above the IIC, also 32-byte aligned. 674 /* Put SPI above the IIC, also 32-byte aligned.
669 */ 675 */
670 i = (RPBASE + sizeof(iic_t) + 31) & ~31; 676 i = (RPBASE + sizeof(iic_t) + 31) & ~31;
671 spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI]; 677 spp = (struct spi_pram *)&commproc->cp_dparam[PROFF_SPI];
672 spp->spi_rpbase = i; 678 spp->rpbase = i;
673 679
674# if defined(CONFIG_I2C_SPI_UCODE_PATCH) 680# if defined(CONFIG_I2C_SPI_UCODE_PATCH)
675 commproc->cp_cpmcr1 = 0x802a; 681 commproc->cp_cpmcr1 = 0x802a;