aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches/0017-power-reset-msm-switch-Kconfig-to-ARCH_QCOM-depends.patch
blob: 868146c40f7050cac3665677278a9bf93cb76390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 6e8707828be07397ee8ee437a6ef1b8f73f82287 Mon Sep 17 00:00:00 2001
From: Kumar Gala <galak@codeaurora.org>
Date: Thu, 30 Jan 2014 14:46:08 -0600
Subject: [PATCH 017/182] power: reset: msm - switch Kconfig to ARCH_QCOM
 depends

We've split Qualcomm MSM support into legacy and multiplatform.  The reset
driver is only relevant on the multiplatform supported SoCs so switch the
Kconfig depends to ARCH_QCOM.

Acked-by: Dmitry Eremin-Solenikov
Signed-off-by: Kumar Gala <galak@codeaurora.org>
---
 drivers/power/reset/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 6d452a7..fa0e4e0 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -22,7 +22,7 @@ config POWER_RESET_GPIO
 
 config POWER_RESET_MSM
 	bool "Qualcomm MSM power-off driver"
-	depends on POWER_RESET && ARCH_MSM
+	depends on POWER_RESET && ARCH_QCOM
 	help
 	  Power off and restart support for Qualcomm boards.
 
-- 
1.7.10.4
} /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
From 5ed5b5e9614fa5b02da699ab565af76c7e63d64d Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
Date: Mon, 7 Jan 2013 17:45:39 +0100
Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices

---
 arch/mips/bcm63xx/Makefile                         |    2 +-
 arch/mips/bcm63xx/boards/board_bcm963xx.c          |   17 ++++-
 arch/mips/bcm63xx/dev-flash.c                      |    2 +-
 arch/mips/bcm63xx/pci-rt2x00-fixup.c               |   71 ++++++++++++++++++++
 .../include/asm/mach-bcm63xx/bcm63xx_dev_flash.h   |    2 +-
 .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h |    9 ++-
 .../include/asm/mach-bcm63xx/pci_rt2x00_fixup.h    |    9 +++
 7 files changed, 104 insertions(+), 8 deletions(-)
 create mode 100644 arch/mips/bcm63xx/pci-rt2x00-fixup.c
 create mode 100644 arch/mips/include/asm/mach-bcm63xx/pci_rt2x00_fixup.h

--- a/arch/mips/bcm63xx/Makefile
+++ b/arch/mips/bcm63xx/Makefile
@@ -2,7 +2,7 @@ obj-y		+= clk.o cpu.o cs.o gpio.o irq.o
 		   setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \
 		   dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \
 		   dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \
-		   pci-ath9k-fixup.o usb-common.o
+		   pci-ath9k-fixup.o pci-rt2x00-fixup.o usb-common.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 obj-y		+= boards/
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -34,6 +34,7 @@
 #include <bcm63xx_dev_usb_usbd.h>
 #include <board_bcm963xx.h>
 #include <pci_ath9k_fixup.h>
+#include <pci_rt2x00_fixup.h>
 
 #include <uapi/linux/bcm933xx_hcs.h>
 #include <uapi/linux/bcm963xx_tag.h>
@@ -1065,9 +1066,19 @@ int __init board_register_devices(void)
 	}
 
 	/* register any fixups */
-	for (i = 0; i < board.has_caldata; i++)
-		pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset,
-			board.caldata[i].endian_check, board.caldata[i].led_pin);
+	for (i = 0; i < board.has_caldata; i++) {
+		switch (board.caldata[i].vendor) {
+		case PCI_VENDOR_ID_ATHEROS:
+			pci_enable_ath9k_fixup(board.caldata[i].slot,
+				board.caldata[i].caldata_offset, board.caldata[i].endian_check,
+				board.caldata[i].led_pin);
+			break;
+		case PCI_VENDOR_ID_RALINK:
+			pci_enable_rt2x00_fixup(board.caldata[i].slot,
+				board.caldata[i].eeprom);
+			break;
+		}
+	}
 
 	return 0;
 }
--- a/arch/mips/bcm63xx/dev-flash.c
+++ b/arch/mips/bcm63xx/dev-flash.c
@@ -193,7 +193,7 @@ void __init bcm63xx_flash_detect(void)
 	}
 }
 
-int __init bcm63xx_flash_register(int num_caldata, struct ath9k_caldata *caldata)
+int __init bcm63xx_flash_register(int num_caldata, struct bcm63xx_caldata *caldata)
 {
 	u32 val;
 	unsigned int i;
--- /dev/null
+++ b/arch/mips/bcm63xx/pci-rt2x00-fixup.c
@@ -0,0 +1,72 @@
+/*
+ *  Broadcom BCM63XX RT2x00 EEPROM fixup helper.
+ *
+ *  Copyright (C) 2012 Álvaro Fernández Rojas <noltari@gmail.com>
+ *
+ *  Based on
+ *
+ *  Broadcom BCM63XX Ath9k EEPROM fixup helper.
+ *
+ *  Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/if_ether.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+#include <linux/rt2x00_platform.h>
+
+#include <bcm63xx_nvram.h>
+#include <pci_rt2x00_fixup.h>
+
+struct rt2x00_fixup {
+	unsigned slot;
+	u8 mac[ETH_ALEN];
+	struct rt2x00_platform_data pdata;
+};
+
+static int rt2x00_num_fixups;
+static struct rt2x00_fixup rt2x00_fixups[2] = {
+	{
+		.slot = 255,
+	},
+	{
+		.slot = 255,
+	},
+};
+
+static void rt2x00_pci_fixup(struct pci_dev *dev)
+{
+	unsigned i;
+	struct rt2x00_platform_data *pdata = NULL;
+
+	for (i = 0; i < rt2x00_num_fixups; i++) {
+		if (rt2x00_fixups[i].slot != PCI_SLOT(dev->devfn))
+			continue;
+
+		pdata = &rt2x00_fixups[i].pdata;
+		break;
+	}
+
+	dev->dev.platform_data = pdata;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_RALINK, PCI_ANY_ID, rt2x00_pci_fixup);
+
+void __init pci_enable_rt2x00_fixup(unsigned slot, char* eeprom)
+{
+	if (rt2x00_num_fixups >= ARRAY_SIZE(rt2x00_fixups))
+		return;
+
+	rt2x00_fixups[rt2x00_num_fixups].slot = slot;
+	rt2x00_fixups[rt2x00_num_fixups].pdata.eeprom_file_name = kstrdup(eeprom, GFP_KERNEL);
+
+	if (bcm63xx_nvram_get_mac_address(rt2x00_fixups[rt2x00_num_fixups].mac))
+		return;
+
+	rt2x00_fixups[rt2x00_num_fixups].pdata.mac_address = rt2x00_fixups[rt2x00_num_fixups].mac;
+	rt2x00_num_fixups++;
+}
+
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
@@ -11,7 +11,7 @@ enum {
 
 void bcm63xx_flash_detect(void);
 
-int __init bcm63xx_flash_register(int num_caldata, struct ath9k_caldata *caldata);
+int __init bcm63xx_flash_register(int num_caldata, struct bcm63xx_caldata *caldata);
 
 int bcm63xx_flash_get_type(void);
 
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -9,6 +9,7 @@
 #include <bcm63xx_dev_usb_usbd.h>
 #include <bcm63xx_dev_dsp.h>
 #include <pci_ath9k_fixup.h>
+#include <pci_rt2x00_fixup.h>
 
 /*
  * flash mapping
@@ -16,11 +17,15 @@
 #define BCM963XX_CFE_VERSION_OFFSET	0x570
 #define BCM963XX_NVRAM_OFFSET		0x580
 
-struct ath9k_caldata {
+struct bcm63xx_caldata {
+	unsigned int	vendor;
 	unsigned int	slot;
 	u32		caldata_offset;
+	/* Atheros */
 	unsigned int	endian_check:1;
 	int		led_pin;
+	/* Ralink */
+	char*		eeprom;
 };
 
 /*
@@ -45,7 +50,7 @@ struct board_info {
 	unsigned int	has_caldata:2;
 
 	/* wifi calibration data config */
-	struct ath9k_caldata caldata[2];
+	struct bcm63xx_caldata caldata[2];
 
 	/* ethernet config */
 	struct bcm63xx_enet_platform_data enet0;
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/pci_rt2x00_fixup.h
@@ -0,0 +1,9 @@
+#ifndef _PCI_RT2X00_FIXUP
+#define _PCI_RT2X00_FIXUP
+
+#define PCI_VENDOR_ID_RALINK 0x1814
+
+void pci_enable_rt2x00_fixup(unsigned slot, char* eeprom) __init;
+
+#endif /* _PCI_RT2X00_FIXUP */
+