mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-04-20 19:53:43 +00:00
linux-mainline 3.2: kernel recipe based on mainline 3.2.16 with additional patches for e.g. beagleboard on top
This patchset is managed in https://github.com/beagleboard/kernel/tree/beagleboard-3.2 by Robert Nelson and myself. Tested on beagleboard-xM/Angstrom Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
This commit is contained in:
committed by
Denys Dmytriyenko
parent
aff1018e66
commit
4e18d70247
@@ -0,0 +1,59 @@
|
||||
From 0e4ed624d99a4bcc57d6243867a00472b141b3f8 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Mon, 10 Oct 2011 11:12:40 -0500
|
||||
Subject: [PATCH 01/13] expansion: add buddy param for expansionboard names
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 14 ++++++++++++++
|
||||
1 files changed, 14 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index 4a71cb7..6f8cf47 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/gpio.h>
|
||||
+#include <linux/irq.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/opp.h>
|
||||
@@ -156,6 +157,8 @@ static void __init omap3_beagle_init_rev(void)
|
||||
}
|
||||
}
|
||||
|
||||
+char expansionboard_name[16];
|
||||
+
|
||||
static struct mtd_partition omap3beagle_nand_partitions[] = {
|
||||
/* All the partition sizes are listed in terms of NAND block size */
|
||||
{
|
||||
@@ -474,6 +477,15 @@ static struct omap_board_mux board_mux[] __initdata = {
|
||||
};
|
||||
#endif
|
||||
|
||||
+static int __init expansionboard_setup(char *str)
|
||||
+{
|
||||
+ if (!str)
|
||||
+ return -EINVAL;
|
||||
+ strncpy(expansionboard_name, str, 16);
|
||||
+ printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void __init beagle_opp_init(void)
|
||||
{
|
||||
int r = 0;
|
||||
@@ -552,6 +564,8 @@ static void __init omap3_beagle_init(void)
|
||||
beagle_opp_init();
|
||||
}
|
||||
|
||||
+early_param("buddy", expansionboard_setup);
|
||||
+
|
||||
MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
|
||||
/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
|
||||
.atag_offset = 0x100,
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From 97ce508ccf66c32b24087f8e0243222b51bc0c09 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Mon, 10 Oct 2011 11:13:49 -0500
|
||||
Subject: [PATCH 02/13] expansion: add mmc regulator and ds1307 rtc
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 19 +++++++++++++++++++
|
||||
1 files changed, 19 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index 6f8cf47..9f5706b 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -257,6 +257,12 @@ static struct omap2_hsmmc_info mmc[] = {
|
||||
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
|
||||
.gpio_wp = -EINVAL,
|
||||
},
|
||||
+ {
|
||||
+ .mmc = 2,
|
||||
+ .caps = MMC_CAP_4_BIT_DATA,
|
||||
+ .transceiver = true,
|
||||
+ .ocr_mask = 0x00100000, /* 3.3V */
|
||||
+ },
|
||||
{} /* Terminator */
|
||||
};
|
||||
|
||||
@@ -378,6 +384,18 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
|
||||
},
|
||||
};
|
||||
|
||||
+#if defined(CONFIG_RTC_DRV_DS1307) || \
|
||||
+ defined(CONFIG_RTC_DRV_DS1307_MODULE)
|
||||
+
|
||||
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
|
||||
+ {
|
||||
+ I2C_BOARD_INFO("ds1307", 0x68),
|
||||
+ },
|
||||
+};
|
||||
+#else
|
||||
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
|
||||
+#endif
|
||||
+
|
||||
static int __init omap3_beagle_i2c_init(void)
|
||||
{
|
||||
omap3_pmic_get_config(&beagle_twldata,
|
||||
@@ -388,6 +406,7 @@ static int __init omap3_beagle_i2c_init(void)
|
||||
beagle_twldata.vpll2->constraints.name = "VDVI";
|
||||
|
||||
omap3_pmic_init("twl4030", &beagle_twldata);
|
||||
+ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, ARRAY_SIZE(beagle_i2c2_boardinfo));
|
||||
/* Bus 3 is attached to the DVI port where devices like the pico DLP
|
||||
* projector don't work reliably with 400kHz */
|
||||
omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
From 7548790462d7cea9d92688b488026569187b1044 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Mon, 10 Oct 2011 11:16:12 -0500
|
||||
Subject: [PATCH 03/13] expansion: add zippy
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 51 +++++++++++++++++++++++++++++++
|
||||
1 files changed, 51 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index 9f5706b..6ffafd6 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -159,6 +159,48 @@ static void __init omap3_beagle_init_rev(void)
|
||||
|
||||
char expansionboard_name[16];
|
||||
|
||||
+#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
|
||||
+
|
||||
+#include <plat/mcspi.h>
|
||||
+#include <linux/spi/spi.h>
|
||||
+
|
||||
+#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157
|
||||
+
|
||||
+static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
|
||||
+ .turbo_mode = 0,
|
||||
+ .single_channel = 1, /* 0: slave, 1: master */
|
||||
+};
|
||||
+
|
||||
+static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = {
|
||||
+ {
|
||||
+ .modalias = "enc28j60",
|
||||
+ .bus_num = 4,
|
||||
+ .chip_select = 0,
|
||||
+ .max_speed_hz = 20000000,
|
||||
+ .controller_data = &enc28j60_spi_chip_info,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static void __init omap3beagle_enc28j60_init(void)
|
||||
+{
|
||||
+ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
|
||||
+ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
|
||||
+ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
|
||||
+ omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
|
||||
+ irq_set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
|
||||
+ } else {
|
||||
+ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ spi_register_board_info(omap3beagle_zippy_spi_board_info,
|
||||
+ ARRAY_SIZE(omap3beagle_zippy_spi_board_info));
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+static inline void __init omap3beagle_enc28j60_init(void) { return; }
|
||||
+#endif
|
||||
+
|
||||
static struct mtd_partition omap3beagle_nand_partitions[] = {
|
||||
/* All the partition sizes are listed in terms of NAND block size */
|
||||
{
|
||||
@@ -567,6 +609,15 @@ static void __init omap3_beagle_init(void)
|
||||
/* REVISIT leave DVI powered down until it's needed ... */
|
||||
gpio_request_one(170, GPIOF_OUT_INIT_HIGH, "DVI_nPD");
|
||||
|
||||
+ if(!strcmp(expansionboard_name, "zippy"))
|
||||
+ {
|
||||
+ printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n");
|
||||
+ omap3beagle_enc28j60_init();
|
||||
+ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
|
||||
+ mmc[1].gpio_wp = 141;
|
||||
+ mmc[1].gpio_cd = 162;
|
||||
+ }
|
||||
+
|
||||
usb_musb_init(NULL);
|
||||
usbhs_init(&usbhs_bdata);
|
||||
omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
From 27a4c659c1c665b877c032d3409b0c593cd0463b Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Mon, 10 Oct 2011 11:18:08 -0500
|
||||
Subject: [PATCH 04/13] expansion: add zippy2
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 51 +++++++++++++++++++++++++++++++
|
||||
1 files changed, 51 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index 6ffafd6..259e6e7 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -201,6 +201,48 @@ static void __init omap3beagle_enc28j60_init(void)
|
||||
static inline void __init omap3beagle_enc28j60_init(void) { return; }
|
||||
#endif
|
||||
|
||||
+#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
|
||||
+
|
||||
+#include <plat/mcspi.h>
|
||||
+#include <linux/spi/spi.h>
|
||||
+
|
||||
+#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157
|
||||
+
|
||||
+static struct omap2_mcspi_device_config ks8851_spi_chip_info = {
|
||||
+ .turbo_mode = 0,
|
||||
+ .single_channel = 1, /* 0: slave, 1: master */
|
||||
+};
|
||||
+
|
||||
+static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = {
|
||||
+ {
|
||||
+ .modalias = "ks8851",
|
||||
+ .bus_num = 4,
|
||||
+ .chip_select = 0,
|
||||
+ .max_speed_hz = 36000000,
|
||||
+ .controller_data = &ks8851_spi_chip_info,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static void __init omap3beagle_ks8851_init(void)
|
||||
+{
|
||||
+ if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) &&
|
||||
+ (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) {
|
||||
+ gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0);
|
||||
+ omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ);
|
||||
+ irq_set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
|
||||
+ } else {
|
||||
+ printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ spi_register_board_info(omap3beagle_zippy2_spi_board_info,
|
||||
+ ARRAY_SIZE(omap3beagle_zippy2_spi_board_info));
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+static inline void __init omap3beagle_ks8851_init(void) { return; }
|
||||
+#endif
|
||||
+
|
||||
static struct mtd_partition omap3beagle_nand_partitions[] = {
|
||||
/* All the partition sizes are listed in terms of NAND block size */
|
||||
{
|
||||
@@ -618,6 +660,15 @@ static void __init omap3_beagle_init(void)
|
||||
mmc[1].gpio_cd = 162;
|
||||
}
|
||||
|
||||
+ if(!strcmp(expansionboard_name, "zippy2"))
|
||||
+ {
|
||||
+ printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n");
|
||||
+ omap3beagle_ks8851_init();
|
||||
+ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
|
||||
+ mmc[1].gpio_wp = 141;
|
||||
+ mmc[1].gpio_cd = 162;
|
||||
+ }
|
||||
+
|
||||
usb_musb_init(NULL);
|
||||
usbhs_init(&usbhs_bdata);
|
||||
omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From 0dc814729657ab525ed8ac2e1a96e4f3dc706bb3 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Mon, 10 Oct 2011 11:18:49 -0500
|
||||
Subject: [PATCH 05/13] expansion: add trainer
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 31 +++++++++++++++++++++++++++++++
|
||||
1 files changed, 31 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index 259e6e7..b0b16b4 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -669,6 +669,37 @@ static void __init omap3_beagle_init(void)
|
||||
mmc[1].gpio_cd = 162;
|
||||
}
|
||||
|
||||
+ if(!strcmp(expansionboard_name, "trainer"))
|
||||
+ {
|
||||
+ printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n");
|
||||
+ gpio_request(130, "sysfs");
|
||||
+ gpio_export(130, 1);
|
||||
+ gpio_request(131, "sysfs");
|
||||
+ gpio_export(131, 1);
|
||||
+ gpio_request(132, "sysfs");
|
||||
+ gpio_export(132, 1);
|
||||
+ gpio_request(133, "sysfs");
|
||||
+ gpio_export(133, 1);
|
||||
+ gpio_request(134, "sysfs");
|
||||
+ gpio_export(134, 1);
|
||||
+ gpio_request(135, "sysfs");
|
||||
+ gpio_export(135, 1);
|
||||
+ gpio_request(136, "sysfs");
|
||||
+ gpio_export(136, 1);
|
||||
+ gpio_request(137, "sysfs");
|
||||
+ gpio_export(137, 1);
|
||||
+ gpio_request(138, "sysfs");
|
||||
+ gpio_export(138, 1);
|
||||
+ gpio_request(139, "sysfs");
|
||||
+ gpio_export(139, 1);
|
||||
+ gpio_request(140, "sysfs");
|
||||
+ gpio_export(140, 1);
|
||||
+ gpio_request(141, "sysfs");
|
||||
+ gpio_export(141, 1);
|
||||
+ gpio_request(162, "sysfs");
|
||||
+ gpio_export(162, 1);
|
||||
+ }
|
||||
+
|
||||
usb_musb_init(NULL);
|
||||
usbhs_init(&usbhs_bdata);
|
||||
omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
From 3c92dddf8709162e8ee3a6bdacb83a3e85f70fb1 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Fri, 16 Mar 2012 09:47:57 -0500
|
||||
Subject: [PATCH 06/13] expansion: add ulcd
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 122 ++++++++++++++++++++++
|
||||
drivers/video/omap2/displays/panel-generic-dpi.c | 25 +++++
|
||||
2 files changed, 147 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index b0b16b4..a546c2b 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <linux/regulator/machine.h>
|
||||
#include <linux/i2c/twl.h>
|
||||
+#include <linux/i2c/tsc2007.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
@@ -84,11 +85,15 @@ static struct {
|
||||
int usb_pwr_level;
|
||||
int reset_gpio;
|
||||
int usr_button_gpio;
|
||||
+ char *lcd_driver_name;
|
||||
+ int lcd_pwren;
|
||||
} beagle_config = {
|
||||
.mmc1_gpio_wp = -EINVAL,
|
||||
.usb_pwr_level = GPIOF_OUT_INIT_LOW,
|
||||
.reset_gpio = 129,
|
||||
.usr_button_gpio = 4,
|
||||
+ .lcd_driver_name = "",
|
||||
+ .lcd_pwren = 156
|
||||
};
|
||||
|
||||
static struct gpio omap3_beagle_rev_gpios[] __initdata = {
|
||||
@@ -158,6 +163,7 @@ static void __init omap3_beagle_init_rev(void)
|
||||
}
|
||||
|
||||
char expansionboard_name[16];
|
||||
+char expansionboard2_name[16];
|
||||
|
||||
#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
|
||||
|
||||
@@ -312,9 +318,46 @@ static struct omap_dss_device beagle_tv_device = {
|
||||
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
|
||||
};
|
||||
|
||||
+static int beagle_enable_lcd(struct omap_dss_device *dssdev)
|
||||
+{
|
||||
+ if (gpio_is_valid(beagle_config.lcd_pwren)) {
|
||||
+ printk(KERN_INFO "%s: Enabling LCD\n", __FUNCTION__);
|
||||
+ gpio_set_value(beagle_config.lcd_pwren, 0);
|
||||
+ } else {
|
||||
+ printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n",
|
||||
+ __FUNCTION__, beagle_config.lcd_pwren);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void beagle_disable_lcd(struct omap_dss_device *dssdev)
|
||||
+{
|
||||
+ if (gpio_is_valid(beagle_config.lcd_pwren)) {
|
||||
+ printk(KERN_INFO "%s: Disabling LCD\n", __FUNCTION__);
|
||||
+ gpio_set_value(beagle_config.lcd_pwren, 1);
|
||||
+ } else {
|
||||
+ printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n",
|
||||
+ __FUNCTION__, beagle_config.lcd_pwren);
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static struct omap_dss_device beagle_lcd_device = {
|
||||
+ .type = OMAP_DISPLAY_TYPE_DPI,
|
||||
+ .name = "lcd",
|
||||
+ .driver_name = "tfc_s9700rtwv35tr-01b",
|
||||
+ .phy.dpi.data_lines = 24,
|
||||
+ .platform_enable = beagle_enable_lcd,
|
||||
+ .platform_disable = beagle_disable_lcd,
|
||||
+ .reset_gpio = -EINVAL,
|
||||
+};
|
||||
+
|
||||
static struct omap_dss_device *beagle_dss_devices[] = {
|
||||
&beagle_dvi_device,
|
||||
&beagle_tv_device,
|
||||
+ &beagle_lcd_device,
|
||||
};
|
||||
|
||||
static struct omap_dss_board_info beagle_dss_data = {
|
||||
@@ -331,6 +374,11 @@ static void __init beagle_display_init(void)
|
||||
"DVI reset");
|
||||
if (r < 0)
|
||||
printk(KERN_ERR "Unable to get DVI reset GPIO\n");
|
||||
+
|
||||
+ r = gpio_request_one(beagle_config.lcd_pwren, GPIOF_OUT_INIT_LOW,
|
||||
+ "LCD power");
|
||||
+ if (r < 0)
|
||||
+ printk(KERN_ERR "Unable to get LCD power enable GPIO\n");
|
||||
}
|
||||
|
||||
#include "sdram-micron-mt46h32m32lf-6.h"
|
||||
@@ -480,6 +528,50 @@ static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
|
||||
static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
|
||||
#endif
|
||||
|
||||
+#if defined(CONFIG_INPUT_TOUCHSCREEN) && \
|
||||
+ ( defined(CONFIG_TOUCHSCREEN_TSC2007) || defined(CONFIG_TOUCHSCREEN_TSC2007_MODULE))
|
||||
+/* Touchscreen */
|
||||
+#define OMAP3BEAGLE_TSC2007_GPIO 157
|
||||
+static int omap3beagle_tsc2007_get_pendown_state(void)
|
||||
+{
|
||||
+ return !gpio_get_value(OMAP3BEAGLE_TSC2007_GPIO);
|
||||
+}
|
||||
+
|
||||
+static void __init omap3beagle_tsc2007_init(void)
|
||||
+{
|
||||
+ int r;
|
||||
+
|
||||
+ omap_mux_init_gpio(OMAP3BEAGLE_TSC2007_GPIO, OMAP_PIN_INPUT_PULLUP);
|
||||
+
|
||||
+ r = gpio_request_one(OMAP3BEAGLE_TSC2007_GPIO, GPIOF_IN, "tsc2007_pen_down");
|
||||
+ if (r < 0) {
|
||||
+ printk(KERN_ERR "failed to request GPIO#%d for "
|
||||
+ "tsc2007 pen down IRQ\n", OMAP3BEAGLE_TSC2007_GPIO);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ irq_set_irq_type(gpio_to_irq(OMAP3BEAGLE_TSC2007_GPIO), IRQ_TYPE_EDGE_FALLING);
|
||||
+}
|
||||
+
|
||||
+static struct tsc2007_platform_data tsc2007_info = {
|
||||
+ .model = 2007,
|
||||
+ .x_plate_ohms = 180,
|
||||
+ .get_pendown_state = omap3beagle_tsc2007_get_pendown_state,
|
||||
+};
|
||||
+
|
||||
+static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = {
|
||||
+ {
|
||||
+ I2C_BOARD_INFO("tlc59108", 0x40),
|
||||
+ I2C_BOARD_INFO("tsc2007", 0x48),
|
||||
+ .irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO),
|
||||
+ .platform_data = &tsc2007_info,
|
||||
+ },
|
||||
+};
|
||||
+#else
|
||||
+static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = {};
|
||||
+static void __init omap3beagle_tsc2007_init(void) { return; }
|
||||
+#endif
|
||||
+
|
||||
static int __init omap3_beagle_i2c_init(void)
|
||||
{
|
||||
omap3_pmic_get_config(&beagle_twldata,
|
||||
@@ -490,7 +582,17 @@ static int __init omap3_beagle_i2c_init(void)
|
||||
beagle_twldata.vpll2->constraints.name = "VDVI";
|
||||
|
||||
omap3_pmic_init("twl4030", &beagle_twldata);
|
||||
+ if(!strcmp(expansionboard2_name, "bbtoys-ulcd"))
|
||||
+ {
|
||||
+ printk(KERN_INFO "Beagle second expansionboard: registering bbtoys-ulcd i2c bus\n");
|
||||
+ omap_register_i2c_bus(2, 400, beagle_i2c2_bbtoys_ulcd,
|
||||
+ ARRAY_SIZE(beagle_i2c2_bbtoys_ulcd));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, ARRAY_SIZE(beagle_i2c2_boardinfo));
|
||||
+ }
|
||||
+
|
||||
/* Bus 3 is attached to the DVI port where devices like the pico DLP
|
||||
* projector don't work reliably with 400kHz */
|
||||
omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
|
||||
@@ -589,6 +691,15 @@ static int __init expansionboard_setup(char *str)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int __init expansionboard2_setup(char *str)
|
||||
+{
|
||||
+ if (!str)
|
||||
+ return -EINVAL;
|
||||
+ strncpy(expansionboard2_name, str, 16);
|
||||
+ printk(KERN_INFO "Beagle second expansionboard: %s\n", expansionboard2_name);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void __init beagle_opp_init(void)
|
||||
{
|
||||
int r = 0;
|
||||
@@ -640,6 +751,10 @@ static void __init omap3_beagle_init(void)
|
||||
|
||||
gpio_buttons[0].gpio = beagle_config.usr_button_gpio;
|
||||
|
||||
+ /* TODO: set lcd_driver_name by command line or device tree */
|
||||
+ beagle_config.lcd_driver_name = "tfc_s9700rtwv35tr-01b",
|
||||
+ //lcd_panel.name = beagle_config.lcd_driver_name;
|
||||
+
|
||||
platform_add_devices(omap3_beagle_devices,
|
||||
ARRAY_SIZE(omap3_beagle_devices));
|
||||
omap_display_init(&beagle_dss_data);
|
||||
@@ -700,6 +815,12 @@ static void __init omap3_beagle_init(void)
|
||||
gpio_export(162, 1);
|
||||
}
|
||||
|
||||
+ if(!strcmp(expansionboard2_name, "bbtoys-ulcd"))
|
||||
+ {
|
||||
+ printk(KERN_INFO "Beagle second expansionboard: initializing touchscreen: tsc2007\n");
|
||||
+ omap3beagle_tsc2007_init();
|
||||
+ }
|
||||
+
|
||||
usb_musb_init(NULL);
|
||||
usbhs_init(&usbhs_bdata);
|
||||
omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
|
||||
@@ -717,6 +838,7 @@ static void __init omap3_beagle_init(void)
|
||||
}
|
||||
|
||||
early_param("buddy", expansionboard_setup);
|
||||
+early_param("buddy2", expansionboard2_setup);
|
||||
|
||||
MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
|
||||
/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
|
||||
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
|
||||
index 519c47d..495d693 100644
|
||||
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
|
||||
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
|
||||
@@ -297,6 +297,31 @@ static struct panel_config generic_dpi_panels[] = {
|
||||
|
||||
.name = "apollon",
|
||||
},
|
||||
+
|
||||
+ /* ThreeFiveCorp S9700RTWV35TR-01B */
|
||||
+ {
|
||||
+ {
|
||||
+ .x_res = 800,
|
||||
+ .y_res = 480,
|
||||
+
|
||||
+ .pixel_clock = 30000,
|
||||
+
|
||||
+ .hsw = 49,
|
||||
+ .hfp = 41,
|
||||
+ .hbp = 40,
|
||||
+
|
||||
+ .vsw = 4,
|
||||
+ .vfp = 14,
|
||||
+ .vbp = 29,
|
||||
+ },
|
||||
+ .acbi = 0x0,
|
||||
+ .acb = 0x0,
|
||||
+ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
|
||||
+ OMAP_DSS_LCD_IHS, // | OMAP_DSS_LCD_IEO; - TODO check this - doesn't work with this enabled
|
||||
+ .power_on_delay = 50,
|
||||
+ .power_off_delay = 100,
|
||||
+ .name = "tfc_s9700rtwv35tr-01b",
|
||||
+ },
|
||||
};
|
||||
|
||||
struct panel_drv_data {
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 460ac29a1ee0577d6b9044caa53761cc0d02b495 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Wed, 25 Jan 2012 15:48:36 +0100
|
||||
Subject: [PATCH 07/13] beagleboard: reinstate usage of hi-speed PLL divider
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++
|
||||
1 files changed, 5 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index a546c2b..e28ae72 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -308,6 +308,11 @@ static struct omap_dss_device beagle_dvi_device = {
|
||||
.driver_name = "dvi",
|
||||
.data = &dvi_panel,
|
||||
.phy.dpi.data_lines = 24,
|
||||
+ .clocks = {
|
||||
+ .dispc = {
|
||||
+ .dispc_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
|
||||
+ },
|
||||
+ },
|
||||
.reset_gpio = -EINVAL,
|
||||
};
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From 3d9465ffd5becb88c1ba36b98f8375898605f529 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 23 Feb 2012 09:23:10 -0600
|
||||
Subject: [PATCH 08/13] Turn on the USB regulator on Beagle xM explicitly
|
||||
|
||||
Turn on the USB regulator on Beagle xM explicitly when the USB
|
||||
subsystem asks for it, rather than relying on u-boot to do it.
|
||||
|
||||
http://www.spinics.net/lists/linux-omap/msg65102.html
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 19 +++++++++++++++++++
|
||||
1 files changed, 19 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index e28ae72..30cb2f0 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -411,6 +411,24 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
|
||||
REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
|
||||
};
|
||||
|
||||
+static struct regulator_consumer_supply beagle_usb_supply[] = {
|
||||
+ REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"),
|
||||
+ REGULATOR_SUPPLY("hsusb1", "ehci-omap.0")
|
||||
+};
|
||||
+
|
||||
+static struct regulator_init_data usb_power = {
|
||||
+ .constraints = {
|
||||
+ .min_uV = 1800000,
|
||||
+ .max_uV = 1800000,
|
||||
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
|
||||
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
|
||||
+ | REGULATOR_CHANGE_MODE
|
||||
+ | REGULATOR_CHANGE_STATUS,
|
||||
+ },
|
||||
+ .num_consumer_supplies = ARRAY_SIZE(beagle_usb_supply),
|
||||
+ .consumer_supplies = beagle_usb_supply
|
||||
+};
|
||||
+
|
||||
static struct gpio_led gpio_leds[];
|
||||
|
||||
static int beagle_twl_gpio_setup(struct device *dev,
|
||||
@@ -513,6 +531,7 @@ static struct twl4030_platform_data beagle_twldata = {
|
||||
.gpio = &beagle_gpio_data,
|
||||
.vmmc1 = &beagle_vmmc1,
|
||||
.vsim = &beagle_vsim,
|
||||
+ .vaux2 = &usb_power,
|
||||
};
|
||||
|
||||
static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 1a553663864b5b69dcdfd7779640a1c0ce136a93 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Wed, 23 Mar 2011 08:37:54 -0500
|
||||
Subject: [PATCH 09/13] meego: modedb add Toshiba LTA070B220F 800x480 support
|
||||
|
||||
from http://wiki.meego.com/ARM/Meego_on_Beagleboard_from_scratch
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/video/modedb.c | 4 ++++
|
||||
1 files changed, 4 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
|
||||
index 5b686de..69ad1ec 100644
|
||||
--- a/drivers/video/modedb.c
|
||||
+++ b/drivers/video/modedb.c
|
||||
@@ -293,6 +293,10 @@ static const struct fb_videomode modedb[] = {
|
||||
/* 864x480 @ 60 Hz, 35.15 kHz hsync */
|
||||
{ NULL, 60, 864, 480, 27777, 1, 1, 1, 1, 0, 0,
|
||||
0, FB_VMODE_NONINTERLACED },
|
||||
+
|
||||
+ /* 800x480 @ 60 Hz, Toshiba LTA070B220F 7 inch LCD */
|
||||
+ { NULL, 60, 800, 480, 32787, 48, 80, 33, 31, 32, 2,
|
||||
+ FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED },
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FB_MODE_HELPERS
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From 6a386a61fc5cd9c71f8c5dc577e70b4c0f892130 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Fri, 27 Apr 2012 16:57:27 +0200
|
||||
Subject: [PATCH 10/13] beagleboard: fix uLCD7 support
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3beagle.c | 14 ++++++++++++--
|
||||
1 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
index 30cb2f0..0299d47 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <plat/board.h>
|
||||
#include <plat/common.h>
|
||||
#include <video/omapdss.h>
|
||||
+#include <video/omap-panel-generic-dpi.h>
|
||||
#include <video/omap-panel-dvi.h>
|
||||
#include <plat/gpmc.h>
|
||||
#include <plat/nand.h>
|
||||
@@ -349,14 +350,21 @@ static void beagle_disable_lcd(struct omap_dss_device *dssdev)
|
||||
return;
|
||||
}
|
||||
|
||||
+static struct panel_generic_dpi_data lcd_panel = {
|
||||
+ .name = "tfc_s9700rtwv35tr-01b",
|
||||
+ .platform_enable = beagle_enable_lcd,
|
||||
+ .platform_disable = beagle_disable_lcd,
|
||||
+};
|
||||
+
|
||||
static struct omap_dss_device beagle_lcd_device = {
|
||||
.type = OMAP_DISPLAY_TYPE_DPI,
|
||||
.name = "lcd",
|
||||
- .driver_name = "tfc_s9700rtwv35tr-01b",
|
||||
+ .driver_name = "generic_dpi_panel",
|
||||
.phy.dpi.data_lines = 24,
|
||||
.platform_enable = beagle_enable_lcd,
|
||||
.platform_disable = beagle_disable_lcd,
|
||||
.reset_gpio = -EINVAL,
|
||||
+ .data = &lcd_panel,
|
||||
};
|
||||
|
||||
static struct omap_dss_device *beagle_dss_devices[] = {
|
||||
@@ -586,6 +594,8 @@ static struct tsc2007_platform_data tsc2007_info = {
|
||||
static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("tlc59108", 0x40),
|
||||
+ },
|
||||
+ {
|
||||
I2C_BOARD_INFO("tsc2007", 0x48),
|
||||
.irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO),
|
||||
.platform_data = &tsc2007_info,
|
||||
@@ -777,7 +787,7 @@ static void __init omap3_beagle_init(void)
|
||||
|
||||
/* TODO: set lcd_driver_name by command line or device tree */
|
||||
beagle_config.lcd_driver_name = "tfc_s9700rtwv35tr-01b",
|
||||
- //lcd_panel.name = beagle_config.lcd_driver_name;
|
||||
+ lcd_panel.name = beagle_config.lcd_driver_name;
|
||||
|
||||
platform_add_devices(omap3_beagle_devices,
|
||||
ARRAY_SIZE(omap3_beagle_devices));
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 16c97b9941534b54a2fdf4d310fd22deb10d0cc1 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Sat, 8 Jan 2011 14:31:37 -0600
|
||||
Subject: [PATCH 11/13] default to fifo mode 5, for old musb beagles
|
||||
|
||||
The fifo mode 4, 16kb can cause corruption on musb/omap35xx,
|
||||
use mode 5, 8kb...
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/usb/musb/musb_core.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
|
||||
index 920f04e..66ce5e0 100644
|
||||
--- a/drivers/usb/musb/musb_core.c
|
||||
+++ b/drivers/usb/musb/musb_core.c
|
||||
@@ -1015,7 +1015,7 @@ static void musb_shutdown(struct platform_device *pdev)
|
||||
|| defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \
|
||||
|| defined(CONFIG_USB_MUSB_AM35X) \
|
||||
|| defined(CONFIG_USB_MUSB_AM35X_MODULE)
|
||||
-static ushort __initdata fifo_mode = 4;
|
||||
+static ushort __initdata fifo_mode = 5;
|
||||
#elif defined(CONFIG_USB_MUSB_UX500) \
|
||||
|| defined(CONFIG_USB_MUSB_UX500_MODULE)
|
||||
static ushort __initdata fifo_mode = 5;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
From 9f4af290c74b77e16555858a338feb467a8eedb0 Mon Sep 17 00:00:00 2001
|
||||
From: "Manjunathappa, Prakash" <prakash.pm@ti.com>
|
||||
Date: Mon, 1 Aug 2011 18:25:11 +0530
|
||||
Subject: [PATCH 12/13] backlight: Add TLC59108 backlight control driver
|
||||
|
||||
This patch adds support for I2C configurable TLC59108 backlight
|
||||
control driver.
|
||||
|
||||
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
|
||||
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
|
||||
---
|
||||
drivers/video/backlight/Kconfig | 8 ++
|
||||
drivers/video/backlight/Makefile | 1 +
|
||||
drivers/video/backlight/tlc59108.c | 160 ++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 169 insertions(+), 0 deletions(-)
|
||||
create mode 100755 drivers/video/backlight/tlc59108.c
|
||||
|
||||
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
|
||||
index 278aeaa..df9dac7 100644
|
||||
--- a/drivers/video/backlight/Kconfig
|
||||
+++ b/drivers/video/backlight/Kconfig
|
||||
@@ -342,6 +342,14 @@ config BACKLIGHT_AAT2870
|
||||
If you have a AnalogicTech AAT2870 say Y to enable the
|
||||
backlight driver.
|
||||
|
||||
+config BACKLIGHT_TLC59108
|
||||
+ tristate "TLC59108 LCD Backlight Driver"
|
||||
+ depends on I2C && BACKLIGHT_CLASS_DEVICE
|
||||
+ default n
|
||||
+ help
|
||||
+ If you have an LCD Panel with backlight control via TLC59108,
|
||||
+ say Y to enable its LCD control driver.
|
||||
+
|
||||
endif # BACKLIGHT_CLASS_DEVICE
|
||||
|
||||
endif # BACKLIGHT_LCD_SUPPORT
|
||||
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
|
||||
index fdd1fc4..ba31474 100644
|
||||
--- a/drivers/video/backlight/Makefile
|
||||
+++ b/drivers/video/backlight/Makefile
|
||||
@@ -39,4 +39,5 @@ obj-$(CONFIG_BACKLIGHT_ADP8870) += adp8870_bl.o
|
||||
obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o
|
||||
obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o
|
||||
obj-$(CONFIG_BACKLIGHT_AAT2870) += aat2870_bl.o
|
||||
+obj-$(CONFIG_BACKLIGHT_TLC59108) += tlc59108.o
|
||||
|
||||
diff --git a/drivers/video/backlight/tlc59108.c b/drivers/video/backlight/tlc59108.c
|
||||
new file mode 100755
|
||||
index 0000000..4f4ea34
|
||||
--- /dev/null
|
||||
+++ b/drivers/video/backlight/tlc59108.c
|
||||
@@ -0,0 +1,160 @@
|
||||
+/*
|
||||
+ * ti81xxhdmi_tlc59108.c
|
||||
+ *
|
||||
+ * Copyright (C) 2011 Texas Instruments
|
||||
+ * Author: Senthil Natarajan
|
||||
+ *
|
||||
+ * tlc59108 HDMI Driver
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ * more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ * History:
|
||||
+ *
|
||||
+ * Senthil Natarajan<senthil.n@ti.com> July 2011 I2C driver for tlc59108
|
||||
+ * backlight control
|
||||
+ */
|
||||
+
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/backlight.h>
|
||||
+#include <linux/fb.h>
|
||||
+
|
||||
+#define tlc59108_MODULE_NAME "tlc59108"
|
||||
+#define TLC59108_MODE1 0x00
|
||||
+#define TLC59108_PWM2 0x04
|
||||
+#define TLC59108_LEDOUT0 0x0c
|
||||
+#define TLC59108_LEDOUT1 0x0d
|
||||
+#define TLC59108_MAX_BRIGHTNESS 0xFF
|
||||
+
|
||||
+struct tlc59108_bl {
|
||||
+ struct i2c_client *client;
|
||||
+ struct backlight_device *bl;
|
||||
+};
|
||||
+
|
||||
+static void tlc59108_bl_set_backlight(struct tlc59108_bl *data, int brightness)
|
||||
+{
|
||||
+ /* Set Mode1 Register */
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00);
|
||||
+
|
||||
+ /* Set LEDOUT0 Register */
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x21);
|
||||
+
|
||||
+ /* Set Backlight Duty Cycle*/
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_PWM2,
|
||||
+ brightness & 0xff);
|
||||
+}
|
||||
+
|
||||
+static int tlc59108_bl_get_brightness(struct backlight_device *dev)
|
||||
+{
|
||||
+ struct backlight_properties *props = &dev->props;
|
||||
+
|
||||
+ return props->brightness;
|
||||
+}
|
||||
+
|
||||
+static int tlc59108_bl_update_status(struct backlight_device *dev)
|
||||
+{
|
||||
+ struct backlight_properties *props = &dev->props;
|
||||
+ struct tlc59108_bl *data = dev_get_drvdata(&dev->dev);
|
||||
+ int brightness = props->brightness;
|
||||
+
|
||||
+ tlc59108_bl_set_backlight(data, brightness);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct backlight_ops bl_ops = {
|
||||
+ .get_brightness = tlc59108_bl_get_brightness,
|
||||
+ .update_status = tlc59108_bl_update_status,
|
||||
+};
|
||||
+
|
||||
+static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id)
|
||||
+{
|
||||
+ struct backlight_properties props;
|
||||
+ struct tlc59108_bl *data = kzalloc(sizeof(struct tlc59108_bl),
|
||||
+ GFP_KERNEL);
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (!data)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ i2c_set_clientdata(c, data);
|
||||
+ data->client = c;
|
||||
+
|
||||
+ memset(&props, 0, sizeof(struct backlight_properties));
|
||||
+ props.max_brightness = TLC59108_MAX_BRIGHTNESS;
|
||||
+ props.type = BACKLIGHT_RAW;
|
||||
+ data->bl = backlight_device_register("tlc59108-bl", &c->dev, data,
|
||||
+ &bl_ops, &props);
|
||||
+ if (IS_ERR(data->bl)) {
|
||||
+ ret = PTR_ERR(data->bl);
|
||||
+ goto err_reg;
|
||||
+ }
|
||||
+
|
||||
+ data->bl->props.brightness = TLC59108_MAX_BRIGHTNESS;
|
||||
+
|
||||
+ backlight_update_status(data->bl);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+err_reg:
|
||||
+ data->bl = NULL;
|
||||
+ kfree(data);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int tlc59108_remove(struct i2c_client *c)
|
||||
+{
|
||||
+ struct tlc59108_bl *data = i2c_get_clientdata(c);
|
||||
+
|
||||
+ backlight_device_unregister(data->bl);
|
||||
+ data->bl = NULL;
|
||||
+
|
||||
+ kfree(data);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* I2C Device ID table */
|
||||
+static const struct i2c_device_id tlc59108_id[] = {
|
||||
+ { "tlc59108", 0 },
|
||||
+ { }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(i2c, tlc59108_id);
|
||||
+
|
||||
+/* I2C driver data */
|
||||
+static struct i2c_driver tlc59108_driver = {
|
||||
+ .driver = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .name = tlc59108_MODULE_NAME,
|
||||
+ },
|
||||
+ .probe = tlc59108_probe,
|
||||
+ .remove = tlc59108_remove,
|
||||
+ .id_table = tlc59108_id,
|
||||
+};
|
||||
+
|
||||
+static int __init tlc59108_init(void)
|
||||
+{
|
||||
+ return i2c_add_driver(&tlc59108_driver);
|
||||
+}
|
||||
+
|
||||
+static void __exit tlc59108_exit(void)
|
||||
+{
|
||||
+ i2c_del_driver(&tlc59108_driver);
|
||||
+}
|
||||
+
|
||||
+module_init(tlc59108_init);
|
||||
+module_exit(tlc59108_exit);
|
||||
+
|
||||
+MODULE_DESCRIPTION("LCD/Backlight control for TLC59108");
|
||||
+MODULE_AUTHOR("Senthil Natarajan <senthil.n@ti.com>");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
From a165f2f70ebcf073cfc934c510ecf86bb028ef4e Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Fri, 27 Apr 2012 21:30:00 +0200
|
||||
Subject: [PATCH 13/13] tlc59108: adjust for beagleboard+uLCD7
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
---
|
||||
drivers/video/backlight/tlc59108.c | 48 ++++++++++++++++++++++++------------
|
||||
1 files changed, 32 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/drivers/video/backlight/tlc59108.c b/drivers/video/backlight/tlc59108.c
|
||||
index 4f4ea34..de2d2ee 100755
|
||||
--- a/drivers/video/backlight/tlc59108.c
|
||||
+++ b/drivers/video/backlight/tlc59108.c
|
||||
@@ -29,9 +29,16 @@
|
||||
#include <linux/backlight.h>
|
||||
#include <linux/fb.h>
|
||||
|
||||
-#define tlc59108_MODULE_NAME "tlc59108"
|
||||
#define TLC59108_MODE1 0x00
|
||||
-#define TLC59108_PWM2 0x04
|
||||
+#define TLC59108_MODE2 0x01
|
||||
+#define TLC59108_PWM0 0x02
|
||||
+#define TLC59108_PWM1 0x03
|
||||
+#define TLC59108_PWM2 0x04
|
||||
+#define TLC59108_PWM3 0x05
|
||||
+#define TLC59108_PWM4 0x06
|
||||
+#define TLC59108_PWM5 0x07
|
||||
+#define TLC59108_PWM6 0x08
|
||||
+#define TLC59108_PWM7 0x09
|
||||
#define TLC59108_LEDOUT0 0x0c
|
||||
#define TLC59108_LEDOUT1 0x0d
|
||||
#define TLC59108_MAX_BRIGHTNESS 0xFF
|
||||
@@ -43,15 +50,9 @@ struct tlc59108_bl {
|
||||
|
||||
static void tlc59108_bl_set_backlight(struct tlc59108_bl *data, int brightness)
|
||||
{
|
||||
- /* Set Mode1 Register */
|
||||
- i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00);
|
||||
-
|
||||
- /* Set LEDOUT0 Register */
|
||||
- i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x21);
|
||||
-
|
||||
/* Set Backlight Duty Cycle*/
|
||||
i2c_smbus_write_byte_data(data->client, TLC59108_PWM2,
|
||||
- brightness & 0xff);
|
||||
+ 0xff - brightness );
|
||||
}
|
||||
|
||||
static int tlc59108_bl_get_brightness(struct backlight_device *dev)
|
||||
@@ -65,7 +66,17 @@ static int tlc59108_bl_update_status(struct backlight_device *dev)
|
||||
{
|
||||
struct backlight_properties *props = &dev->props;
|
||||
struct tlc59108_bl *data = dev_get_drvdata(&dev->dev);
|
||||
- int brightness = props->brightness;
|
||||
+
|
||||
+ int brightness = props->brightness;
|
||||
+
|
||||
+ if (dev->props.state & BL_CORE_FBBLANK) {
|
||||
+ brightness = 0;
|
||||
+ /* Set LEDOUT0 Register */
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x10);
|
||||
+ } else {
|
||||
+ /* Set LEDOUT0 Register */
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x30);
|
||||
+ }
|
||||
|
||||
tlc59108_bl_set_backlight(data, brightness);
|
||||
|
||||
@@ -77,7 +88,7 @@ static const struct backlight_ops bl_ops = {
|
||||
.update_status = tlc59108_bl_update_status,
|
||||
};
|
||||
|
||||
-static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id)
|
||||
+static int __devinit tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id)
|
||||
{
|
||||
struct backlight_properties props;
|
||||
struct tlc59108_bl *data = kzalloc(sizeof(struct tlc59108_bl),
|
||||
@@ -104,6 +115,11 @@ static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id)
|
||||
|
||||
backlight_update_status(data->bl);
|
||||
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00);
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, 0x80);
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT1, 0x05);
|
||||
+ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT1, 0x15);
|
||||
+
|
||||
return 0;
|
||||
|
||||
err_reg:
|
||||
@@ -125,7 +141,7 @@ static int tlc59108_remove(struct i2c_client *c)
|
||||
}
|
||||
|
||||
/* I2C Device ID table */
|
||||
-static const struct i2c_device_id tlc59108_id[] = {
|
||||
+static struct i2c_device_id tlc59108_id[] = {
|
||||
{ "tlc59108", 0 },
|
||||
{ }
|
||||
};
|
||||
@@ -134,12 +150,12 @@ MODULE_DEVICE_TABLE(i2c, tlc59108_id);
|
||||
/* I2C driver data */
|
||||
static struct i2c_driver tlc59108_driver = {
|
||||
.driver = {
|
||||
- .owner = THIS_MODULE,
|
||||
- .name = tlc59108_MODULE_NAME,
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .name = "tlc59108"
|
||||
},
|
||||
+ .id_table = tlc59108_id,
|
||||
.probe = tlc59108_probe,
|
||||
.remove = tlc59108_remove,
|
||||
- .id_table = tlc59108_id,
|
||||
};
|
||||
|
||||
static int __init tlc59108_init(void)
|
||||
@@ -157,4 +173,4 @@ module_exit(tlc59108_exit);
|
||||
|
||||
MODULE_DESCRIPTION("LCD/Backlight control for TLC59108");
|
||||
MODULE_AUTHOR("Senthil Natarajan <senthil.n@ti.com>");
|
||||
-MODULE_LICENSE("GPL v2");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
4280
recipes-kernel/linux/linux-mainline-3.2/beagleboard/defconfig
Normal file
4280
recipes-kernel/linux/linux-mainline-3.2/beagleboard/defconfig
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
From 810e3d05ec1e0f2a3c261d7e72bde9a0726b1a7d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Tue, 2 Nov 2010 09:59:09 -0500
|
||||
Subject: [PATCH] arm: omap: devkit8000: for lcd use samsung_lte_panel
|
||||
|
||||
This was noticed by Robert Skretkowicz
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-devkit8000.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
|
||||
index 90154e4..55760a0 100644
|
||||
--- a/arch/arm/mach-omap2/board-devkit8000.c
|
||||
+++ b/arch/arm/mach-omap2/board-devkit8000.c
|
||||
@@ -148,7 +148,7 @@ static struct panel_generic_dpi_data lcd_panel = {
|
||||
static struct omap_dss_device devkit8000_lcd_device = {
|
||||
.name = "lcd",
|
||||
.type = OMAP_DISPLAY_TYPE_DPI,
|
||||
- .driver_name = "generic_dpi_panel",
|
||||
+ .driver_name = "samsung_lte_panel",
|
||||
.data = &lcd_panel,
|
||||
.phy.dpi.data_lines = 24,
|
||||
};
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
From 4177460e5231895018005ac972ee11ef8c7a561f Mon Sep 17 00:00:00 2001
|
||||
From: Robert Gordon <robert@greenroomsoftware.com>
|
||||
Date: Wed, 13 Apr 2011 11:32:29 -0500
|
||||
Subject: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
|
||||
|
||||
scripts/package/builddeb script was setting the host machine
|
||||
$arch in the KERNEL/debian/control prior to an invocation of
|
||||
dpkg-gencontrol. The patch modifies the script to guarantee the correct
|
||||
debian arch for the target is written to the control file instead.
|
||||
|
||||
Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
scripts/package/builddeb | 70 +++++++++++++++++++++++----------------------
|
||||
1 files changed, 36 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
|
||||
index 3c6c0b1..2f86d7b 100644
|
||||
--- a/scripts/package/builddeb
|
||||
+++ b/scripts/package/builddeb
|
||||
@@ -26,37 +26,7 @@ create_package() {
|
||||
chmod -R go-w "$pdir"
|
||||
|
||||
# Attempt to find the correct Debian architecture
|
||||
- local forcearch="" debarch=""
|
||||
- case "$UTS_MACHINE" in
|
||||
- i386|ia64|alpha)
|
||||
- debarch="$UTS_MACHINE" ;;
|
||||
- x86_64)
|
||||
- debarch=amd64 ;;
|
||||
- sparc*)
|
||||
- debarch=sparc ;;
|
||||
- s390*)
|
||||
- debarch=s390 ;;
|
||||
- ppc*)
|
||||
- debarch=powerpc ;;
|
||||
- parisc*)
|
||||
- debarch=hppa ;;
|
||||
- mips*)
|
||||
- debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
|
||||
- arm*)
|
||||
- debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
|
||||
- *)
|
||||
- echo "" >&2
|
||||
- echo "** ** ** WARNING ** ** **" >&2
|
||||
- echo "" >&2
|
||||
- echo "Your architecture doesn't have it's equivalent" >&2
|
||||
- echo "Debian userspace architecture defined!" >&2
|
||||
- echo "Falling back to using your current userspace instead!" >&2
|
||||
- echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
|
||||
- echo "" >&2
|
||||
- esac
|
||||
- if [ -n "$KBUILD_DEBARCH" ] ; then
|
||||
- debarch="$KBUILD_DEBARCH"
|
||||
- fi
|
||||
+ local forcearch=""
|
||||
if [ -n "$debarch" ] ; then
|
||||
forcearch="-DArchitecture=$debarch"
|
||||
fi
|
||||
@@ -66,6 +36,38 @@ create_package() {
|
||||
dpkg --build "$pdir" ..
|
||||
}
|
||||
|
||||
+#Set the correct debian arch
|
||||
+case "$UTS_MACHINE" in
|
||||
+i386|ia64|alpha)
|
||||
+ debarch="$UTS_MACHINE" ;;
|
||||
+x86_64)
|
||||
+ debarch=amd64 ;;
|
||||
+sparc*)
|
||||
+ debarch=sparc ;;
|
||||
+s390*)
|
||||
+ debarch=s390 ;;
|
||||
+ppc*)
|
||||
+ debarch=powerpc ;;
|
||||
+parisc*)
|
||||
+ debarch=hppa ;;
|
||||
+mips*)
|
||||
+ debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
|
||||
+arm*)
|
||||
+ debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
|
||||
+*)
|
||||
+ echo "" >&2
|
||||
+ echo "** ** ** WARNING ** ** **" >&2
|
||||
+ echo "" >&2
|
||||
+ echo "Your architecture doesn't have it's equivalent" >&2
|
||||
+ echo "Debian userspace architecture defined!" >&2
|
||||
+ echo "Falling back to using your current userspace instead!" >&2
|
||||
+ echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
|
||||
+ echo "" >&2
|
||||
+esac
|
||||
+if [ -n "$KBUILD_DEBARCH" ] ; then
|
||||
+ debarch="$KBUILD_DEBARCH"
|
||||
+fi
|
||||
+
|
||||
# Some variables and settings used throughout the script
|
||||
version=$KERNELRELEASE
|
||||
revision=$(cat .version)
|
||||
@@ -252,9 +254,9 @@ cat <<EOF >> debian/control
|
||||
|
||||
Package: $kernel_headers_packagename
|
||||
Provides: linux-headers, linux-headers-2.6
|
||||
-Architecture: $arch
|
||||
-Description: Linux kernel headers for $KERNELRELEASE on $arch
|
||||
- This package provides kernel header files for $KERNELRELEASE on $arch
|
||||
+Architecture: $debarch
|
||||
+Description: Linux kernel headers for $KERNELRELEASE on $debarch
|
||||
+ This package provides kernel header files for $KERNELRELEASE on $debarch
|
||||
.
|
||||
This is useful for people who need to build external modules
|
||||
EOF
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 84ab8eddc3e2d590489cf413ee86b9f20564994e Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:35:01 -0500
|
||||
Subject: [PATCH 01/14] ksz8851 eeprom 93cx6 add drive_data
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/misc/eeprom/eeprom_93cx6.c | 3 +++
|
||||
include/linux/eeprom_93cx6.h | 2 ++
|
||||
2 files changed, 5 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/misc/eeprom/eeprom_93cx6.c b/drivers/misc/eeprom/eeprom_93cx6.c
|
||||
index 7b33de9..a6037af 100644
|
||||
--- a/drivers/misc/eeprom/eeprom_93cx6.c
|
||||
+++ b/drivers/misc/eeprom/eeprom_93cx6.c
|
||||
@@ -63,6 +63,7 @@ static void eeprom_93cx6_startup(struct eeprom_93cx6 *eeprom)
|
||||
eeprom->reg_data_out = 0;
|
||||
eeprom->reg_data_clock = 0;
|
||||
eeprom->reg_chip_select = 1;
|
||||
+ eeprom->drive_data = 1;
|
||||
eeprom->register_write(eeprom);
|
||||
|
||||
/*
|
||||
@@ -101,6 +102,7 @@ static void eeprom_93cx6_write_bits(struct eeprom_93cx6 *eeprom,
|
||||
*/
|
||||
eeprom->reg_data_in = 0;
|
||||
eeprom->reg_data_out = 0;
|
||||
+ eeprom->drive_data = 1;
|
||||
|
||||
/*
|
||||
* Start writing all bits.
|
||||
@@ -140,6 +142,7 @@ static void eeprom_93cx6_read_bits(struct eeprom_93cx6 *eeprom,
|
||||
*/
|
||||
eeprom->reg_data_in = 0;
|
||||
eeprom->reg_data_out = 0;
|
||||
+ eeprom->drive_data = 0;
|
||||
|
||||
/*
|
||||
* Start reading all bits.
|
||||
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h
|
||||
index c4627cb..e04546e 100644
|
||||
--- a/include/linux/eeprom_93cx6.h
|
||||
+++ b/include/linux/eeprom_93cx6.h
|
||||
@@ -46,6 +46,7 @@
|
||||
* @register_write(struct eeprom_93cx6 *eeprom): handler to
|
||||
* write to the eeprom register by using all reg_* fields.
|
||||
* @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
|
||||
+ * @drive_data: Set if we're driving the data line.
|
||||
* @reg_data_in: register field to indicate data input
|
||||
* @reg_data_out: register field to indicate data output
|
||||
* @reg_data_clock: register field to set the data clock
|
||||
@@ -62,6 +63,7 @@ struct eeprom_93cx6 {
|
||||
|
||||
int width;
|
||||
|
||||
+ char drive_data;
|
||||
char reg_data_in;
|
||||
char reg_data_out;
|
||||
char reg_data_clock;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
From cab9c276c954286c87db9aa7adc3c2cc3faaaf61 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:35:38 -0500
|
||||
Subject: [PATCH 02/14] ksz8851 eeprom 93cx6 add eeprom_93cx6_write
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/misc/eeprom/eeprom_93cx6.c | 86 ++++++++++++++++++++++++++++++++++++
|
||||
include/linux/eeprom_93cx6.h | 6 +++
|
||||
2 files changed, 92 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/misc/eeprom/eeprom_93cx6.c b/drivers/misc/eeprom/eeprom_93cx6.c
|
||||
index a6037af..77ca81f 100644
|
||||
--- a/drivers/misc/eeprom/eeprom_93cx6.c
|
||||
+++ b/drivers/misc/eeprom/eeprom_93cx6.c
|
||||
@@ -234,3 +234,89 @@ void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, const u8 word,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(eeprom_93cx6_multiread);
|
||||
|
||||
+
|
||||
+/**
|
||||
+ * eeprom_93cx6_wren - set the write enable state
|
||||
+ * @eeprom: Pointer to eeprom structure
|
||||
+ * @enable: true to enable writes, otherwise disable writes
|
||||
+ *
|
||||
+ * Set the EEPROM write enable state to either allow or deny
|
||||
+ * writes depending on the @enable value.
|
||||
+ */
|
||||
+void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable)
|
||||
+{
|
||||
+ u16 command;
|
||||
+
|
||||
+ /* start the command */
|
||||
+ eeprom_93cx6_startup(eeprom);
|
||||
+
|
||||
+ /* create command to enable/disable */
|
||||
+
|
||||
+ command = enable ? PCI_EEPROM_EWEN_OPCODE : PCI_EEPROM_EWDS_OPCODE;
|
||||
+ command <<= (eeprom->width - 2);
|
||||
+
|
||||
+ eeprom_93cx6_write_bits(eeprom, command,
|
||||
+ PCI_EEPROM_WIDTH_OPCODE + eeprom->width);
|
||||
+
|
||||
+ eeprom_93cx6_cleanup(eeprom);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(eeprom_93cx6_wren);
|
||||
+
|
||||
+/**
|
||||
+ * eeprom_93cx6_write - write data to the EEPROM
|
||||
+ * @eeprom: Pointer to eeprom structure
|
||||
+ * @addr: Address to write data to.
|
||||
+ * @data: The data to write to address @addr.
|
||||
+ *
|
||||
+ * Write the @data to the specified @addr in the EEPROM and
|
||||
+ * waiting for the device to finish writing.
|
||||
+ *
|
||||
+ * Note, since we do not expect large number of write operations
|
||||
+ * we use msleep() to delay in between parts of the operation to
|
||||
+ * avoid using excessive amounts of CPU time busy waiting.
|
||||
+ */
|
||||
+void eeprom_93cx6_write(struct eeprom_93cx6 *eeprom, u8 addr, u16 data)
|
||||
+{
|
||||
+ int timeout = 100;
|
||||
+ u16 command;
|
||||
+
|
||||
+ /* start the command */
|
||||
+ eeprom_93cx6_startup(eeprom);
|
||||
+
|
||||
+ command = PCI_EEPROM_WRITE_OPCODE << eeprom->width;
|
||||
+ command |= addr;
|
||||
+
|
||||
+ /* send write command */
|
||||
+ eeprom_93cx6_write_bits(eeprom, command,
|
||||
+ PCI_EEPROM_WIDTH_OPCODE + eeprom->width);
|
||||
+
|
||||
+ /* send data */
|
||||
+ eeprom_93cx6_write_bits(eeprom, data, 16);
|
||||
+
|
||||
+ /* get ready to check for busy */
|
||||
+ eeprom->drive_data = 0;
|
||||
+ eeprom->reg_chip_select = 1;
|
||||
+ eeprom->register_write(eeprom);
|
||||
+
|
||||
+ /* wait at-least 250ns to get DO to be the busy signal */
|
||||
+ msleep(1);
|
||||
+
|
||||
+ /* wait for DO to go high to signify finish */
|
||||
+
|
||||
+ while (true) {
|
||||
+ eeprom->register_read(eeprom);
|
||||
+
|
||||
+ if (eeprom->reg_data_out)
|
||||
+ break;
|
||||
+
|
||||
+ msleep(1);
|
||||
+
|
||||
+ if (--timeout <= 0) {
|
||||
+ printk(KERN_ERR "%s: timeout\n", __func__);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ eeprom_93cx6_cleanup(eeprom);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(eeprom_93cx6_write);
|
||||
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h
|
||||
index e04546e..e50f98b 100644
|
||||
--- a/include/linux/eeprom_93cx6.h
|
||||
+++ b/include/linux/eeprom_93cx6.h
|
||||
@@ -33,6 +33,7 @@
|
||||
#define PCI_EEPROM_WIDTH_93C86 8
|
||||
#define PCI_EEPROM_WIDTH_OPCODE 3
|
||||
#define PCI_EEPROM_WRITE_OPCODE 0x05
|
||||
+#define PCI_EEPROM_ERASE_OPCODE 0x07
|
||||
#define PCI_EEPROM_READ_OPCODE 0x06
|
||||
#define PCI_EEPROM_EWDS_OPCODE 0x10
|
||||
#define PCI_EEPROM_EWEN_OPCODE 0x13
|
||||
@@ -74,3 +75,8 @@ extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
|
||||
const u8 word, u16 *data);
|
||||
extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
|
||||
const u8 word, __le16 *data, const u16 words);
|
||||
+
|
||||
+extern void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable);
|
||||
+
|
||||
+extern void eeprom_93cx6_write(struct eeprom_93cx6 *eeprom,
|
||||
+ u8 addr, u16 data);
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
From 9318b0759a699e6128817bead791603201e73d99 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:36:22 -0500
|
||||
Subject: [PATCH 03/14] ksz8851 read_mac_addr
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 44 ++++++++++++++++++++++++++++-----
|
||||
1 files changed, 37 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index f56743a..da7cbea 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -367,21 +367,47 @@ static int ks8851_write_mac_addr(struct net_device *dev)
|
||||
}
|
||||
|
||||
/**
|
||||
+ * ks8851_read_mac_addr - read mac address from device registers
|
||||
+ * @dev: The network device
|
||||
+ *
|
||||
+ * Update our copy of the KS8851 MAC address from the registers of @dev.
|
||||
+*/
|
||||
+static void ks8851_read_mac_addr(struct net_device *dev)
|
||||
+{
|
||||
+ struct ks8851_net *ks = netdev_priv(dev);
|
||||
+ int i;
|
||||
+
|
||||
+ mutex_lock(&ks->lock);
|
||||
+
|
||||
+ for (i = 0; i < ETH_ALEN; i++)
|
||||
+ dev->dev_addr[i] = ks8851_rdreg8(ks, KS_MAR(i));
|
||||
+
|
||||
+ mutex_unlock(&ks->lock);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* ks8851_init_mac - initialise the mac address
|
||||
* @ks: The device structure
|
||||
*
|
||||
* Get or create the initial mac address for the device and then set that
|
||||
- * into the station address register. Currently we assume that the device
|
||||
- * does not have a valid mac address in it, and so we use random_ether_addr()
|
||||
+ * into the station address register. If there is an EEPROM present, then
|
||||
+ * we try that. If no valid mac address is found we use random_ether_addr()
|
||||
* to create a new one.
|
||||
- *
|
||||
- * In future, the driver should check to see if the device has an EEPROM
|
||||
- * attached and whether that has a valid ethernet address in it.
|
||||
*/
|
||||
static void ks8851_init_mac(struct ks8851_net *ks)
|
||||
{
|
||||
struct net_device *dev = ks->netdev;
|
||||
|
||||
+ /* first, try reading what we've got already */
|
||||
+ if (ks->rc_ccr & CCR_EEPROM) {
|
||||
+ ks8851_read_mac_addr(dev);
|
||||
+ if (is_valid_ether_addr(dev->dev_addr))
|
||||
+ return;
|
||||
+
|
||||
+ netdev_err(ks->netdev, "invalid mac address read %pM\n",
|
||||
+ dev->dev_addr);
|
||||
+ }
|
||||
+
|
||||
random_ether_addr(dev->dev_addr);
|
||||
ks8851_write_mac_addr(dev);
|
||||
}
|
||||
@@ -1658,6 +1684,9 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
else
|
||||
ks->eeprom_size = 0;
|
||||
|
||||
+ /* cache the contents of the CCR register for EEPROM, etc. */
|
||||
+ ks->rc_ccr = ks8851_rdreg16(ks, KS_CCR);
|
||||
+
|
||||
ks8851_read_selftest(ks);
|
||||
ks8851_init_mac(ks);
|
||||
|
||||
@@ -1674,9 +1703,10 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
goto err_netdev;
|
||||
}
|
||||
|
||||
- netdev_info(ndev, "revision %d, MAC %pM, IRQ %d\n",
|
||||
+ netdev_info(ndev, "revision %d, MAC %pM, IRQ %d %s EEPROM\n",
|
||||
CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)),
|
||||
- ndev->dev_addr, ndev->irq);
|
||||
+ ndev->dev_addr, ndev->irq,
|
||||
+ ks->rc_ccr & CCR_EEPROM ? "has" : "no");
|
||||
|
||||
return 0;
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
From 2b458e8bc6c07d7de20eb202c8f9c895dcf5ec6b Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:36:58 -0500
|
||||
Subject: [PATCH 04/14] ksz8851 93cx6 eeprom access
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/Kconfig | 1 +
|
||||
drivers/net/ethernet/micrel/ks8851.c | 72 ++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 73 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/Kconfig b/drivers/net/ethernet/micrel/Kconfig
|
||||
index d10c2e1..fe42fc0 100644
|
||||
--- a/drivers/net/ethernet/micrel/Kconfig
|
||||
+++ b/drivers/net/ethernet/micrel/Kconfig
|
||||
@@ -42,6 +42,7 @@ config KS8851
|
||||
select NET_CORE
|
||||
select MII
|
||||
select CRC32
|
||||
+ select EEPROM_93CX6
|
||||
---help---
|
||||
SPI driver for Micrel KS8851 SPI attached network chip.
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index da7cbea..6a7f27f 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <linux/cache.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/mii.h>
|
||||
+#include <linux/eeprom_93cx6.h>
|
||||
|
||||
#include <linux/spi/spi.h>
|
||||
|
||||
@@ -128,6 +129,8 @@ struct ks8851_net {
|
||||
struct spi_message spi_msg2;
|
||||
struct spi_transfer spi_xfer1;
|
||||
struct spi_transfer spi_xfer2[2];
|
||||
+
|
||||
+ struct eeprom_93cx6 eeprom;
|
||||
};
|
||||
|
||||
static int msg_enable;
|
||||
@@ -1449,6 +1452,68 @@ static int ks8851_set_eeprom(struct net_device *dev,
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
+/* EEPROM support */
|
||||
+
|
||||
+static void ks8851_eeprom_regread(struct eeprom_93cx6 *ee)
|
||||
+{
|
||||
+ struct ks8851_net *ks = ee->data;
|
||||
+ unsigned val;
|
||||
+
|
||||
+ val = ks8851_rdreg16(ks, KS_EEPCR);
|
||||
+
|
||||
+ ee->reg_data_out = (val & EEPCR_EESB) ? 1 : 0;
|
||||
+ ee->reg_data_clock = (val & EEPCR_EESCK) ? 1 : 0;
|
||||
+ ee->reg_chip_select = (val & EEPCR_EECS) ? 1 : 0;
|
||||
+}
|
||||
+
|
||||
+static void ks8851_eeprom_regwrite(struct eeprom_93cx6 *ee)
|
||||
+{
|
||||
+ struct ks8851_net *ks = ee->data;
|
||||
+ unsigned val = EEPCR_EESA; /* default - eeprom access on */
|
||||
+
|
||||
+ if (ee->drive_data)
|
||||
+ val |= EEPCR_EESRWA;
|
||||
+ if (ee->reg_data_in)
|
||||
+ val |= EEPCR_EEDO;
|
||||
+ if (ee->reg_data_clock)
|
||||
+ val |= EEPCR_EESCK;
|
||||
+ if (ee->reg_chip_select)
|
||||
+ val |= EEPCR_EECS;
|
||||
+
|
||||
+ printk(KERN_INFO "%s: wr %04x\n", __func__, val);
|
||||
+ ks8851_wrreg16(ks, KS_EEPCR, val);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * ks8851_eeprom_claim - claim device EEPROM and activate the interface
|
||||
+ * @ks: The network deice state.
|
||||
+ *
|
||||
+ * Check for the presence of an EEPROM, and then activate software access
|
||||
+ * to the device.
|
||||
+ */
|
||||
+static int ks8851_eeprom_claim(struct ks8851_net *ks)
|
||||
+{
|
||||
+ if (!(ks->rc_ccr & CCR_EEPROM))
|
||||
+ return -ENOENT;
|
||||
+
|
||||
+ /* start with clock low, cs high */
|
||||
+ ks8851_wrreg16(ks, KS_EEPCR, EEPCR_EESA | EEPCR_EECS);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * ks8851_eeprom_release - release the EEPROM interface
|
||||
+ * @ks: The device state
|
||||
+ *
|
||||
+ * Release the software access to the device EEPROM
|
||||
+ */
|
||||
+static void ks8851_eeprom_release(struct ks8851_net *ks)
|
||||
+{
|
||||
+ unsigned val = ks8851_rdreg16(ks, KS_EEPCR);
|
||||
+
|
||||
+ ks8851_wrreg16(ks, KS_EEPCR, val & ~EEPCR_EESA);
|
||||
+}
|
||||
+
|
||||
static const struct ethtool_ops ks8851_ethtool_ops = {
|
||||
.get_drvinfo = ks8851_get_drvinfo,
|
||||
.get_msglevel = ks8851_get_msglevel,
|
||||
@@ -1639,6 +1704,13 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
spi_message_add_tail(&ks->spi_xfer2[0], &ks->spi_msg2);
|
||||
spi_message_add_tail(&ks->spi_xfer2[1], &ks->spi_msg2);
|
||||
|
||||
+ /* setup EEPROM state */
|
||||
+
|
||||
+ ks->eeprom.data = ks;
|
||||
+ ks->eeprom.width = PCI_EEPROM_WIDTH_93C46;
|
||||
+ ks->eeprom.register_read = ks8851_eeprom_regread;
|
||||
+ ks->eeprom.register_write = ks8851_eeprom_regwrite;
|
||||
+
|
||||
/* setup mii state */
|
||||
ks->mii.dev = ndev;
|
||||
ks->mii.phy_id = 1,
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From a0aa9c88e27b160651f685945b42749a2a9e1a0a Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Wed, 5 Oct 2011 16:19:20 -0500
|
||||
Subject: [PATCH 05/14] ks8851.h it helps to include the include file
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
include/linux/ks8851.h | 23 +++++++++++++++++++++++
|
||||
1 files changed, 23 insertions(+), 0 deletions(-)
|
||||
create mode 100644 include/linux/ks8851.h
|
||||
|
||||
diff --git a/include/linux/ks8851.h b/include/linux/ks8851.h
|
||||
new file mode 100644
|
||||
index 0000000..c933688
|
||||
--- /dev/null
|
||||
+++ b/include/linux/ks8851.h
|
||||
@@ -0,0 +1,23 @@
|
||||
+/* include/linux/ks8851.h
|
||||
+ *
|
||||
+ * Platform specific configuration data for KS8851 driver.
|
||||
+ *
|
||||
+ * Copyright 2009 Simtec Electronics
|
||||
+ * http://www.simtec.co.uk/
|
||||
+ * Ben Dooks <ben@simtec.co.uk>
|
||||
+ *
|
||||
+ * 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.
|
||||
+ */
|
||||
+
|
||||
+/**
|
||||
+ * struct ks8851_pdata - platform specific configuration data
|
||||
+ * @irq_flags: The IRQ trigger flags to pass to request_irq().
|
||||
+ *
|
||||
+ * Platform specific configuration to be passed from board support
|
||||
+ * registering the spi device to the driver.
|
||||
+ */
|
||||
+struct ks8851_pdata {
|
||||
+ unsigned irq_flags;
|
||||
+};
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
From c3d2a211cfeec3d0af0a26603c66e10dd456dd36 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:37:48 -0500
|
||||
Subject: [PATCH 06/14] ksz8851 move to header
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851_mll.c | 263 +-----------------------------
|
||||
1 files changed, 5 insertions(+), 258 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
index d19c849..530b962 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
@@ -37,6 +37,8 @@
|
||||
#include <linux/slab.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
+#include "ks8851.h"
|
||||
+
|
||||
#define DRV_NAME "ks8851_mll"
|
||||
|
||||
static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
|
||||
@@ -45,165 +47,26 @@ static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
|
||||
#define TX_BUF_SIZE 2000
|
||||
#define RX_BUF_SIZE 2000
|
||||
|
||||
-#define KS_CCR 0x08
|
||||
-#define CCR_EEPROM (1 << 9)
|
||||
-#define CCR_SPI (1 << 8)
|
||||
#define CCR_8BIT (1 << 7)
|
||||
#define CCR_16BIT (1 << 6)
|
||||
#define CCR_32BIT (1 << 5)
|
||||
#define CCR_SHARED (1 << 4)
|
||||
-#define CCR_32PIN (1 << 0)
|
||||
-
|
||||
-/* MAC address registers */
|
||||
-#define KS_MARL 0x10
|
||||
-#define KS_MARM 0x12
|
||||
-#define KS_MARH 0x14
|
||||
|
||||
-#define KS_OBCR 0x20
|
||||
#define OBCR_ODS_16MA (1 << 6)
|
||||
|
||||
-#define KS_EEPCR 0x22
|
||||
-#define EEPCR_EESA (1 << 4)
|
||||
-#define EEPCR_EESB (1 << 3)
|
||||
-#define EEPCR_EEDO (1 << 2)
|
||||
-#define EEPCR_EESCK (1 << 1)
|
||||
-#define EEPCR_EECS (1 << 0)
|
||||
-
|
||||
-#define KS_MBIR 0x24
|
||||
-#define MBIR_TXMBF (1 << 12)
|
||||
-#define MBIR_TXMBFA (1 << 11)
|
||||
-#define MBIR_RXMBF (1 << 4)
|
||||
-#define MBIR_RXMBFA (1 << 3)
|
||||
-
|
||||
-#define KS_GRR 0x26
|
||||
-#define GRR_QMU (1 << 1)
|
||||
-#define GRR_GSR (1 << 0)
|
||||
-
|
||||
-#define KS_WFCR 0x2A
|
||||
-#define WFCR_MPRXE (1 << 7)
|
||||
-#define WFCR_WF3E (1 << 3)
|
||||
-#define WFCR_WF2E (1 << 2)
|
||||
-#define WFCR_WF1E (1 << 1)
|
||||
-#define WFCR_WF0E (1 << 0)
|
||||
-
|
||||
-#define KS_WF0CRC0 0x30
|
||||
-#define KS_WF0CRC1 0x32
|
||||
-#define KS_WF0BM0 0x34
|
||||
-#define KS_WF0BM1 0x36
|
||||
-#define KS_WF0BM2 0x38
|
||||
-#define KS_WF0BM3 0x3A
|
||||
-
|
||||
-#define KS_WF1CRC0 0x40
|
||||
-#define KS_WF1CRC1 0x42
|
||||
-#define KS_WF1BM0 0x44
|
||||
-#define KS_WF1BM1 0x46
|
||||
-#define KS_WF1BM2 0x48
|
||||
-#define KS_WF1BM3 0x4A
|
||||
-
|
||||
-#define KS_WF2CRC0 0x50
|
||||
-#define KS_WF2CRC1 0x52
|
||||
-#define KS_WF2BM0 0x54
|
||||
-#define KS_WF2BM1 0x56
|
||||
-#define KS_WF2BM2 0x58
|
||||
-#define KS_WF2BM3 0x5A
|
||||
-
|
||||
-#define KS_WF3CRC0 0x60
|
||||
-#define KS_WF3CRC1 0x62
|
||||
-#define KS_WF3BM0 0x64
|
||||
-#define KS_WF3BM1 0x66
|
||||
-#define KS_WF3BM2 0x68
|
||||
-#define KS_WF3BM3 0x6A
|
||||
-
|
||||
-#define KS_TXCR 0x70
|
||||
-#define TXCR_TCGICMP (1 << 8)
|
||||
-#define TXCR_TCGUDP (1 << 7)
|
||||
-#define TXCR_TCGTCP (1 << 6)
|
||||
-#define TXCR_TCGIP (1 << 5)
|
||||
-#define TXCR_FTXQ (1 << 4)
|
||||
-#define TXCR_TXFCE (1 << 3)
|
||||
-#define TXCR_TXPE (1 << 2)
|
||||
-#define TXCR_TXCRC (1 << 1)
|
||||
-#define TXCR_TXE (1 << 0)
|
||||
-
|
||||
-#define KS_TXSR 0x72
|
||||
-#define TXSR_TXLC (1 << 13)
|
||||
-#define TXSR_TXMC (1 << 12)
|
||||
-#define TXSR_TXFID_MASK (0x3f << 0)
|
||||
-#define TXSR_TXFID_SHIFT (0)
|
||||
-#define TXSR_TXFID_GET(_v) (((_v) >> 0) & 0x3f)
|
||||
-
|
||||
-
|
||||
-#define KS_RXCR1 0x74
|
||||
-#define RXCR1_FRXQ (1 << 15)
|
||||
-#define RXCR1_RXUDPFCC (1 << 14)
|
||||
-#define RXCR1_RXTCPFCC (1 << 13)
|
||||
-#define RXCR1_RXIPFCC (1 << 12)
|
||||
-#define RXCR1_RXPAFMA (1 << 11)
|
||||
-#define RXCR1_RXFCE (1 << 10)
|
||||
-#define RXCR1_RXEFE (1 << 9)
|
||||
-#define RXCR1_RXMAFMA (1 << 8)
|
||||
-#define RXCR1_RXBE (1 << 7)
|
||||
-#define RXCR1_RXME (1 << 6)
|
||||
-#define RXCR1_RXUE (1 << 5)
|
||||
-#define RXCR1_RXAE (1 << 4)
|
||||
-#define RXCR1_RXINVF (1 << 1)
|
||||
-#define RXCR1_RXE (1 << 0)
|
||||
#define RXCR1_FILTER_MASK (RXCR1_RXINVF | RXCR1_RXAE | \
|
||||
RXCR1_RXMAFMA | RXCR1_RXPAFMA)
|
||||
|
||||
-#define KS_RXCR2 0x76
|
||||
-#define RXCR2_SRDBL_MASK (0x7 << 5)
|
||||
-#define RXCR2_SRDBL_SHIFT (5)
|
||||
-#define RXCR2_SRDBL_4B (0x0 << 5)
|
||||
-#define RXCR2_SRDBL_8B (0x1 << 5)
|
||||
-#define RXCR2_SRDBL_16B (0x2 << 5)
|
||||
-#define RXCR2_SRDBL_32B (0x3 << 5)
|
||||
-/* #define RXCR2_SRDBL_FRAME (0x4 << 5) */
|
||||
-#define RXCR2_IUFFP (1 << 4)
|
||||
-#define RXCR2_RXIUFCEZ (1 << 3)
|
||||
-#define RXCR2_UDPLFE (1 << 2)
|
||||
-#define RXCR2_RXICMPFCC (1 << 1)
|
||||
-#define RXCR2_RXSAF (1 << 0)
|
||||
-
|
||||
-#define KS_TXMIR 0x78
|
||||
-
|
||||
-#define KS_RXFHSR 0x7C
|
||||
-#define RXFSHR_RXFV (1 << 15)
|
||||
-#define RXFSHR_RXICMPFCS (1 << 13)
|
||||
-#define RXFSHR_RXIPFCS (1 << 12)
|
||||
-#define RXFSHR_RXTCPFCS (1 << 11)
|
||||
-#define RXFSHR_RXUDPFCS (1 << 10)
|
||||
-#define RXFSHR_RXBF (1 << 7)
|
||||
-#define RXFSHR_RXMF (1 << 6)
|
||||
-#define RXFSHR_RXUF (1 << 5)
|
||||
-#define RXFSHR_RXMR (1 << 4)
|
||||
-#define RXFSHR_RXFT (1 << 3)
|
||||
-#define RXFSHR_RXFTL (1 << 2)
|
||||
-#define RXFSHR_RXRF (1 << 1)
|
||||
-#define RXFSHR_RXCE (1 << 0)
|
||||
+#undef RXCR2_SRDBL_FRAME
|
||||
+
|
||||
#define RXFSHR_ERR (RXFSHR_RXCE | RXFSHR_RXRF |\
|
||||
RXFSHR_RXFTL | RXFSHR_RXMR |\
|
||||
RXFSHR_RXICMPFCS | RXFSHR_RXIPFCS |\
|
||||
RXFSHR_RXTCPFCS)
|
||||
+
|
||||
#define KS_RXFHBCR 0x7E
|
||||
#define RXFHBCR_CNT_MASK 0x0FFF
|
||||
|
||||
-#define KS_TXQCR 0x80
|
||||
-#define TXQCR_AETFE (1 << 2)
|
||||
-#define TXQCR_TXQMAM (1 << 1)
|
||||
-#define TXQCR_METFE (1 << 0)
|
||||
-
|
||||
-#define KS_RXQCR 0x82
|
||||
-#define RXQCR_RXDTTS (1 << 12)
|
||||
-#define RXQCR_RXDBCTS (1 << 11)
|
||||
-#define RXQCR_RXFCTS (1 << 10)
|
||||
-#define RXQCR_RXIPHTOE (1 << 9)
|
||||
-#define RXQCR_RXDTTE (1 << 7)
|
||||
-#define RXQCR_RXDBCTE (1 << 6)
|
||||
-#define RXQCR_RXFCTE (1 << 5)
|
||||
-#define RXQCR_ADRFE (1 << 4)
|
||||
-#define RXQCR_SDA (1 << 3)
|
||||
-#define RXQCR_RRXEF (1 << 0)
|
||||
#define RXQCR_CMD_CNTL (RXQCR_RXFCTE|RXQCR_ADRFE)
|
||||
|
||||
#define KS_TXFDPR 0x84
|
||||
@@ -214,130 +77,14 @@ static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
|
||||
#define KS_RXFDPR 0x86
|
||||
#define RXFDPR_RXFPAI (1 << 14)
|
||||
|
||||
-#define KS_RXDTTR 0x8C
|
||||
-#define KS_RXDBCTR 0x8E
|
||||
-
|
||||
-#define KS_IER 0x90
|
||||
-#define KS_ISR 0x92
|
||||
-#define IRQ_LCI (1 << 15)
|
||||
-#define IRQ_TXI (1 << 14)
|
||||
-#define IRQ_RXI (1 << 13)
|
||||
-#define IRQ_RXOI (1 << 11)
|
||||
-#define IRQ_TXPSI (1 << 9)
|
||||
-#define IRQ_RXPSI (1 << 8)
|
||||
-#define IRQ_TXSAI (1 << 6)
|
||||
-#define IRQ_RXWFDI (1 << 5)
|
||||
-#define IRQ_RXMPDI (1 << 4)
|
||||
-#define IRQ_LDI (1 << 3)
|
||||
-#define IRQ_EDI (1 << 2)
|
||||
-#define IRQ_SPIBEI (1 << 1)
|
||||
-#define IRQ_DEDI (1 << 0)
|
||||
-
|
||||
-#define KS_RXFCTR 0x9C
|
||||
#define RXFCTR_THRESHOLD_MASK 0x00FF
|
||||
|
||||
-#define KS_RXFC 0x9D
|
||||
-#define RXFCTR_RXFC_MASK (0xff << 8)
|
||||
-#define RXFCTR_RXFC_SHIFT (8)
|
||||
-#define RXFCTR_RXFC_GET(_v) (((_v) >> 8) & 0xff)
|
||||
-#define RXFCTR_RXFCT_MASK (0xff << 0)
|
||||
-#define RXFCTR_RXFCT_SHIFT (0)
|
||||
-
|
||||
-#define KS_TXNTFSR 0x9E
|
||||
-
|
||||
-#define KS_MAHTR0 0xA0
|
||||
-#define KS_MAHTR1 0xA2
|
||||
-#define KS_MAHTR2 0xA4
|
||||
-#define KS_MAHTR3 0xA6
|
||||
-
|
||||
-#define KS_FCLWR 0xB0
|
||||
-#define KS_FCHWR 0xB2
|
||||
-#define KS_FCOWR 0xB4
|
||||
-
|
||||
-#define KS_CIDER 0xC0
|
||||
-#define CIDER_ID 0x8870
|
||||
-#define CIDER_REV_MASK (0x7 << 1)
|
||||
-#define CIDER_REV_SHIFT (1)
|
||||
-#define CIDER_REV_GET(_v) (((_v) >> 1) & 0x7)
|
||||
-
|
||||
-#define KS_CGCR 0xC6
|
||||
-#define KS_IACR 0xC8
|
||||
-#define IACR_RDEN (1 << 12)
|
||||
-#define IACR_TSEL_MASK (0x3 << 10)
|
||||
-#define IACR_TSEL_SHIFT (10)
|
||||
-#define IACR_TSEL_MIB (0x3 << 10)
|
||||
-#define IACR_ADDR_MASK (0x1f << 0)
|
||||
-#define IACR_ADDR_SHIFT (0)
|
||||
-
|
||||
-#define KS_IADLR 0xD0
|
||||
-#define KS_IAHDR 0xD2
|
||||
-
|
||||
-#define KS_PMECR 0xD4
|
||||
-#define PMECR_PME_DELAY (1 << 14)
|
||||
-#define PMECR_PME_POL (1 << 12)
|
||||
-#define PMECR_WOL_WAKEUP (1 << 11)
|
||||
-#define PMECR_WOL_MAGICPKT (1 << 10)
|
||||
-#define PMECR_WOL_LINKUP (1 << 9)
|
||||
-#define PMECR_WOL_ENERGY (1 << 8)
|
||||
-#define PMECR_AUTO_WAKE_EN (1 << 7)
|
||||
-#define PMECR_WAKEUP_NORMAL (1 << 6)
|
||||
-#define PMECR_WKEVT_MASK (0xf << 2)
|
||||
-#define PMECR_WKEVT_SHIFT (2)
|
||||
-#define PMECR_WKEVT_GET(_v) (((_v) >> 2) & 0xf)
|
||||
-#define PMECR_WKEVT_ENERGY (0x1 << 2)
|
||||
-#define PMECR_WKEVT_LINK (0x2 << 2)
|
||||
-#define PMECR_WKEVT_MAGICPKT (0x4 << 2)
|
||||
-#define PMECR_WKEVT_FRAME (0x8 << 2)
|
||||
-#define PMECR_PM_MASK (0x3 << 0)
|
||||
-#define PMECR_PM_SHIFT (0)
|
||||
-#define PMECR_PM_NORMAL (0x0 << 0)
|
||||
-#define PMECR_PM_ENERGY (0x1 << 0)
|
||||
-#define PMECR_PM_SOFTDOWN (0x2 << 0)
|
||||
-#define PMECR_PM_POWERSAVE (0x3 << 0)
|
||||
-
|
||||
-/* Standard MII PHY data */
|
||||
-#define KS_P1MBCR 0xE4
|
||||
#define P1MBCR_FORCE_FDX (1 << 8)
|
||||
|
||||
-#define KS_P1MBSR 0xE6
|
||||
#define P1MBSR_AN_COMPLETE (1 << 5)
|
||||
#define P1MBSR_AN_CAPABLE (1 << 3)
|
||||
#define P1MBSR_LINK_UP (1 << 2)
|
||||
|
||||
-#define KS_PHY1ILR 0xE8
|
||||
-#define KS_PHY1IHR 0xEA
|
||||
-#define KS_P1ANAR 0xEC
|
||||
-#define KS_P1ANLPR 0xEE
|
||||
-
|
||||
-#define KS_P1SCLMD 0xF4
|
||||
-#define P1SCLMD_LEDOFF (1 << 15)
|
||||
-#define P1SCLMD_TXIDS (1 << 14)
|
||||
-#define P1SCLMD_RESTARTAN (1 << 13)
|
||||
-#define P1SCLMD_DISAUTOMDIX (1 << 10)
|
||||
-#define P1SCLMD_FORCEMDIX (1 << 9)
|
||||
-#define P1SCLMD_AUTONEGEN (1 << 7)
|
||||
-#define P1SCLMD_FORCE100 (1 << 6)
|
||||
-#define P1SCLMD_FORCEFDX (1 << 5)
|
||||
-#define P1SCLMD_ADV_FLOW (1 << 4)
|
||||
-#define P1SCLMD_ADV_100BT_FDX (1 << 3)
|
||||
-#define P1SCLMD_ADV_100BT_HDX (1 << 2)
|
||||
-#define P1SCLMD_ADV_10BT_FDX (1 << 1)
|
||||
-#define P1SCLMD_ADV_10BT_HDX (1 << 0)
|
||||
-
|
||||
-#define KS_P1CR 0xF6
|
||||
-#define P1CR_HP_MDIX (1 << 15)
|
||||
-#define P1CR_REV_POL (1 << 13)
|
||||
-#define P1CR_OP_100M (1 << 10)
|
||||
-#define P1CR_OP_FDX (1 << 9)
|
||||
-#define P1CR_OP_MDI (1 << 7)
|
||||
-#define P1CR_AN_DONE (1 << 6)
|
||||
-#define P1CR_LINK_GOOD (1 << 5)
|
||||
-#define P1CR_PNTR_FLOW (1 << 4)
|
||||
-#define P1CR_PNTR_100BT_FDX (1 << 3)
|
||||
-#define P1CR_PNTR_100BT_HDX (1 << 2)
|
||||
-#define P1CR_PNTR_10BT_FDX (1 << 1)
|
||||
-#define P1CR_PNTR_10BT_HDX (1 << 0)
|
||||
-
|
||||
/* TX Frame control */
|
||||
|
||||
#define TXFR_TXIC (1 << 15)
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
From 5b4881326fe4509fd2a55e866a11f9123745d2a8 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:38:35 -0500
|
||||
Subject: [PATCH 07/14] ksz8851 move more to header
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.h | 27 ++++++++++++++++++++
|
||||
drivers/net/ethernet/micrel/ks8851_mll.c | 40 +-----------------------------
|
||||
2 files changed, 28 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.h b/drivers/net/ethernet/micrel/ks8851.h
|
||||
index 537fb06e..1ed7cfa 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.h
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.h
|
||||
@@ -3,6 +3,9 @@
|
||||
* Copyright 2009 Simtec Electronics
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
+ * portions from drivers/net/ks8851_mll.c,
|
||||
+ * Copyright (c) 2009 Micrel Inc.
|
||||
+ *
|
||||
* KS8851 register definitions
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -13,6 +16,10 @@
|
||||
#define KS_CCR 0x08
|
||||
#define CCR_EEPROM (1 << 9)
|
||||
#define CCR_SPI (1 << 8)
|
||||
+#define CCR_8BIT (1 << 7)
|
||||
+#define CCR_16BIT (1 << 6)
|
||||
+#define CCR_32BIT (1 << 5)
|
||||
+#define CCR_SHARED (1 << 4)
|
||||
#define CCR_32PIN (1 << 0)
|
||||
|
||||
/* MAC address registers */
|
||||
@@ -261,7 +268,13 @@
|
||||
|
||||
/* Standard MII PHY data */
|
||||
#define KS_P1MBCR 0xE4
|
||||
+#define P1MBCR_FORCE_FDX (1 << 8)
|
||||
+
|
||||
#define KS_P1MBSR 0xE6
|
||||
+#define P1MBSR_AN_COMPLETE (1 << 5)
|
||||
+#define P1MBSR_AN_CAPABLE (1 << 3)
|
||||
+#define P1MBSR_LINK_UP (1 << 2)
|
||||
+
|
||||
#define KS_PHY1ILR 0xE8
|
||||
#define KS_PHY1IHR 0xEA
|
||||
#define KS_P1ANAR 0xEC
|
||||
@@ -296,6 +309,20 @@
|
||||
#define P1CR_PNTR_10BT_FDX (1 << 1)
|
||||
#define P1CR_PNTR_10BT_HDX (1 << 0)
|
||||
|
||||
+#define KS_P1SR 0xF8
|
||||
+#define P1SR_HP_MDIX (1 << 15)
|
||||
+#define P1SR_REV_POL (1 << 13)
|
||||
+#define P1SR_OP_100M (1 << 10)
|
||||
+#define P1SR_OP_FDX (1 << 9)
|
||||
+#define P1SR_OP_MDI (1 << 7)
|
||||
+#define P1SR_AN_DONE (1 << 6)
|
||||
+#define P1SR_LINK_GOOD (1 << 5)
|
||||
+#define P1SR_PNTR_FLOW (1 << 4)
|
||||
+#define P1SR_PNTR_100BT_FDX (1 << 3)
|
||||
+#define P1SR_PNTR_100BT_HDX (1 << 2)
|
||||
+#define P1SR_PNTR_10BT_FDX (1 << 1)
|
||||
+#define P1SR_PNTR_10BT_HDX (1 << 0)
|
||||
+
|
||||
/* TX Frame control */
|
||||
|
||||
#define TXFR_TXIC (1 << 15)
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
index 530b962..d3bb46f 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
@@ -47,13 +47,6 @@ static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
|
||||
#define TX_BUF_SIZE 2000
|
||||
#define RX_BUF_SIZE 2000
|
||||
|
||||
-#define CCR_8BIT (1 << 7)
|
||||
-#define CCR_16BIT (1 << 6)
|
||||
-#define CCR_32BIT (1 << 5)
|
||||
-#define CCR_SHARED (1 << 4)
|
||||
-
|
||||
-#define OBCR_ODS_16MA (1 << 6)
|
||||
-
|
||||
#define RXCR1_FILTER_MASK (RXCR1_RXINVF | RXCR1_RXAE | \
|
||||
RXCR1_RXMAFMA | RXCR1_RXPAFMA)
|
||||
|
||||
@@ -69,41 +62,10 @@ static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
|
||||
|
||||
#define RXQCR_CMD_CNTL (RXQCR_RXFCTE|RXQCR_ADRFE)
|
||||
|
||||
-#define KS_TXFDPR 0x84
|
||||
-#define TXFDPR_TXFPAI (1 << 14)
|
||||
-#define TXFDPR_TXFP_MASK (0x7ff << 0)
|
||||
-#define TXFDPR_TXFP_SHIFT (0)
|
||||
-
|
||||
-#define KS_RXFDPR 0x86
|
||||
-#define RXFDPR_RXFPAI (1 << 14)
|
||||
-
|
||||
#define RXFCTR_THRESHOLD_MASK 0x00FF
|
||||
|
||||
-#define P1MBCR_FORCE_FDX (1 << 8)
|
||||
-
|
||||
-#define P1MBSR_AN_COMPLETE (1 << 5)
|
||||
-#define P1MBSR_AN_CAPABLE (1 << 3)
|
||||
-#define P1MBSR_LINK_UP (1 << 2)
|
||||
-
|
||||
/* TX Frame control */
|
||||
|
||||
-#define TXFR_TXIC (1 << 15)
|
||||
-#define TXFR_TXFID_MASK (0x3f << 0)
|
||||
-#define TXFR_TXFID_SHIFT (0)
|
||||
-
|
||||
-#define KS_P1SR 0xF8
|
||||
-#define P1SR_HP_MDIX (1 << 15)
|
||||
-#define P1SR_REV_POL (1 << 13)
|
||||
-#define P1SR_OP_100M (1 << 10)
|
||||
-#define P1SR_OP_FDX (1 << 9)
|
||||
-#define P1SR_OP_MDI (1 << 7)
|
||||
-#define P1SR_AN_DONE (1 << 6)
|
||||
-#define P1SR_LINK_GOOD (1 << 5)
|
||||
-#define P1SR_PNTR_FLOW (1 << 4)
|
||||
-#define P1SR_PNTR_100BT_FDX (1 << 3)
|
||||
-#define P1SR_PNTR_100BT_HDX (1 << 2)
|
||||
-#define P1SR_PNTR_10BT_FDX (1 << 1)
|
||||
-#define P1SR_PNTR_10BT_HDX (1 << 0)
|
||||
|
||||
#define ENUM_BUS_NONE 0
|
||||
#define ENUM_BUS_8BIT 1
|
||||
@@ -1350,7 +1312,7 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
|
||||
memcpy(netdev->dev_addr, ks->mac_addr, 6);
|
||||
|
||||
data = ks_rdreg16(ks, KS_OBCR);
|
||||
- ks_wrreg16(ks, KS_OBCR, data | OBCR_ODS_16MA);
|
||||
+ ks_wrreg16(ks, KS_OBCR, data | OBCR_ODS_16mA);
|
||||
|
||||
/**
|
||||
* If you want to use the default MAC addr,
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
From bd69d174b8ae6f720c8534db5dd4a55f2170f06c Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:49:16 -0500
|
||||
Subject: [PATCH 08/14] ksz8851 share ks8851_tx_hdr union
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 13 -------------
|
||||
drivers/net/ethernet/micrel/ks8851.h | 14 ++++++++++++++
|
||||
drivers/net/ethernet/micrel/ks8851_mll.c | 16 +---------------
|
||||
3 files changed, 15 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index 6a7f27f..64be436 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -46,19 +46,6 @@ struct ks8851_rxctrl {
|
||||
u16 rxcr2;
|
||||
};
|
||||
|
||||
-/**
|
||||
- * union ks8851_tx_hdr - tx header data
|
||||
- * @txb: The header as bytes
|
||||
- * @txw: The header as 16bit, little-endian words
|
||||
- *
|
||||
- * A dual representation of the tx header data to allow
|
||||
- * access to individual bytes, and to allow 16bit accesses
|
||||
- * with 16bit alignment.
|
||||
- */
|
||||
-union ks8851_tx_hdr {
|
||||
- u8 txb[6];
|
||||
- __le16 txw[3];
|
||||
-};
|
||||
|
||||
/**
|
||||
* struct ks8851_net - KS8851 driver private data
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.h b/drivers/net/ethernet/micrel/ks8851.h
|
||||
index 1ed7cfa..bc2476e 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.h
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.h
|
||||
@@ -334,3 +334,17 @@
|
||||
#define KS_SPIOP_WR (0x40)
|
||||
#define KS_SPIOP_RXFIFO (0x80)
|
||||
#define KS_SPIOP_TXFIFO (0xC0)
|
||||
+
|
||||
+/**
|
||||
+ * union ks8851_tx_hdr - tx header data
|
||||
+ * @txb: The header as bytes
|
||||
+ * @txw: The header as 16bit, little-endian words
|
||||
+ *
|
||||
+ * A dual representation of the tx header data to allow
|
||||
+ * access to individual bytes, and to allow 16bit accesses
|
||||
+ * with 16bit alignment.
|
||||
+ */
|
||||
+union ks8851_tx_hdr {
|
||||
+ u8 txb[6];
|
||||
+ __le16 txw[3];
|
||||
+};
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
index d3bb46f..ffaf14e 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
|
||||
@@ -76,20 +76,6 @@ static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
|
||||
#define HW_MCAST_SIZE 8
|
||||
|
||||
/**
|
||||
- * union ks_tx_hdr - tx header data
|
||||
- * @txb: The header as bytes
|
||||
- * @txw: The header as 16bit, little-endian words
|
||||
- *
|
||||
- * A dual representation of the tx header data to allow
|
||||
- * access to individual bytes, and to allow 16bit accesses
|
||||
- * with 16bit alignment.
|
||||
- */
|
||||
-union ks_tx_hdr {
|
||||
- u8 txb[4];
|
||||
- __le16 txw[2];
|
||||
-};
|
||||
-
|
||||
-/**
|
||||
* struct ks_net - KS8851 driver private data
|
||||
* @net_device : The network device we're bound to
|
||||
* @hw_addr : start address of data register.
|
||||
@@ -141,7 +127,7 @@ struct ks_net {
|
||||
struct net_device *netdev;
|
||||
void __iomem *hw_addr;
|
||||
void __iomem *hw_addr_cmd;
|
||||
- union ks_tx_hdr txh ____cacheline_aligned;
|
||||
+ union ks8851_tx_hdr txh ____cacheline_aligned;
|
||||
struct mutex lock; /* spinlock to be interrupt safe */
|
||||
struct platform_device *pdev;
|
||||
struct mii_if_info mii;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
From 390e80215217f32c35c7a2d6611407b759d695d2 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:50:09 -0500
|
||||
Subject: [PATCH 09/14] ksz8851 add is_level_irq
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 28 ++++++++++++++++++++++++----
|
||||
1 files changed, 24 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index 64be436..f771fd8 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/mii.h>
|
||||
#include <linux/eeprom_93cx6.h>
|
||||
+#include <linux/ks8851.h>
|
||||
|
||||
#include <linux/spi/spi.h>
|
||||
|
||||
@@ -70,6 +71,7 @@ struct ks8851_rxctrl {
|
||||
* @rc_ccr: Cached copy of KS_CCR.
|
||||
* @rc_rxqcr: Cached copy of KS_RXQCR.
|
||||
* @eeprom_size: Companion eeprom size in Bytes, 0 if no eeprom
|
||||
+ * @irq_flags: The IRQ flags passed to request_irq().
|
||||
*
|
||||
* The @lock ensures that the chip is protected when certain operations are
|
||||
* in progress. When the read or write packet transfer is in progress, most
|
||||
@@ -118,6 +120,7 @@ struct ks8851_net {
|
||||
struct spi_transfer spi_xfer2[2];
|
||||
|
||||
struct eeprom_93cx6 eeprom;
|
||||
+ unsigned irq_flags;
|
||||
};
|
||||
|
||||
static int msg_enable;
|
||||
@@ -403,6 +406,15 @@ static void ks8851_init_mac(struct ks8851_net *ks)
|
||||
}
|
||||
|
||||
/**
|
||||
+ * is_level_irq() - return if the given IRQ flags are level triggered
|
||||
+ * @flags: The flags passed to request_irq().
|
||||
+*/
|
||||
+static bool is_level_irq(unsigned flags)
|
||||
+{
|
||||
+ return flags & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_HIGH);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* ks8851_irq - device interrupt handler
|
||||
* @irq: Interrupt number passed from the IRQ hnalder.
|
||||
* @pw: The private word passed to register_irq(), our struct ks8851_net.
|
||||
@@ -414,7 +426,9 @@ static irqreturn_t ks8851_irq(int irq, void *pw)
|
||||
{
|
||||
struct ks8851_net *ks = pw;
|
||||
|
||||
- disable_irq_nosync(irq);
|
||||
+ if (is_level_irq(ks->irq_flags))
|
||||
+ disable_irq_nosync(irq);
|
||||
+
|
||||
schedule_work(&ks->irq_work);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -646,7 +660,8 @@ static void ks8851_irq_work(struct work_struct *work)
|
||||
if (status & IRQ_TXI)
|
||||
netif_wake_queue(ks->netdev);
|
||||
|
||||
- enable_irq(ks->netdev->irq);
|
||||
+ if (is_level_irq(ks->irq_flags))
|
||||
+ enable_irq(ks->netdev->irq);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1657,6 +1672,7 @@ static int ks8851_resume(struct spi_device *spi)
|
||||
|
||||
static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
{
|
||||
+ struct ks8851_pdata *pd = spi->dev.platform_data;
|
||||
struct net_device *ndev;
|
||||
struct ks8851_net *ks;
|
||||
int ret;
|
||||
@@ -1749,8 +1765,12 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
ks8851_read_selftest(ks);
|
||||
ks8851_init_mac(ks);
|
||||
|
||||
- ret = request_irq(spi->irq, ks8851_irq, IRQF_TRIGGER_LOW,
|
||||
- ndev->name, ks);
|
||||
+ if (pd && pd->irq_flags)
|
||||
+ ks->irq_flags = pd->irq_flags;
|
||||
+ else
|
||||
+ ks->irq_flags = IRQF_TRIGGER_LOW;
|
||||
+
|
||||
+ ret = request_irq(spi->irq, ks8851_irq, ks->irq_flags, ndev->name, ks);
|
||||
if (ret < 0) {
|
||||
dev_err(&spi->dev, "failed to get irq\n");
|
||||
goto err_irq;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From bd5cf7c6157fb20e70e8bdc417b98d0ae81e56eb Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:50:42 -0500
|
||||
Subject: [PATCH 10/14] ksz8851 turn off hardware interrupt druing receive
|
||||
process
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 10 ++++++++++
|
||||
1 files changed, 10 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index f771fd8..347f38f 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -586,6 +586,13 @@ static void ks8851_irq_work(struct work_struct *work)
|
||||
|
||||
mutex_lock(&ks->lock);
|
||||
|
||||
+ /*
|
||||
+ * Turn off hardware interrupt during receive processing. This fixes
|
||||
+ * the receive problem under heavy TCP traffic while transmit done
|
||||
+ * is enabled.
|
||||
+ */
|
||||
+ ks8851_wrreg16(ks, KS_IER, 0);
|
||||
+
|
||||
status = ks8851_rdreg16(ks, KS_ISR);
|
||||
|
||||
netif_dbg(ks, intr, ks->netdev,
|
||||
@@ -655,6 +662,9 @@ static void ks8851_irq_work(struct work_struct *work)
|
||||
ks8851_wrreg16(ks, KS_RXCR1, rxc->rxcr1);
|
||||
}
|
||||
|
||||
+ /* Re-enable hardware interrupt. */
|
||||
+ ks8851_wrreg16(ks, KS_IER, ks->rc_ier);
|
||||
+
|
||||
mutex_unlock(&ks->lock);
|
||||
|
||||
if (status & IRQ_TXI)
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From c7f65cdff49e6a3e186bb1e43fa50289a662619b Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:52:45 -0500
|
||||
Subject: [PATCH 11/14] ksz8851 make sure is awake before writing mac
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 9 ++++++++-
|
||||
drivers/net/ethernet/micrel/ks8851.h | 2 +-
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index 347f38f..4f68517 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -351,8 +351,15 @@ static int ks8851_write_mac_addr(struct net_device *dev)
|
||||
|
||||
mutex_lock(&ks->lock);
|
||||
|
||||
+ /*
|
||||
+ * Wake up chip in case it was powered off when stopped; otherwise,
|
||||
+ * the first write to the MAC address does not take effect.
|
||||
+ */
|
||||
+ ks8851_set_powermode(ks, PMECR_PM_NORMAL);
|
||||
for (i = 0; i < ETH_ALEN; i++)
|
||||
ks8851_wrreg8(ks, KS_MAR(i), dev->dev_addr[i]);
|
||||
+ if (!netif_running(dev))
|
||||
+ ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN);
|
||||
|
||||
mutex_unlock(&ks->lock);
|
||||
|
||||
@@ -1699,7 +1706,6 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
|
||||
ks->netdev = ndev;
|
||||
ks->spidev = spi;
|
||||
- ks->tx_space = 6144;
|
||||
|
||||
mutex_init(&ks->lock);
|
||||
spin_lock_init(&ks->statelock);
|
||||
@@ -1771,6 +1777,7 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
|
||||
/* cache the contents of the CCR register for EEPROM, etc. */
|
||||
ks->rc_ccr = ks8851_rdreg16(ks, KS_CCR);
|
||||
+ ks->tx_space = ks8851_rdreg16(ks, KS_TXMIR);
|
||||
|
||||
ks8851_read_selftest(ks);
|
||||
ks8851_init_mac(ks);
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.h b/drivers/net/ethernet/micrel/ks8851.h
|
||||
index bc2476e..d39ce97 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.h
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.h
|
||||
@@ -23,7 +23,7 @@
|
||||
#define CCR_32PIN (1 << 0)
|
||||
|
||||
/* MAC address registers */
|
||||
-#define KS_MAR(_m) 0x15 - (_m)
|
||||
+#define KS_MAR(_m) (0x15 - (_m))
|
||||
#define KS_MARL 0x10
|
||||
#define KS_MARM 0x12
|
||||
#define KS_MARH 0x14
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 77734035c97803b393210976dd430cd5190d072d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:53:36 -0500
|
||||
Subject: [PATCH 12/14] ksz8851 add mutex lock/unlock to ks
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 4 +++-
|
||||
1 files changed, 3 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index 4f68517..e22ce5d 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -1499,7 +1499,6 @@ static void ks8851_eeprom_regwrite(struct eeprom_93cx6 *ee)
|
||||
if (ee->reg_chip_select)
|
||||
val |= EEPCR_EECS;
|
||||
|
||||
- printk(KERN_INFO "%s: wr %04x\n", __func__, val);
|
||||
ks8851_wrreg16(ks, KS_EEPCR, val);
|
||||
}
|
||||
|
||||
@@ -1515,6 +1514,8 @@ static int ks8851_eeprom_claim(struct ks8851_net *ks)
|
||||
if (!(ks->rc_ccr & CCR_EEPROM))
|
||||
return -ENOENT;
|
||||
|
||||
+ mutex_lock(&ks->lock);
|
||||
+
|
||||
/* start with clock low, cs high */
|
||||
ks8851_wrreg16(ks, KS_EEPCR, EEPCR_EESA | EEPCR_EECS);
|
||||
return 0;
|
||||
@@ -1531,6 +1532,7 @@ static void ks8851_eeprom_release(struct ks8851_net *ks)
|
||||
unsigned val = ks8851_rdreg16(ks, KS_EEPCR);
|
||||
|
||||
ks8851_wrreg16(ks, KS_EEPCR, val & ~EEPCR_EESA);
|
||||
+ mutex_unlock(&ks->lock);
|
||||
}
|
||||
|
||||
static const struct ethtool_ops ks8851_ethtool_ops = {
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
From 7b4062c1b950287f4b588a72edd520d050e92745 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:54:12 -0500
|
||||
Subject: [PATCH 13/14] ksz8851 add ks8851_tx_check
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 36 +++++++++++++++++-----------------
|
||||
1 files changed, 18 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index e22ce5d..b72baa6 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -108,11 +108,13 @@ struct ks8851_net {
|
||||
struct mii_if_info mii;
|
||||
struct ks8851_rxctrl rxctrl;
|
||||
|
||||
+ struct work_struct tx_check;
|
||||
struct work_struct tx_work;
|
||||
struct work_struct irq_work;
|
||||
struct work_struct rxctrl_work;
|
||||
|
||||
struct sk_buff_head txq;
|
||||
+ int tx_len;
|
||||
|
||||
struct spi_message spi_msg1;
|
||||
struct spi_message spi_msg2;
|
||||
@@ -621,19 +623,6 @@ static void ks8851_irq_work(struct work_struct *work)
|
||||
if (status & IRQ_RXPSI)
|
||||
handled |= IRQ_RXPSI;
|
||||
|
||||
- if (status & IRQ_TXI) {
|
||||
- handled |= IRQ_TXI;
|
||||
-
|
||||
- /* no lock here, tx queue should have been stopped */
|
||||
-
|
||||
- /* update our idea of how much tx space is available to the
|
||||
- * system */
|
||||
- ks->tx_space = ks8851_rdreg16(ks, KS_TXMIR);
|
||||
-
|
||||
- netif_dbg(ks, intr, ks->netdev,
|
||||
- "%s: txspace %d\n", __func__, ks->tx_space);
|
||||
- }
|
||||
-
|
||||
if (status & IRQ_RXI)
|
||||
handled |= IRQ_RXI;
|
||||
|
||||
@@ -674,9 +663,6 @@ static void ks8851_irq_work(struct work_struct *work)
|
||||
|
||||
mutex_unlock(&ks->lock);
|
||||
|
||||
- if (status & IRQ_TXI)
|
||||
- netif_wake_queue(ks->netdev);
|
||||
-
|
||||
if (is_level_irq(ks->irq_flags))
|
||||
enable_irq(ks->netdev->irq);
|
||||
}
|
||||
@@ -754,6 +740,17 @@ static void ks8851_done_tx(struct ks8851_net *ks, struct sk_buff *txb)
|
||||
dev_kfree_skb(txb);
|
||||
}
|
||||
|
||||
+static void ks8851_tx_check(struct work_struct *work)
|
||||
+{
|
||||
+ struct ks8851_net *ks = container_of(work, struct ks8851_net, tx_check);
|
||||
+
|
||||
+ ks->tx_space = ks8851_rdreg16(ks, KS_TXMIR);
|
||||
+ if (ks->tx_space > ks->tx_len)
|
||||
+ netif_wake_queue(ks->netdev);
|
||||
+ else
|
||||
+ schedule_work(&ks->tx_check);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* ks8851_tx_work - process tx packet(s)
|
||||
* @work: The work strucutre what was scheduled.
|
||||
@@ -865,7 +862,6 @@ static int ks8851_net_open(struct net_device *dev)
|
||||
/* clear then enable interrupts */
|
||||
|
||||
#define STD_IRQ (IRQ_LCI | /* Link Change */ \
|
||||
- IRQ_TXI | /* TX done */ \
|
||||
IRQ_RXI | /* RX done */ \
|
||||
IRQ_SPIBEI | /* SPI bus error */ \
|
||||
IRQ_TXPSI | /* TX process stop */ \
|
||||
@@ -903,6 +899,7 @@ static int ks8851_net_stop(struct net_device *dev)
|
||||
|
||||
/* stop any outstanding work */
|
||||
flush_work(&ks->irq_work);
|
||||
+ flush_work(&ks->tx_check);
|
||||
flush_work(&ks->tx_work);
|
||||
flush_work(&ks->rxctrl_work);
|
||||
|
||||
@@ -960,14 +957,16 @@ static netdev_tx_t ks8851_start_xmit(struct sk_buff *skb,
|
||||
|
||||
if (needed > ks->tx_space) {
|
||||
netif_stop_queue(dev);
|
||||
+ ks->tx_len = needed;
|
||||
+ schedule_work(&ks->tx_check);
|
||||
ret = NETDEV_TX_BUSY;
|
||||
} else {
|
||||
ks->tx_space -= needed;
|
||||
skb_queue_tail(&ks->txq, skb);
|
||||
+ schedule_work(&ks->tx_work);
|
||||
}
|
||||
|
||||
spin_unlock(&ks->statelock);
|
||||
- schedule_work(&ks->tx_work);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1712,6 +1711,7 @@ static int __devinit ks8851_probe(struct spi_device *spi)
|
||||
mutex_init(&ks->lock);
|
||||
spin_lock_init(&ks->statelock);
|
||||
|
||||
+ INIT_WORK(&ks->tx_check, ks8851_tx_check);
|
||||
INIT_WORK(&ks->tx_work, ks8851_tx_work);
|
||||
INIT_WORK(&ks->irq_work, ks8851_irq_work);
|
||||
INIT_WORK(&ks->rxctrl_work, ks8851_rxctrl_work);
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
From 06112587cca46a906d73d2a6ec450d1e6ae535d3 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Thu, 29 Sep 2011 11:54:51 -0500
|
||||
Subject: [PATCH 14/14] ksz8851 move ks8851_set_powermode
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/micrel/ks8851.c | 40 +++++++++++++++++-----------------
|
||||
1 files changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
|
||||
index b72baa6..c420410 100644
|
||||
--- a/drivers/net/ethernet/micrel/ks8851.c
|
||||
+++ b/drivers/net/ethernet/micrel/ks8851.c
|
||||
@@ -338,6 +338,26 @@ static void ks8851_soft_reset(struct ks8851_net *ks, unsigned op)
|
||||
}
|
||||
|
||||
/**
|
||||
+ * ks8851_set_powermode - set power mode of the device
|
||||
+ * @ks: The device state
|
||||
+ * @pwrmode: The power mode value to write to KS_PMECR.
|
||||
+ *
|
||||
+ * Change the power mode of the chip.
|
||||
+ */
|
||||
+static void ks8851_set_powermode(struct ks8851_net *ks, unsigned pwrmode)
|
||||
+{
|
||||
+ unsigned pmecr;
|
||||
+
|
||||
+ netif_dbg(ks, hw, ks->netdev, "setting power mode %d\n", pwrmode);
|
||||
+
|
||||
+ pmecr = ks8851_rdreg16(ks, KS_PMECR);
|
||||
+ pmecr &= ~PMECR_PM_MASK;
|
||||
+ pmecr |= pwrmode;
|
||||
+
|
||||
+ ks8851_wrreg16(ks, KS_PMECR, pmecr);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* ks8851_write_mac_addr - write mac address to device registers
|
||||
* @dev: The network device
|
||||
*
|
||||
@@ -784,26 +804,6 @@ static void ks8851_tx_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
/**
|
||||
- * ks8851_set_powermode - set power mode of the device
|
||||
- * @ks: The device state
|
||||
- * @pwrmode: The power mode value to write to KS_PMECR.
|
||||
- *
|
||||
- * Change the power mode of the chip.
|
||||
- */
|
||||
-static void ks8851_set_powermode(struct ks8851_net *ks, unsigned pwrmode)
|
||||
-{
|
||||
- unsigned pmecr;
|
||||
-
|
||||
- netif_dbg(ks, hw, ks->netdev, "setting power mode %d\n", pwrmode);
|
||||
-
|
||||
- pmecr = ks8851_rdreg16(ks, KS_PMECR);
|
||||
- pmecr &= ~PMECR_PM_MASK;
|
||||
- pmecr |= pwrmode;
|
||||
-
|
||||
- ks8851_wrreg16(ks, KS_PMECR, pmecr);
|
||||
-}
|
||||
-
|
||||
-/**
|
||||
* ks8851_net_open - open network device
|
||||
* @dev: The network device being opened.
|
||||
*
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,422 @@
|
||||
From 9c613a8ca7cebad1d7fa4376b80a82adcdc7269e Mon Sep 17 00:00:00 2001
|
||||
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
Date: Wed, 11 Aug 2010 17:02:43 -0700
|
||||
Subject: [PATCH 01/11] cpufreq: OMAP: cleanup for multi-SoC support, move
|
||||
into drivers/cpufreq
|
||||
|
||||
Move OMAP cpufreq driver from arch/arm/mach-omap2 into
|
||||
drivers/cpufreq, along with a few cleanups:
|
||||
|
||||
- generalize support for better handling of different SoCs in the OMAP
|
||||
- use OPP layer instead of OMAP clock internals for frequency table init
|
||||
|
||||
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
[khilman@ti.com: move to drivers]
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
arch/arm/plat-omap/Makefile | 1 -
|
||||
arch/arm/plat-omap/cpu-omap.c | 171 ------------------------------------
|
||||
drivers/cpufreq/Makefile | 1 +
|
||||
drivers/cpufreq/omap-cpufreq.c | 188 ++++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 189 insertions(+), 172 deletions(-)
|
||||
delete mode 100644 arch/arm/plat-omap/cpu-omap.c
|
||||
create mode 100644 drivers/cpufreq/omap-cpufreq.c
|
||||
|
||||
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
|
||||
index 9852622..a53eca3 100644
|
||||
--- a/arch/arm/plat-omap/Makefile
|
||||
+++ b/arch/arm/plat-omap/Makefile
|
||||
@@ -19,7 +19,6 @@ obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
|
||||
|
||||
obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
|
||||
|
||||
-obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
|
||||
obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
|
||||
obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
|
||||
obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
|
||||
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
|
||||
deleted file mode 100644
|
||||
index da4f68d..0000000
|
||||
--- a/arch/arm/plat-omap/cpu-omap.c
|
||||
+++ /dev/null
|
||||
@@ -1,171 +0,0 @@
|
||||
-/*
|
||||
- * linux/arch/arm/plat-omap/cpu-omap.c
|
||||
- *
|
||||
- * CPU frequency scaling for OMAP
|
||||
- *
|
||||
- * Copyright (C) 2005 Nokia Corporation
|
||||
- * Written by Tony Lindgren <tony@atomide.com>
|
||||
- *
|
||||
- * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
|
||||
- *
|
||||
- * 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/types.h>
|
||||
-#include <linux/kernel.h>
|
||||
-#include <linux/sched.h>
|
||||
-#include <linux/cpufreq.h>
|
||||
-#include <linux/delay.h>
|
||||
-#include <linux/init.h>
|
||||
-#include <linux/err.h>
|
||||
-#include <linux/clk.h>
|
||||
-#include <linux/io.h>
|
||||
-
|
||||
-#include <mach/hardware.h>
|
||||
-#include <plat/clock.h>
|
||||
-#include <asm/system.h>
|
||||
-
|
||||
-#define VERY_HI_RATE 900000000
|
||||
-
|
||||
-static struct cpufreq_frequency_table *freq_table;
|
||||
-
|
||||
-#ifdef CONFIG_ARCH_OMAP1
|
||||
-#define MPU_CLK "mpu"
|
||||
-#else
|
||||
-#define MPU_CLK "virt_prcm_set"
|
||||
-#endif
|
||||
-
|
||||
-static struct clk *mpu_clk;
|
||||
-
|
||||
-/* TODO: Add support for SDRAM timing changes */
|
||||
-
|
||||
-static int omap_verify_speed(struct cpufreq_policy *policy)
|
||||
-{
|
||||
- if (freq_table)
|
||||
- return cpufreq_frequency_table_verify(policy, freq_table);
|
||||
-
|
||||
- if (policy->cpu)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
- policy->cpuinfo.max_freq);
|
||||
-
|
||||
- policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
|
||||
- policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
|
||||
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
- policy->cpuinfo.max_freq);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static unsigned int omap_getspeed(unsigned int cpu)
|
||||
-{
|
||||
- unsigned long rate;
|
||||
-
|
||||
- if (cpu)
|
||||
- return 0;
|
||||
-
|
||||
- rate = clk_get_rate(mpu_clk) / 1000;
|
||||
- return rate;
|
||||
-}
|
||||
-
|
||||
-static int omap_target(struct cpufreq_policy *policy,
|
||||
- unsigned int target_freq,
|
||||
- unsigned int relation)
|
||||
-{
|
||||
- struct cpufreq_freqs freqs;
|
||||
- int ret = 0;
|
||||
-
|
||||
- /* Ensure desired rate is within allowed range. Some govenors
|
||||
- * (ondemand) will just pass target_freq=0 to get the minimum. */
|
||||
- if (target_freq < policy->min)
|
||||
- target_freq = policy->min;
|
||||
- if (target_freq > policy->max)
|
||||
- target_freq = policy->max;
|
||||
-
|
||||
- freqs.old = omap_getspeed(0);
|
||||
- freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
|
||||
- freqs.cpu = 0;
|
||||
-
|
||||
- if (freqs.old == freqs.new)
|
||||
- return ret;
|
||||
-
|
||||
- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
-#ifdef CONFIG_CPU_FREQ_DEBUG
|
||||
- printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n",
|
||||
- freqs.old, freqs.new);
|
||||
-#endif
|
||||
- ret = clk_set_rate(mpu_clk, freqs.new * 1000);
|
||||
- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
-{
|
||||
- int result = 0;
|
||||
-
|
||||
- mpu_clk = clk_get(NULL, MPU_CLK);
|
||||
- if (IS_ERR(mpu_clk))
|
||||
- return PTR_ERR(mpu_clk);
|
||||
-
|
||||
- if (policy->cpu != 0)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- policy->cur = policy->min = policy->max = omap_getspeed(0);
|
||||
-
|
||||
- clk_init_cpufreq_table(&freq_table);
|
||||
- if (freq_table) {
|
||||
- result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
|
||||
- if (!result)
|
||||
- cpufreq_frequency_table_get_attr(freq_table,
|
||||
- policy->cpu);
|
||||
- } else {
|
||||
- policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
|
||||
- policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
|
||||
- VERY_HI_RATE) / 1000;
|
||||
- }
|
||||
-
|
||||
- /* FIXME: what's the actual transition time? */
|
||||
- policy->cpuinfo.transition_latency = 300 * 1000;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int omap_cpu_exit(struct cpufreq_policy *policy)
|
||||
-{
|
||||
- clk_exit_cpufreq_table(&freq_table);
|
||||
- clk_put(mpu_clk);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static struct freq_attr *omap_cpufreq_attr[] = {
|
||||
- &cpufreq_freq_attr_scaling_available_freqs,
|
||||
- NULL,
|
||||
-};
|
||||
-
|
||||
-static struct cpufreq_driver omap_driver = {
|
||||
- .flags = CPUFREQ_STICKY,
|
||||
- .verify = omap_verify_speed,
|
||||
- .target = omap_target,
|
||||
- .get = omap_getspeed,
|
||||
- .init = omap_cpu_init,
|
||||
- .exit = omap_cpu_exit,
|
||||
- .name = "omap",
|
||||
- .attr = omap_cpufreq_attr,
|
||||
-};
|
||||
-
|
||||
-static int __init omap_cpufreq_init(void)
|
||||
-{
|
||||
- return cpufreq_register_driver(&omap_driver);
|
||||
-}
|
||||
-
|
||||
-arch_initcall(omap_cpufreq_init);
|
||||
-
|
||||
-/*
|
||||
- * if ever we want to remove this, upon cleanup call:
|
||||
- *
|
||||
- * cpufreq_unregister_driver()
|
||||
- * cpufreq_frequency_table_put_attr()
|
||||
- */
|
||||
-
|
||||
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
|
||||
index a48bc02..ce75fcb 100644
|
||||
--- a/drivers/cpufreq/Makefile
|
||||
+++ b/drivers/cpufreq/Makefile
|
||||
@@ -43,6 +43,7 @@ obj-$(CONFIG_UX500_SOC_DB8500) += db8500-cpufreq.o
|
||||
obj-$(CONFIG_ARM_S3C64XX_CPUFREQ) += s3c64xx-cpufreq.o
|
||||
obj-$(CONFIG_ARM_S5PV210_CPUFREQ) += s5pv210-cpufreq.o
|
||||
obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o
|
||||
+obj-$(CONFIG_ARCH_OMAP2PLUS) += omap-cpufreq.o
|
||||
|
||||
##################################################################################
|
||||
# PowerPC platform drivers
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
new file mode 100644
|
||||
index 0000000..a6b2be7
|
||||
--- /dev/null
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -0,0 +1,188 @@
|
||||
+/*
|
||||
+ * CPU frequency scaling for OMAP
|
||||
+ *
|
||||
+ * Copyright (C) 2005 Nokia Corporation
|
||||
+ * Written by Tony Lindgren <tony@atomide.com>
|
||||
+ *
|
||||
+ * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
|
||||
+ *
|
||||
+ * Copyright (C) 2007-2011 Texas Instruments, Inc.
|
||||
+ * - OMAP3/4 support by Rajendra Nayak, Santosh Shilimkar
|
||||
+ *
|
||||
+ * 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/types.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/sched.h>
|
||||
+#include <linux/cpufreq.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/clk.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/opp.h>
|
||||
+
|
||||
+#include <asm/system.h>
|
||||
+#include <asm/smp_plat.h>
|
||||
+
|
||||
+#include <plat/clock.h>
|
||||
+#include <plat/omap-pm.h>
|
||||
+#include <plat/common.h>
|
||||
+
|
||||
+#include <mach/hardware.h>
|
||||
+
|
||||
+#define VERY_HI_RATE 900000000
|
||||
+
|
||||
+static struct cpufreq_frequency_table *freq_table;
|
||||
+static struct clk *mpu_clk;
|
||||
+
|
||||
+static int omap_verify_speed(struct cpufreq_policy *policy)
|
||||
+{
|
||||
+ if (freq_table)
|
||||
+ return cpufreq_frequency_table_verify(policy, freq_table);
|
||||
+
|
||||
+ if (policy->cpu)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
+ policy->cpuinfo.max_freq);
|
||||
+
|
||||
+ policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
|
||||
+ policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
|
||||
+ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
+ policy->cpuinfo.max_freq);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static unsigned int omap_getspeed(unsigned int cpu)
|
||||
+{
|
||||
+ unsigned long rate;
|
||||
+
|
||||
+ if (cpu)
|
||||
+ return 0;
|
||||
+
|
||||
+ rate = clk_get_rate(mpu_clk) / 1000;
|
||||
+ return rate;
|
||||
+}
|
||||
+
|
||||
+static int omap_target(struct cpufreq_policy *policy,
|
||||
+ unsigned int target_freq,
|
||||
+ unsigned int relation)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ struct cpufreq_freqs freqs;
|
||||
+
|
||||
+ /* Ensure desired rate is within allowed range. Some govenors
|
||||
+ * (ondemand) will just pass target_freq=0 to get the minimum. */
|
||||
+ if (target_freq < policy->min)
|
||||
+ target_freq = policy->min;
|
||||
+ if (target_freq > policy->max)
|
||||
+ target_freq = policy->max;
|
||||
+
|
||||
+ freqs.old = omap_getspeed(0);
|
||||
+ freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
|
||||
+ freqs.cpu = 0;
|
||||
+
|
||||
+ if (freqs.old == freqs.new)
|
||||
+ return ret;
|
||||
+
|
||||
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
+
|
||||
+#ifdef CONFIG_CPU_FREQ_DEBUG
|
||||
+ pr_info("cpufreq-omap: transition: %u --> %u\n", freqs.old, freqs.new);
|
||||
+#endif
|
||||
+
|
||||
+ ret = clk_set_rate(mpu_clk, freqs.new * 1000);
|
||||
+
|
||||
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
+{
|
||||
+ int result = 0;
|
||||
+ struct device *mpu_dev;
|
||||
+
|
||||
+ if (cpu_is_omap24xx())
|
||||
+ mpu_clk = clk_get(NULL, "virt_prcm_set");
|
||||
+ else if (cpu_is_omap34xx())
|
||||
+ mpu_clk = clk_get(NULL, "dpll1_ck");
|
||||
+ else if (cpu_is_omap44xx())
|
||||
+ mpu_clk = clk_get(NULL, "dpll_mpu_ck");
|
||||
+
|
||||
+ if (IS_ERR(mpu_clk))
|
||||
+ return PTR_ERR(mpu_clk);
|
||||
+
|
||||
+ if (policy->cpu != 0)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ policy->cur = policy->min = policy->max = omap_getspeed(0);
|
||||
+
|
||||
+ mpu_dev = omap2_get_mpuss_device();
|
||||
+ if (!mpu_dev) {
|
||||
+ pr_warning("%s: unable to get the mpu device\n", __func__);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
+
|
||||
+ if (freq_table) {
|
||||
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
|
||||
+ if (!result)
|
||||
+ cpufreq_frequency_table_get_attr(freq_table,
|
||||
+ policy->cpu);
|
||||
+ } else {
|
||||
+ policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
|
||||
+ policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
|
||||
+ VERY_HI_RATE) / 1000;
|
||||
+ }
|
||||
+
|
||||
+ policy->min = policy->cpuinfo.min_freq;
|
||||
+ policy->max = policy->cpuinfo.max_freq;
|
||||
+ policy->cur = omap_getspeed(0);
|
||||
+
|
||||
+ /* FIXME: what's the actual transition time? */
|
||||
+ policy->cpuinfo.transition_latency = 300 * 1000;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int omap_cpu_exit(struct cpufreq_policy *policy)
|
||||
+{
|
||||
+ clk_exit_cpufreq_table(&freq_table);
|
||||
+ clk_put(mpu_clk);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct freq_attr *omap_cpufreq_attr[] = {
|
||||
+ &cpufreq_freq_attr_scaling_available_freqs,
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+static struct cpufreq_driver omap_driver = {
|
||||
+ .flags = CPUFREQ_STICKY,
|
||||
+ .verify = omap_verify_speed,
|
||||
+ .target = omap_target,
|
||||
+ .get = omap_getspeed,
|
||||
+ .init = omap_cpu_init,
|
||||
+ .exit = omap_cpu_exit,
|
||||
+ .name = "omap",
|
||||
+ .attr = omap_cpufreq_attr,
|
||||
+};
|
||||
+
|
||||
+static int __init omap_cpufreq_init(void)
|
||||
+{
|
||||
+ return cpufreq_register_driver(&omap_driver);
|
||||
+}
|
||||
+
|
||||
+static void __exit omap_cpufreq_exit(void)
|
||||
+{
|
||||
+ cpufreq_unregister_driver(&omap_driver);
|
||||
+}
|
||||
+
|
||||
+MODULE_DESCRIPTION("cpufreq driver for OMAP SoCs");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+module_init(omap_cpufreq_init);
|
||||
+module_exit(omap_cpufreq_exit);
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
From 87d979c9823e18b22acda61e1ad885d27b123c36 Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@arm.linux.org.uk>
|
||||
Date: Wed, 21 Sep 2011 16:53:00 -0700
|
||||
Subject: [PATCH 02/11] cpufreq: OMAP: Add SMP support for OMAP4+
|
||||
|
||||
On OMAP SMP configuartion, both processors share the voltage
|
||||
and clock. So both CPUs needs to be scaled together and hence
|
||||
needs software co-ordination.
|
||||
|
||||
Also, update lpj with reference value to avoid progressive error.
|
||||
|
||||
Adjust _both_ the per-cpu loops_per_jiffy and global lpj. Calibrate
|
||||
them with with reference to the initial values to avoid a
|
||||
progressively bigger and bigger error in the value over time.
|
||||
|
||||
While at this, re-use the notifiers for UP/SMP since on UP machine or
|
||||
UP_ON_SMP policy->cpus mask would contain only the boot CPU.
|
||||
|
||||
Based on initial SMP support by Santosh Shilimkar.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
|
||||
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
[khilman@ti.com: due to overlap/rework, combined original Santosh patch
|
||||
and Russell's rework]
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 81 +++++++++++++++++++++++++++++++++++-----
|
||||
1 files changed, 71 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index a6b2be7..1953f9d 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -23,9 +23,11 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/opp.h>
|
||||
+#include <linux/cpu.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/smp_plat.h>
|
||||
+#include <asm/cpu.h>
|
||||
|
||||
#include <plat/clock.h>
|
||||
#include <plat/omap-pm.h>
|
||||
@@ -35,6 +37,16 @@
|
||||
|
||||
#define VERY_HI_RATE 900000000
|
||||
|
||||
+#ifdef CONFIG_SMP
|
||||
+struct lpj_info {
|
||||
+ unsigned long ref;
|
||||
+ unsigned int freq;
|
||||
+};
|
||||
+
|
||||
+static DEFINE_PER_CPU(struct lpj_info, lpj_ref);
|
||||
+static struct lpj_info global_lpj_ref;
|
||||
+#endif
|
||||
+
|
||||
static struct cpufreq_frequency_table *freq_table;
|
||||
static struct clk *mpu_clk;
|
||||
|
||||
@@ -60,7 +72,7 @@ static unsigned int omap_getspeed(unsigned int cpu)
|
||||
{
|
||||
unsigned long rate;
|
||||
|
||||
- if (cpu)
|
||||
+ if (cpu >= NR_CPUS)
|
||||
return 0;
|
||||
|
||||
rate = clk_get_rate(mpu_clk) / 1000;
|
||||
@@ -71,7 +83,7 @@ static int omap_target(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq,
|
||||
unsigned int relation)
|
||||
{
|
||||
- int ret = 0;
|
||||
+ int i, ret = 0;
|
||||
struct cpufreq_freqs freqs;
|
||||
|
||||
/* Ensure desired rate is within allowed range. Some govenors
|
||||
@@ -81,22 +93,57 @@ static int omap_target(struct cpufreq_policy *policy,
|
||||
if (target_freq > policy->max)
|
||||
target_freq = policy->max;
|
||||
|
||||
- freqs.old = omap_getspeed(0);
|
||||
+ freqs.old = omap_getspeed(policy->cpu);
|
||||
freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
|
||||
- freqs.cpu = 0;
|
||||
+ freqs.cpu = policy->cpu;
|
||||
|
||||
if (freqs.old == freqs.new)
|
||||
return ret;
|
||||
|
||||
- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
+ /* notifiers */
|
||||
+ for_each_cpu(i, policy->cpus) {
|
||||
+ freqs.cpu = i;
|
||||
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
+ }
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ_DEBUG
|
||||
pr_info("cpufreq-omap: transition: %u --> %u\n", freqs.old, freqs.new);
|
||||
#endif
|
||||
|
||||
ret = clk_set_rate(mpu_clk, freqs.new * 1000);
|
||||
+ freqs.new = omap_getspeed(policy->cpu);
|
||||
+
|
||||
+#ifdef CONFIG_SMP
|
||||
+ /*
|
||||
+ * Note that loops_per_jiffy is not updated on SMP systems in
|
||||
+ * cpufreq driver. So, update the per-CPU loops_per_jiffy value
|
||||
+ * on frequency transition. We need to update all dependent CPUs.
|
||||
+ */
|
||||
+ for_each_cpu(i, policy->cpus) {
|
||||
+ struct lpj_info *lpj = &per_cpu(lpj_ref, i);
|
||||
+ if (!lpj->freq) {
|
||||
+ lpj->ref = per_cpu(cpu_data, i).loops_per_jiffy;
|
||||
+ lpj->freq = freqs.old;
|
||||
+ }
|
||||
+
|
||||
+ per_cpu(cpu_data, i).loops_per_jiffy =
|
||||
+ cpufreq_scale(lpj->ref, lpj->freq, freqs.new);
|
||||
+ }
|
||||
|
||||
- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
+ /* And don't forget to adjust the global one */
|
||||
+ if (!global_lpj_ref.freq) {
|
||||
+ global_lpj_ref.ref = loops_per_jiffy;
|
||||
+ global_lpj_ref.freq = freqs.old;
|
||||
+ }
|
||||
+ loops_per_jiffy = cpufreq_scale(global_lpj_ref.ref, global_lpj_ref.freq,
|
||||
+ freqs.new);
|
||||
+#endif
|
||||
+
|
||||
+ /* notifiers */
|
||||
+ for_each_cpu(i, policy->cpus) {
|
||||
+ freqs.cpu = i;
|
||||
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
+ }
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -105,6 +152,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int result = 0;
|
||||
struct device *mpu_dev;
|
||||
+ static cpumask_var_t cpumask;
|
||||
|
||||
if (cpu_is_omap24xx())
|
||||
mpu_clk = clk_get(NULL, "virt_prcm_set");
|
||||
@@ -116,12 +164,12 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
if (IS_ERR(mpu_clk))
|
||||
return PTR_ERR(mpu_clk);
|
||||
|
||||
- if (policy->cpu != 0)
|
||||
+ if (policy->cpu >= NR_CPUS)
|
||||
return -EINVAL;
|
||||
|
||||
- policy->cur = policy->min = policy->max = omap_getspeed(0);
|
||||
-
|
||||
+ policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
|
||||
mpu_dev = omap2_get_mpuss_device();
|
||||
+
|
||||
if (!mpu_dev) {
|
||||
pr_warning("%s: unable to get the mpu device\n", __func__);
|
||||
return -EINVAL;
|
||||
@@ -141,7 +189,20 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
|
||||
policy->min = policy->cpuinfo.min_freq;
|
||||
policy->max = policy->cpuinfo.max_freq;
|
||||
- policy->cur = omap_getspeed(0);
|
||||
+ policy->cur = omap_getspeed(policy->cpu);
|
||||
+
|
||||
+ /*
|
||||
+ * On OMAP SMP configuartion, both processors share the voltage
|
||||
+ * and clock. So both CPUs needs to be scaled together and hence
|
||||
+ * needs software co-ordination. Use cpufreq affected_cpus
|
||||
+ * interface to handle this scenario. Additional is_smp() check
|
||||
+ * is to keep SMP_ON_UP build working.
|
||||
+ */
|
||||
+ if (is_smp()) {
|
||||
+ policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
|
||||
+ cpumask_or(cpumask, cpumask_of(policy->cpu), cpumask);
|
||||
+ cpumask_copy(policy->cpus, cpumask);
|
||||
+ }
|
||||
|
||||
/* FIXME: what's the actual transition time? */
|
||||
policy->cpuinfo.transition_latency = 300 * 1000;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From ed54323b7c150554e68cb02d90dd36b60fe4e275 Mon Sep 17 00:00:00 2001
|
||||
From: Todd Poynor <toddpoynor@google.com>
|
||||
Date: Tue, 7 Jun 2011 13:57:52 -0700
|
||||
Subject: [PATCH 03/11] cpufreq: OMAP: Enable all CPUs in shared policy mask
|
||||
|
||||
Enable all CPUs in the shared policy in the CPU init callback.
|
||||
Otherwise, the governor CPUFREQ_GOV_START event is invoked with
|
||||
a policy that only includes the first CPU, leaving other CPUs
|
||||
uninitialized by the governor.
|
||||
|
||||
Signed-off-by: Todd Poynor <toddpoynor@google.com>
|
||||
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 4 +---
|
||||
1 files changed, 1 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index 1953f9d..3f5a816 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -152,7 +152,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int result = 0;
|
||||
struct device *mpu_dev;
|
||||
- static cpumask_var_t cpumask;
|
||||
|
||||
if (cpu_is_omap24xx())
|
||||
mpu_clk = clk_get(NULL, "virt_prcm_set");
|
||||
@@ -200,8 +199,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
*/
|
||||
if (is_smp()) {
|
||||
policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
|
||||
- cpumask_or(cpumask, cpumask_of(policy->cpu), cpumask);
|
||||
- cpumask_copy(policy->cpus, cpumask);
|
||||
+ cpumask_setall(policy->cpus);
|
||||
}
|
||||
|
||||
/* FIXME: what's the actual transition time? */
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 0661a55786b8ee53e388e1608eb56e4661273c6b Mon Sep 17 00:00:00 2001
|
||||
From: Colin Cross <ccross@google.com>
|
||||
Date: Mon, 6 Jun 2011 21:05:29 -0500
|
||||
Subject: [PATCH 04/11] cpufreq: OMAP: notify even with bad boot frequency
|
||||
|
||||
Sometimes, bootloaders starts up with a frequency which is not
|
||||
in the OPP table. At cpu_init, policy->cur contains the frequency
|
||||
we pick at boot. It is possible that system might have fixed
|
||||
it's boot frequency later on as part of power initialization.
|
||||
After this condition, the first call to omap_target results in the
|
||||
following:
|
||||
|
||||
omap_getspeed(actual device frequency) != policy->cur(frequency that
|
||||
cpufreq thinks that the system is at), and it is possible that
|
||||
freqs.old == freqs.new (because the governor requested a scale down).
|
||||
|
||||
We exit without triggering the notifiers in the current code, which
|
||||
does'nt let code which depends on cpufreq_notify_transition to have
|
||||
accurate information as to what the system frequency is.
|
||||
|
||||
Instead, we do a normal transition if policy->cur is wrong, then,
|
||||
freqs.old will be the actual cpu frequency, freqs.new will be the
|
||||
actual new cpu frequency and all required notifiers have the accurate
|
||||
information.
|
||||
|
||||
Acked-by: Nishanth Menon <nm@ti.com>
|
||||
Signed-off-by: Colin Cross <ccross@google.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index 3f5a816..0a5d95c 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -97,7 +97,7 @@ static int omap_target(struct cpufreq_policy *policy,
|
||||
freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
|
||||
freqs.cpu = policy->cpu;
|
||||
|
||||
- if (freqs.old == freqs.new)
|
||||
+ if (freqs.old == freqs.new && policy->cur == freqs.new)
|
||||
return ret;
|
||||
|
||||
/* notifiers */
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From 37b0a6ccc284854592918359f825371c36a801ab Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Menon <nm@ti.com>
|
||||
Date: Wed, 25 May 2011 16:38:46 -0700
|
||||
Subject: [PATCH 05/11] cpufreq: OMAP: move clk name decision to init
|
||||
|
||||
Clk name does'nt need to dynamically detected during clk init.
|
||||
move them off to driver initialization, if we dont have a clk name,
|
||||
there is no point in registering the driver anyways. The actual clk
|
||||
get and put is left at cpu_init and exit functions.
|
||||
|
||||
Signed-off-by: Nishanth Menon <nm@ti.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 20 +++++++++++++-------
|
||||
1 files changed, 13 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index 0a5d95c..3651825 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -49,6 +49,7 @@ static struct lpj_info global_lpj_ref;
|
||||
|
||||
static struct cpufreq_frequency_table *freq_table;
|
||||
static struct clk *mpu_clk;
|
||||
+static char *mpu_clk_name;
|
||||
|
||||
static int omap_verify_speed(struct cpufreq_policy *policy)
|
||||
{
|
||||
@@ -153,13 +154,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
int result = 0;
|
||||
struct device *mpu_dev;
|
||||
|
||||
- if (cpu_is_omap24xx())
|
||||
- mpu_clk = clk_get(NULL, "virt_prcm_set");
|
||||
- else if (cpu_is_omap34xx())
|
||||
- mpu_clk = clk_get(NULL, "dpll1_ck");
|
||||
- else if (cpu_is_omap44xx())
|
||||
- mpu_clk = clk_get(NULL, "dpll_mpu_ck");
|
||||
-
|
||||
+ mpu_clk = clk_get(NULL, mpu_clk_name);
|
||||
if (IS_ERR(mpu_clk))
|
||||
return PTR_ERR(mpu_clk);
|
||||
|
||||
@@ -233,6 +228,17 @@ static struct cpufreq_driver omap_driver = {
|
||||
|
||||
static int __init omap_cpufreq_init(void)
|
||||
{
|
||||
+ if (cpu_is_omap24xx())
|
||||
+ mpu_clk_name = "virt_prcm_set";
|
||||
+ else if (cpu_is_omap34xx())
|
||||
+ mpu_clk_name = "dpll1_ck";
|
||||
+ else if (cpu_is_omap44xx())
|
||||
+ mpu_clk_name = "dpll_mpu_ck";
|
||||
+
|
||||
+ if (!mpu_clk_name) {
|
||||
+ pr_err("%s: unsupported Silicon?\n", __func__);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
return cpufreq_register_driver(&omap_driver);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From 6e85de6b5c1d71d372c23bf1f5c2388b9560f42f Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Menon <nm@ti.com>
|
||||
Date: Wed, 25 May 2011 16:38:47 -0700
|
||||
Subject: [PATCH 06/11] cpufreq: OMAP: deny initialization if no mpudev
|
||||
|
||||
if we do not have mpu_dev we normally fail in cpu_init. It is better
|
||||
to fail driver registration if the devices are not available.
|
||||
|
||||
Signed-off-by: Nishanth Menon <nm@ti.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 15 ++++++++-------
|
||||
1 files changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index 3651825..dda32fd 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -50,6 +50,7 @@ static struct lpj_info global_lpj_ref;
|
||||
static struct cpufreq_frequency_table *freq_table;
|
||||
static struct clk *mpu_clk;
|
||||
static char *mpu_clk_name;
|
||||
+static struct device *mpu_dev;
|
||||
|
||||
static int omap_verify_speed(struct cpufreq_policy *policy)
|
||||
{
|
||||
@@ -152,7 +153,6 @@ static int omap_target(struct cpufreq_policy *policy,
|
||||
static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int result = 0;
|
||||
- struct device *mpu_dev;
|
||||
|
||||
mpu_clk = clk_get(NULL, mpu_clk_name);
|
||||
if (IS_ERR(mpu_clk))
|
||||
@@ -162,12 +162,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
return -EINVAL;
|
||||
|
||||
policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
|
||||
- mpu_dev = omap2_get_mpuss_device();
|
||||
-
|
||||
- if (!mpu_dev) {
|
||||
- pr_warning("%s: unable to get the mpu device\n", __func__);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
|
||||
if (freq_table) {
|
||||
@@ -239,6 +233,13 @@ static int __init omap_cpufreq_init(void)
|
||||
pr_err("%s: unsupported Silicon?\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
+
|
||||
+ mpu_dev = omap2_get_mpuss_device();
|
||||
+ if (!mpu_dev) {
|
||||
+ pr_warning("%s: unable to get the mpu device\n", __func__);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
return cpufreq_register_driver(&omap_driver);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
From 01d968ec96c7d6e9ba21a287e2836687be31d669 Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Menon <nm@ti.com>
|
||||
Date: Thu, 26 May 2011 19:39:17 -0700
|
||||
Subject: [PATCH 07/11] cpufreq: OMAP: dont support !freq_table
|
||||
|
||||
OMAP2+ all have frequency tables, hence the hacks we had for older
|
||||
silicon do not need to be carried forward. As part of this change,
|
||||
use cpufreq_frequency_table_target to find the best match for
|
||||
frequency requested.
|
||||
|
||||
Signed-off-by: Nishanth Menon <nm@ti.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 67 +++++++++++++++++++--------------------
|
||||
1 files changed, 33 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index dda32fd..eecb096 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -35,8 +35,6 @@
|
||||
|
||||
#include <mach/hardware.h>
|
||||
|
||||
-#define VERY_HI_RATE 900000000
|
||||
-
|
||||
#ifdef CONFIG_SMP
|
||||
struct lpj_info {
|
||||
unsigned long ref;
|
||||
@@ -54,20 +52,9 @@ static struct device *mpu_dev;
|
||||
|
||||
static int omap_verify_speed(struct cpufreq_policy *policy)
|
||||
{
|
||||
- if (freq_table)
|
||||
- return cpufreq_frequency_table_verify(policy, freq_table);
|
||||
-
|
||||
- if (policy->cpu)
|
||||
+ if (!freq_table)
|
||||
return -EINVAL;
|
||||
-
|
||||
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
- policy->cpuinfo.max_freq);
|
||||
-
|
||||
- policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
|
||||
- policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
|
||||
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
- policy->cpuinfo.max_freq);
|
||||
- return 0;
|
||||
+ return cpufreq_frequency_table_verify(policy, freq_table);
|
||||
}
|
||||
|
||||
static unsigned int omap_getspeed(unsigned int cpu)
|
||||
@@ -85,18 +72,31 @@ static int omap_target(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq,
|
||||
unsigned int relation)
|
||||
{
|
||||
- int i, ret = 0;
|
||||
+ unsigned int i;
|
||||
+ int ret = 0;
|
||||
struct cpufreq_freqs freqs;
|
||||
|
||||
- /* Ensure desired rate is within allowed range. Some govenors
|
||||
- * (ondemand) will just pass target_freq=0 to get the minimum. */
|
||||
- if (target_freq < policy->min)
|
||||
- target_freq = policy->min;
|
||||
- if (target_freq > policy->max)
|
||||
- target_freq = policy->max;
|
||||
+ if (!freq_table) {
|
||||
+ dev_err(mpu_dev, "%s: cpu%d: no freq table!\n", __func__,
|
||||
+ policy->cpu);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ ret = cpufreq_frequency_table_target(policy, freq_table, target_freq,
|
||||
+ relation, &i);
|
||||
+ if (ret) {
|
||||
+ dev_dbg(mpu_dev, "%s: cpu%d: no freq match for %d(ret=%d)\n",
|
||||
+ __func__, policy->cpu, target_freq, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ freqs.new = freq_table[i].frequency;
|
||||
+ if (!freqs.new) {
|
||||
+ dev_err(mpu_dev, "%s: cpu%d: no match for freq %d\n", __func__,
|
||||
+ policy->cpu, target_freq);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
|
||||
freqs.old = omap_getspeed(policy->cpu);
|
||||
- freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
|
||||
freqs.cpu = policy->cpu;
|
||||
|
||||
if (freqs.old == freqs.new && policy->cur == freqs.new)
|
||||
@@ -162,19 +162,18 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
return -EINVAL;
|
||||
|
||||
policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
|
||||
- opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
-
|
||||
- if (freq_table) {
|
||||
- result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
|
||||
- if (!result)
|
||||
- cpufreq_frequency_table_get_attr(freq_table,
|
||||
- policy->cpu);
|
||||
- } else {
|
||||
- policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
|
||||
- policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
|
||||
- VERY_HI_RATE) / 1000;
|
||||
+ result = opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
+
|
||||
+ if (result) {
|
||||
+ dev_err(mpu_dev, "%s: cpu%d: failed creating freq table[%d]\n",
|
||||
+ __func__, policy->cpu, result);
|
||||
+ return result;
|
||||
}
|
||||
|
||||
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
|
||||
+ if (!result)
|
||||
+ cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
|
||||
+
|
||||
policy->min = policy->cpuinfo.min_freq;
|
||||
policy->max = policy->cpuinfo.max_freq;
|
||||
policy->cur = omap_getspeed(policy->cpu);
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 508bd6dae63589ea98c38f031e98dcad2fa18976 Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Menon <nm@ti.com>
|
||||
Date: Thu, 26 May 2011 19:39:18 -0700
|
||||
Subject: [PATCH 08/11] cpufreq: OMAP: only supports OPP library
|
||||
|
||||
OMAP2 is the only family using clk_[init|exit]_cpufreq_table, however,
|
||||
the cpufreq code does not currently use clk_init_cpufreq_table. As a
|
||||
result, it is unusuable for OMAP2 and only usable only on platforms
|
||||
using OPP library.
|
||||
|
||||
Remove the unbalanced clk_exit_cpufreq_table(). Any platforms where
|
||||
OPPs are not availble will fail on init because a freq table will not
|
||||
be properly initialized.
|
||||
|
||||
Signed-off-by: Nishanth Menon <nm@ti.com>
|
||||
[khilman@ti.com: changelog edits, and graceful failure mode changes]
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 3 +--
|
||||
1 files changed, 1 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index eecb096..8f778b9 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * CPU frequency scaling for OMAP
|
||||
+ * CPU frequency scaling for OMAP using OPP information
|
||||
*
|
||||
* Copyright (C) 2005 Nokia Corporation
|
||||
* Written by Tony Lindgren <tony@atomide.com>
|
||||
@@ -198,7 +198,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
|
||||
static int omap_cpu_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
- clk_exit_cpufreq_table(&freq_table);
|
||||
clk_put(mpu_clk);
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 7f37af0e32e0bc99fc7459bfd3a6748c44b7d563 Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Menon <nm@ti.com>
|
||||
Date: Thu, 26 May 2011 19:39:19 -0700
|
||||
Subject: [PATCH 09/11] cpufreq: OMAP: put clk if cpu_init failed
|
||||
|
||||
Release the mpu_clk in fail paths.
|
||||
|
||||
Reported-by: Todd Poynor <toddpoynor@google.com>
|
||||
Signed-off-by: Nishanth Menon <nm@ti.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 14 +++++++++++---
|
||||
1 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index 8f778b9..8c54192 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -158,8 +158,10 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
if (IS_ERR(mpu_clk))
|
||||
return PTR_ERR(mpu_clk);
|
||||
|
||||
- if (policy->cpu >= NR_CPUS)
|
||||
- return -EINVAL;
|
||||
+ if (policy->cpu >= NR_CPUS) {
|
||||
+ result = -EINVAL;
|
||||
+ goto fail_ck;
|
||||
+ }
|
||||
|
||||
policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
|
||||
result = opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
@@ -167,12 +169,14 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
if (result) {
|
||||
dev_err(mpu_dev, "%s: cpu%d: failed creating freq table[%d]\n",
|
||||
__func__, policy->cpu, result);
|
||||
- return result;
|
||||
+ goto fail_ck;
|
||||
}
|
||||
|
||||
result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
|
||||
if (!result)
|
||||
cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
|
||||
+ else
|
||||
+ goto fail_ck;
|
||||
|
||||
policy->min = policy->cpuinfo.min_freq;
|
||||
policy->max = policy->cpuinfo.max_freq;
|
||||
@@ -194,6 +198,10 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
policy->cpuinfo.transition_latency = 300 * 1000;
|
||||
|
||||
return 0;
|
||||
+
|
||||
+fail_ck:
|
||||
+ clk_put(mpu_clk);
|
||||
+ return result;
|
||||
}
|
||||
|
||||
static int omap_cpu_exit(struct cpufreq_policy *policy)
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
From eacc1163972fc46357883d58adab8b2d237c2598 Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Menon <nm@ti.com>
|
||||
Date: Thu, 26 May 2011 19:39:20 -0700
|
||||
Subject: [PATCH 10/11] cpufreq: OMAP: fix freq_table leak
|
||||
|
||||
We use a single frequency table for multiple CPUs. But, with
|
||||
OMAP4, since we have multiple CPUs, the cpu_init call for CPU1
|
||||
causes freq_table previously allocated for CPU0 to be overwritten.
|
||||
In addition, we dont free the table on exit path.
|
||||
|
||||
We solve this by maintaining an atomic type counter to ensure
|
||||
just a single table exists at a given time.
|
||||
|
||||
Signed-off-by: Nishanth Menon <nm@ti.com>
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 22 +++++++++++++++++-----
|
||||
1 files changed, 17 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index 8c54192..ad94b4f 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -46,6 +46,7 @@ static struct lpj_info global_lpj_ref;
|
||||
#endif
|
||||
|
||||
static struct cpufreq_frequency_table *freq_table;
|
||||
+static atomic_t freq_table_users = ATOMIC_INIT(0);
|
||||
static struct clk *mpu_clk;
|
||||
static char *mpu_clk_name;
|
||||
static struct device *mpu_dev;
|
||||
@@ -150,6 +151,12 @@ static int omap_target(struct cpufreq_policy *policy,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static inline void freq_table_free(void)
|
||||
+{
|
||||
+ if (atomic_dec_and_test(&freq_table_users))
|
||||
+ opp_free_cpufreq_table(mpu_dev, &freq_table);
|
||||
+}
|
||||
+
|
||||
static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int result = 0;
|
||||
@@ -164,7 +171,9 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
}
|
||||
|
||||
policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
|
||||
- result = opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
+
|
||||
+ if (atomic_inc_return(&freq_table_users) == 1)
|
||||
+ result = opp_init_cpufreq_table(mpu_dev, &freq_table);
|
||||
|
||||
if (result) {
|
||||
dev_err(mpu_dev, "%s: cpu%d: failed creating freq table[%d]\n",
|
||||
@@ -173,10 +182,10 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
}
|
||||
|
||||
result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
|
||||
- if (!result)
|
||||
- cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
|
||||
- else
|
||||
- goto fail_ck;
|
||||
+ if (result)
|
||||
+ goto fail_table;
|
||||
+
|
||||
+ cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
|
||||
|
||||
policy->min = policy->cpuinfo.min_freq;
|
||||
policy->max = policy->cpuinfo.max_freq;
|
||||
@@ -199,6 +208,8 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
|
||||
|
||||
return 0;
|
||||
|
||||
+fail_table:
|
||||
+ freq_table_free();
|
||||
fail_ck:
|
||||
clk_put(mpu_clk);
|
||||
return result;
|
||||
@@ -206,6 +217,7 @@ fail_ck:
|
||||
|
||||
static int omap_cpu_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
+ freq_table_free();
|
||||
clk_put(mpu_clk);
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From 492ddcd5eb9b88526903716293342b312595292a Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Hilman <khilman@ti.com>
|
||||
Date: Fri, 30 Sep 2011 10:41:26 -0700
|
||||
Subject: [PATCH 11/11] cpufreq: OMAP: fixup for omap_device changes, include
|
||||
<linux/module.h>
|
||||
|
||||
Minor fixups to work starting with v3.2:
|
||||
- use the new omap_device API for getting a device by name.
|
||||
- need to include <linux/module.h>
|
||||
|
||||
Signed-off-by: Kevin Hilman <khilman@ti.com>
|
||||
---
|
||||
drivers/cpufreq/omap-cpufreq.c | 4 +++-
|
||||
1 files changed, 3 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
|
||||
index ad94b4f..5d04c57 100644
|
||||
--- a/drivers/cpufreq/omap-cpufreq.c
|
||||
+++ b/drivers/cpufreq/omap-cpufreq.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/opp.h>
|
||||
#include <linux/cpu.h>
|
||||
+#include <linux/module.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/smp_plat.h>
|
||||
@@ -32,6 +33,7 @@
|
||||
#include <plat/clock.h>
|
||||
#include <plat/omap-pm.h>
|
||||
#include <plat/common.h>
|
||||
+#include <plat/omap_device.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
|
||||
@@ -252,7 +254,7 @@ static int __init omap_cpufreq_init(void)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- mpu_dev = omap2_get_mpuss_device();
|
||||
+ mpu_dev = omap_device_get_by_hwmod_name("mpu");
|
||||
if (!mpu_dev) {
|
||||
pr_warning("%s: unable to get the mpu device\n", __func__);
|
||||
return -EINVAL;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 8c23e194ca34d280d21ca845acd18052928002d0 Mon Sep 17 00:00:00 2001
|
||||
From: Sanjeev Premi <premi@ti.com>
|
||||
Date: Thu, 29 Apr 2010 14:09:42 +0530
|
||||
Subject: [PATCH 1/6] omap3: Increase limit on bootarg 'mpurate'
|
||||
|
||||
The value of mpurate is currently expected to be less
|
||||
than 1000 when specified in MHz.
|
||||
|
||||
This patch raises this limit to 2000 to support 1GHz
|
||||
capable processors. The new limit should be reasonable
|
||||
for quite some time.
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/plat-omap/clock.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
|
||||
index 567e4b5..fe4e67c 100644
|
||||
--- a/arch/arm/plat-omap/clock.c
|
||||
+++ b/arch/arm/plat-omap/clock.c
|
||||
@@ -186,7 +186,7 @@ static int __init omap_clk_setup(char *str)
|
||||
if (!mpurate)
|
||||
return 1;
|
||||
|
||||
- if (mpurate < 1000)
|
||||
+ if (mpurate < 2000)
|
||||
mpurate *= 1000000;
|
||||
|
||||
return 1;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
From 4f047b347137482b1894ab1c48ed472993dbbe54 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Walmsley <paul@pwsan.com>
|
||||
Date: Fri, 16 Dec 2011 16:09:11 -0800
|
||||
Subject: [PATCH 2/6] ARM: OMAP: AM3517/3505: fix crash on boot due to
|
||||
incorrect voltagedomain data
|
||||
|
||||
AM3517/3505 chips don't have voltage controller and voltage processor
|
||||
IP blocks. Trying to use OMAP34xx/36xx voltage domain data on these
|
||||
chips causes a crash during boot:
|
||||
|
||||
omap_vc_init_channel: PMIC info requried to configure vc forvdd_core not populated.Hence cannot initialize vc
|
||||
Unable to handle kernel NULL pointer dereference at virtual address 00000025
|
||||
pgd = c0004000
|
||||
[00000025] *pgd=00000000
|
||||
Internal error: Oops: 5 [#1] SMP
|
||||
Modules linked in:
|
||||
CPU: 0 Tainted: G W (3.2.0-rc5-00006-g402ecf4 #304)
|
||||
PC is at omap_vp_init+0x5c/0x14c
|
||||
LR is at omap_vp_init+0x54/0x14c
|
||||
|
||||
Fix this by using very minimal voltage domain definitions for AM3517/3505.
|
||||
|
||||
Signed-off-by: Paul Walmsley <paul@pwsan.com>
|
||||
Cc: Igor Grinberg <grinberg@compulab.co.il>
|
||||
Cc: Kevin Hilman <khilman@ti.com>
|
||||
Signed-off-by: Tony Lindgren <tony@atomide.com>
|
||||
---
|
||||
arch/arm/mach-omap2/voltagedomains3xxx_data.c | 40 +++++++++++++++++++++----
|
||||
1 files changed, 34 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
|
||||
index 071101d..636b688 100644
|
||||
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
|
||||
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
|
||||
@@ -31,6 +31,14 @@
|
||||
* VDD data
|
||||
*/
|
||||
|
||||
+/* OMAP3-common voltagedomain data */
|
||||
+
|
||||
+static struct voltagedomain omap3_voltdm_wkup = {
|
||||
+ .name = "wakeup",
|
||||
+};
|
||||
+
|
||||
+/* 34xx/36xx voltagedomain data */
|
||||
+
|
||||
static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
|
||||
.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
|
||||
.voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
|
||||
@@ -63,10 +71,6 @@ static struct voltagedomain omap3_voltdm_core = {
|
||||
.vp = &omap3_vp_core,
|
||||
};
|
||||
|
||||
-static struct voltagedomain omap3_voltdm_wkup = {
|
||||
- .name = "wakeup",
|
||||
-};
|
||||
-
|
||||
static struct voltagedomain *voltagedomains_omap3[] __initdata = {
|
||||
&omap3_voltdm_mpu,
|
||||
&omap3_voltdm_core,
|
||||
@@ -74,11 +78,30 @@ static struct voltagedomain *voltagedomains_omap3[] __initdata = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
+/* AM35xx voltagedomain data */
|
||||
+
|
||||
+static struct voltagedomain am35xx_voltdm_mpu = {
|
||||
+ .name = "mpu_iva",
|
||||
+};
|
||||
+
|
||||
+static struct voltagedomain am35xx_voltdm_core = {
|
||||
+ .name = "core",
|
||||
+};
|
||||
+
|
||||
+static struct voltagedomain *voltagedomains_am35xx[] __initdata = {
|
||||
+ &am35xx_voltdm_mpu,
|
||||
+ &am35xx_voltdm_core,
|
||||
+ &omap3_voltdm_wkup,
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+
|
||||
static const char *sys_clk_name __initdata = "sys_ck";
|
||||
|
||||
void __init omap3xxx_voltagedomains_init(void)
|
||||
{
|
||||
struct voltagedomain *voltdm;
|
||||
+ struct voltagedomain **voltdms;
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -93,8 +116,13 @@ void __init omap3xxx_voltagedomains_init(void)
|
||||
omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
|
||||
}
|
||||
|
||||
- for (i = 0; voltdm = voltagedomains_omap3[i], voltdm; i++)
|
||||
+ if (cpu_is_omap3517() || cpu_is_omap3505())
|
||||
+ voltdms = voltagedomains_am35xx;
|
||||
+ else
|
||||
+ voltdms = voltagedomains_omap3;
|
||||
+
|
||||
+ for (i = 0; voltdm = voltdms[i], voltdm; i++)
|
||||
voltdm->sys_clk.name = sys_clk_name;
|
||||
|
||||
- voltdm_init(voltagedomains_omap3);
|
||||
+ voltdm_init(voltdms);
|
||||
};
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
From 3752df4a899250ce6ad4ebd46e0c58235f9dcfa0 Mon Sep 17 00:00:00 2001
|
||||
From: Benoit Cousson <b-cousson@ti.com>
|
||||
Date: Fri, 16 Dec 2011 16:09:11 -0800
|
||||
Subject: [PATCH 3/6] ARM: OMAP4: hwmod: Don't wait for the idle status if
|
||||
modulemode is not supported
|
||||
|
||||
If the module does not have any modulemode, the _disable_module function
|
||||
will do nothing. There is then no point waiting for a idle status change.
|
||||
|
||||
It will remove the following warnings.
|
||||
|
||||
[ 0.331848] omap_hwmod: dmm: _wait_target_disable failed
|
||||
[ 0.339935] omap_hwmod: emif_fw: _wait_target_disable failed
|
||||
[ 0.348358] omap_hwmod: l3_main_1: _wait_target_disable failed
|
||||
[ 0.356964] omap_hwmod: l3_main_2: _wait_target_disable failed
|
||||
[ 0.365600] omap_hwmod: l4_abe: _wait_target_disable failed
|
||||
[ 0.373931] omap_hwmod: l4_cfg: _wait_target_disable failed
|
||||
[ 0.382263] omap_hwmod: l4_per: _wait_target_disable failed
|
||||
[ 0.391113] omap_hwmod: l4_wkup: _wait_target_disable failed
|
||||
[ 0.399536] omap_hwmod: dma_system: _wait_target_disable failed
|
||||
[ 0.408325] omap_hwmod: dss_core: _wait_target_disable failed
|
||||
[ 0.416839] omap_hwmod: dss_dispc: _wait_target_disable failed
|
||||
[ 0.425445] omap_hwmod: dss_dsi1: _wait_target_disable failed
|
||||
[ 0.433990] omap_hwmod: dss_dsi2: _wait_target_disable failed
|
||||
[ 0.442504] omap_hwmod: dss_hdmi: _wait_target_disable failed
|
||||
[ 0.451019] omap_hwmod: dss_rfbi: _wait_target_disable failed
|
||||
[ 0.459564] omap_hwmod: dss_venc: _wait_target_disable failed
|
||||
[ 0.489471] omap_hwmod: mailbox: _wait_target_disable failed
|
||||
[ 0.505920] omap_hwmod: spinlock: _wait_target_disable failed
|
||||
|
||||
Note: For such module, the state is managed automatically by HW according
|
||||
to clock domain transition. It is then not possible to wait for idle even
|
||||
later in the _idle function since the status will change at clock domain
|
||||
boundary.
|
||||
|
||||
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
|
||||
Cc: Paul Walmsley <paul@pwsan.com>
|
||||
Cc: Rajendra Nayak <rnayak@ti.com>
|
||||
[paul@pwsan.com: renamed fns to indicate that they are OMAP4-only; moved
|
||||
_wait_target_disable() into _disable_module(), removing duplicate code]
|
||||
Signed-off-by: Paul Walmsley <paul@pwsan.com>
|
||||
Signed-off-by: Tony Lindgren <tony@atomide.com>
|
||||
---
|
||||
arch/arm/mach-omap2/omap_hwmod.c | 98 +++++++++++++++++++-------------------
|
||||
1 files changed, 49 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
|
||||
index 207a2ff..ebace0f 100644
|
||||
--- a/arch/arm/mach-omap2/omap_hwmod.c
|
||||
+++ b/arch/arm/mach-omap2/omap_hwmod.c
|
||||
@@ -706,27 +706,65 @@ static void _enable_module(struct omap_hwmod *oh)
|
||||
}
|
||||
|
||||
/**
|
||||
- * _disable_module - enable CLKCTRL modulemode on OMAP4
|
||||
+ * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4
|
||||
+ * @oh: struct omap_hwmod *
|
||||
+ *
|
||||
+ * Wait for a module @oh to enter slave idle. Returns 0 if the module
|
||||
+ * does not have an IDLEST bit or if the module successfully enters
|
||||
+ * slave idle; otherwise, pass along the return value of the
|
||||
+ * appropriate *_cm*_wait_module_idle() function.
|
||||
+ */
|
||||
+static int _omap4_wait_target_disable(struct omap_hwmod *oh)
|
||||
+{
|
||||
+ if (!cpu_is_omap44xx())
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!oh)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (oh->flags & HWMOD_NO_IDLEST)
|
||||
+ return 0;
|
||||
+
|
||||
+ return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition,
|
||||
+ oh->clkdm->cm_inst,
|
||||
+ oh->clkdm->clkdm_offs,
|
||||
+ oh->prcm.omap4.clkctrl_offs);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
|
||||
* @oh: struct omap_hwmod *
|
||||
*
|
||||
* Disable the PRCM module mode related to the hwmod @oh.
|
||||
- * No return value.
|
||||
+ * Return EINVAL if the modulemode is not supported and 0 in case of success.
|
||||
*/
|
||||
-static void _disable_module(struct omap_hwmod *oh)
|
||||
+static int _omap4_disable_module(struct omap_hwmod *oh)
|
||||
{
|
||||
+ int v;
|
||||
+
|
||||
/* The module mode does not exist prior OMAP4 */
|
||||
- if (cpu_is_omap24xx() || cpu_is_omap34xx())
|
||||
- return;
|
||||
+ if (!cpu_is_omap44xx())
|
||||
+ return -EINVAL;
|
||||
|
||||
if (!oh->clkdm || !oh->prcm.omap4.modulemode)
|
||||
- return;
|
||||
+ return -EINVAL;
|
||||
|
||||
- pr_debug("omap_hwmod: %s: _disable_module\n", oh->name);
|
||||
+ pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
|
||||
|
||||
omap4_cminst_module_disable(oh->clkdm->prcm_partition,
|
||||
oh->clkdm->cm_inst,
|
||||
oh->clkdm->clkdm_offs,
|
||||
oh->prcm.omap4.clkctrl_offs);
|
||||
+
|
||||
+ v = _omap4_wait_target_disable(oh);
|
||||
+ if (v)
|
||||
+ pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
|
||||
+ oh->name);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1153,36 +1191,6 @@ static int _wait_target_ready(struct omap_hwmod *oh)
|
||||
}
|
||||
|
||||
/**
|
||||
- * _wait_target_disable - wait for a module to be disabled
|
||||
- * @oh: struct omap_hwmod *
|
||||
- *
|
||||
- * Wait for a module @oh to enter slave idle. Returns 0 if the module
|
||||
- * does not have an IDLEST bit or if the module successfully enters
|
||||
- * slave idle; otherwise, pass along the return value of the
|
||||
- * appropriate *_cm*_wait_module_idle() function.
|
||||
- */
|
||||
-static int _wait_target_disable(struct omap_hwmod *oh)
|
||||
-{
|
||||
- /* TODO: For now just handle OMAP4+ */
|
||||
- if (cpu_is_omap24xx() || cpu_is_omap34xx())
|
||||
- return 0;
|
||||
-
|
||||
- if (!oh)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
|
||||
- return 0;
|
||||
-
|
||||
- if (oh->flags & HWMOD_NO_IDLEST)
|
||||
- return 0;
|
||||
-
|
||||
- return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition,
|
||||
- oh->clkdm->cm_inst,
|
||||
- oh->clkdm->clkdm_offs,
|
||||
- oh->prcm.omap4.clkctrl_offs);
|
||||
-}
|
||||
-
|
||||
-/**
|
||||
* _lookup_hardreset - fill register bit info for this hwmod/reset line
|
||||
* @oh: struct omap_hwmod *
|
||||
* @name: name of the reset line in the context of this hwmod
|
||||
@@ -1524,8 +1532,6 @@ static int _enable(struct omap_hwmod *oh)
|
||||
*/
|
||||
static int _idle(struct omap_hwmod *oh)
|
||||
{
|
||||
- int ret;
|
||||
-
|
||||
pr_debug("omap_hwmod: %s: idling\n", oh->name);
|
||||
|
||||
if (oh->_state != _HWMOD_STATE_ENABLED) {
|
||||
@@ -1537,11 +1543,9 @@ static int _idle(struct omap_hwmod *oh)
|
||||
if (oh->class->sysc)
|
||||
_idle_sysc(oh);
|
||||
_del_initiator_dep(oh, mpu_oh);
|
||||
- _disable_module(oh);
|
||||
- ret = _wait_target_disable(oh);
|
||||
- if (ret)
|
||||
- pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
|
||||
- oh->name);
|
||||
+
|
||||
+ _omap4_disable_module(oh);
|
||||
+
|
||||
/*
|
||||
* The module must be in idle mode before disabling any parents
|
||||
* clocks. Otherwise, the parent clock might be disabled before
|
||||
@@ -1642,11 +1646,7 @@ static int _shutdown(struct omap_hwmod *oh)
|
||||
if (oh->_state == _HWMOD_STATE_ENABLED) {
|
||||
_del_initiator_dep(oh, mpu_oh);
|
||||
/* XXX what about the other system initiators here? dma, dsp */
|
||||
- _disable_module(oh);
|
||||
- ret = _wait_target_disable(oh);
|
||||
- if (ret)
|
||||
- pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
|
||||
- oh->name);
|
||||
+ _omap4_disable_module(oh);
|
||||
_disable_clocks(oh);
|
||||
if (oh->clkdm)
|
||||
clkdm_hwmod_disable(oh->clkdm, oh);
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From 65f1ea963900225224754f674e8907248262a46b Mon Sep 17 00:00:00 2001
|
||||
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
Date: Fri, 16 Dec 2011 16:09:12 -0800
|
||||
Subject: [PATCH 4/6] ARM: OMAP4: clock: Add CPU local timer clock node
|
||||
|
||||
Local timer clock is sourced from the CPU clock and hence changes
|
||||
along with CPU clock. These per CPU local timers are used as
|
||||
clock-events, so they need to be reconfigured on CPU frequency
|
||||
change as part of CPUfreq governor.
|
||||
|
||||
Newly introduced clockevents_reconfigure() needs to know the
|
||||
twd clock-rate. Provide a clock-node to make clk_get_rate() work
|
||||
for TWD.
|
||||
|
||||
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
Cc: Paul Walmsley <paul@pwsan.com>
|
||||
Cc: Kevin Hilman <khilman@ti.com>
|
||||
[paul@pwsan.com: renamed clock node to 'mpu_periphclk' to indicate that this
|
||||
is the Cortex-A9 MPCore subsystem clock PERIPHCLK (DDI 0407G); moved
|
||||
clock and clkdev entries to match the autogenerated script output]
|
||||
Signed-off-by: Paul Walmsley <paul@pwsan.com>
|
||||
Signed-off-by: Tony Lindgren <tony@atomide.com>
|
||||
---
|
||||
arch/arm/mach-omap2/clock44xx_data.c | 9 +++++++++
|
||||
1 files changed, 9 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
|
||||
index 0798a80..730097e 100644
|
||||
--- a/arch/arm/mach-omap2/clock44xx_data.c
|
||||
+++ b/arch/arm/mach-omap2/clock44xx_data.c
|
||||
@@ -1206,6 +1206,14 @@ static const struct clksel ocp_abe_iclk_div[] = {
|
||||
{ .parent = NULL },
|
||||
};
|
||||
|
||||
+static struct clk mpu_periphclk = {
|
||||
+ .name = "mpu_periphclk",
|
||||
+ .parent = &dpll_mpu_ck,
|
||||
+ .ops = &clkops_null,
|
||||
+ .fixed_div = 2,
|
||||
+ .recalc = &omap_fixed_divisor_recalc,
|
||||
+};
|
||||
+
|
||||
static struct clk ocp_abe_iclk = {
|
||||
.name = "ocp_abe_iclk",
|
||||
.parent = &aess_fclk,
|
||||
@@ -3189,6 +3197,7 @@ static struct omap_clk omap44xx_clks[] = {
|
||||
CLK(NULL, "l4_div_ck", &l4_div_ck, CK_443X),
|
||||
CLK(NULL, "lp_clk_div_ck", &lp_clk_div_ck, CK_443X),
|
||||
CLK(NULL, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, CK_443X),
|
||||
+ CLK("smp_twd", NULL, &mpu_periphclk, CK_443X),
|
||||
CLK(NULL, "ocp_abe_iclk", &ocp_abe_iclk, CK_443X),
|
||||
CLK(NULL, "per_abe_24m_fclk", &per_abe_24m_fclk, CK_443X),
|
||||
CLK(NULL, "per_abe_nc_fclk", &per_abe_nc_fclk, CK_443X),
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
From 44d502c38e4c7bd924c7ac987af4525ec3e8818f Mon Sep 17 00:00:00 2001
|
||||
From: Paul Walmsley <paul@pwsan.com>
|
||||
Date: Thu, 15 Dec 2011 23:30:44 -0700
|
||||
Subject: [PATCH 5/6] ARM: OMAP3: hwmod data: disable multiblock reads on
|
||||
MMC1/2 on OMAP34xx/35xx <= ES2.1
|
||||
|
||||
The HSMMC1/HSMMC2 host controllers on OMAP34xx and
|
||||
OMAP3503/3515/3525/3530 chips at ES levels prior to 3.0 can't do multiple
|
||||
block reads[1]. Mark the hwmod data appropriately.
|
||||
|
||||
Reported by Dave Hylands <dhylands@gmail.com> and Steve Sakoman
|
||||
<sakoman@gmail.com>. Thanks to Steve Sakoman for further help
|
||||
testing this patch.
|
||||
|
||||
1. See for example Advisory 2.1.1.128 "MMC: Multiple Block Read
|
||||
Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
|
||||
Revision F (October 2010) (SPRZ278F), available from
|
||||
http://focus.ti.com/lit/er/sprz278f/sprz278f.pdf
|
||||
|
||||
Note: added 36xx/am35 stuff in the next patch..
|
||||
|
||||
Signed-off-by: Paul Walmsley <paul@pwsan.com>
|
||||
Cc: Dave Hylands <dhylands@gmail.com>
|
||||
Cc: Steve Sakoman <sakoman@gmail.com>
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 90 ++++++++++++++++++++++++++-
|
||||
1 files changed, 86 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
|
||||
index eef43e2..dcbcd64 100644
|
||||
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
|
||||
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
|
||||
@@ -3072,7 +3072,35 @@ static struct omap_mmc_dev_attr mmc1_dev_attr = {
|
||||
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
|
||||
};
|
||||
|
||||
-static struct omap_hwmod omap3xxx_mmc1_hwmod = {
|
||||
+/* See 35xx errata 2.1.1.128 in SPRZ278F */
|
||||
+static struct omap_mmc_dev_attr mmc1_pre_es3_dev_attr = {
|
||||
+ .flags = (OMAP_HSMMC_SUPPORTS_DUAL_VOLT |
|
||||
+ OMAP_HSMMC_BROKEN_MULTIBLOCK_READ),
|
||||
+};
|
||||
+
|
||||
+static struct omap_hwmod omap3xxx_pre_es3_mmc1_hwmod = {
|
||||
+ .name = "mmc1",
|
||||
+ .mpu_irqs = omap34xx_mmc1_mpu_irqs,
|
||||
+ .sdma_reqs = omap34xx_mmc1_sdma_reqs,
|
||||
+ .opt_clks = omap34xx_mmc1_opt_clks,
|
||||
+ .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks),
|
||||
+ .main_clk = "mmchs1_fck",
|
||||
+ .prcm = {
|
||||
+ .omap2 = {
|
||||
+ .module_offs = CORE_MOD,
|
||||
+ .prcm_reg_id = 1,
|
||||
+ .module_bit = OMAP3430_EN_MMC1_SHIFT,
|
||||
+ .idlest_reg_id = 1,
|
||||
+ .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT,
|
||||
+ },
|
||||
+ },
|
||||
+ .dev_attr = &mmc1_pre_es3_dev_attr,
|
||||
+ .slaves = omap3xxx_mmc1_slaves,
|
||||
+ .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves),
|
||||
+ .class = &omap34xx_mmc_class,
|
||||
+};
|
||||
+
|
||||
+static struct omap_hwmod omap3xxx_es3plus_mmc1_hwmod = {
|
||||
.name = "mmc1",
|
||||
.mpu_irqs = omap34xx_mmc1_mpu_irqs,
|
||||
.sdma_reqs = omap34xx_mmc1_sdma_reqs,
|
||||
@@ -3115,7 +3143,34 @@ static struct omap_hwmod_ocp_if *omap3xxx_mmc2_slaves[] = {
|
||||
&omap3xxx_l4_core__mmc2,
|
||||
};
|
||||
|
||||
-static struct omap_hwmod omap3xxx_mmc2_hwmod = {
|
||||
+/* See 35xx errata 2.1.1.128 in SPRZ278F */
|
||||
+static struct omap_mmc_dev_attr mmc2_pre_es3_dev_attr = {
|
||||
+ .flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
|
||||
+};
|
||||
+
|
||||
+static struct omap_hwmod omap3xxx_pre_es3_mmc2_hwmod = {
|
||||
+ .name = "mmc2",
|
||||
+ .mpu_irqs = omap34xx_mmc2_mpu_irqs,
|
||||
+ .sdma_reqs = omap34xx_mmc2_sdma_reqs,
|
||||
+ .opt_clks = omap34xx_mmc2_opt_clks,
|
||||
+ .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks),
|
||||
+ .main_clk = "mmchs2_fck",
|
||||
+ .prcm = {
|
||||
+ .omap2 = {
|
||||
+ .module_offs = CORE_MOD,
|
||||
+ .prcm_reg_id = 1,
|
||||
+ .module_bit = OMAP3430_EN_MMC2_SHIFT,
|
||||
+ .idlest_reg_id = 1,
|
||||
+ .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT,
|
||||
+ },
|
||||
+ },
|
||||
+ .dev_attr = &mmc2_pre_es3_dev_attr,
|
||||
+ .slaves = omap3xxx_mmc2_slaves,
|
||||
+ .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves),
|
||||
+ .class = &omap34xx_mmc_class,
|
||||
+};
|
||||
+
|
||||
+static struct omap_hwmod omap3xxx_es3plus_mmc2_hwmod = {
|
||||
.name = "mmc2",
|
||||
.mpu_irqs = omap34xx_mmc2_mpu_irqs,
|
||||
.sdma_reqs = omap34xx_mmc2_sdma_reqs,
|
||||
@@ -3182,8 +3237,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
|
||||
&omap3xxx_l4_core_hwmod,
|
||||
&omap3xxx_l4_per_hwmod,
|
||||
&omap3xxx_l4_wkup_hwmod,
|
||||
- &omap3xxx_mmc1_hwmod,
|
||||
- &omap3xxx_mmc2_hwmod,
|
||||
&omap3xxx_mmc3_hwmod,
|
||||
&omap3xxx_mpu_hwmod,
|
||||
|
||||
@@ -3258,6 +3311,20 @@ static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
+/* <= 3430ES3-only hwmods */
|
||||
+static struct omap_hwmod *omap3430_pre_es3_hwmods[] __initdata = {
|
||||
+ &omap3xxx_pre_es3_mmc1_hwmod,
|
||||
+ &omap3xxx_pre_es3_mmc2_hwmod,
|
||||
+ NULL
|
||||
+};
|
||||
+
|
||||
+/* 3430ES3+-only hwmods */
|
||||
+static struct omap_hwmod *omap3430_es3plus_hwmods[] __initdata = {
|
||||
+ &omap3xxx_es3plus_mmc1_hwmod,
|
||||
+ &omap3xxx_es3plus_mmc2_hwmod,
|
||||
+ NULL
|
||||
+};
|
||||
+
|
||||
/* 34xx-only hwmods (all ES revisions) */
|
||||
static __initdata struct omap_hwmod *omap34xx_hwmods[] = {
|
||||
&omap3xxx_iva_hwmod,
|
||||
@@ -3334,6 +3401,21 @@ int __init omap3xxx_hwmod_init(void)
|
||||
h = omap3430es2plus_hwmods;
|
||||
};
|
||||
|
||||
+ if (h) {
|
||||
+ r = omap_hwmod_register(h);
|
||||
+ if (r < 0)
|
||||
+ return r;
|
||||
+ }
|
||||
+
|
||||
+ h = NULL;
|
||||
+ if (rev == OMAP3430_REV_ES1_0 || rev == OMAP3430_REV_ES2_0 ||
|
||||
+ rev == OMAP3430_REV_ES2_1) {
|
||||
+ h = omap3430_pre_es3_hwmods;
|
||||
+ } else if (rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
|
||||
+ rev == OMAP3430_REV_ES3_1_2) {
|
||||
+ h = omap3430_es3plus_hwmods;
|
||||
+ };
|
||||
+
|
||||
if (h)
|
||||
r = omap_hwmod_register(h);
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 9607ccc0276ee734d3c1a58da0ab4ee18c7fbd29 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Wed, 28 Dec 2011 10:32:54 -0600
|
||||
Subject: [PATCH 6/6] OMAP: HWMOD: add es3plus to am36xx/am35xx
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 4 ++++
|
||||
1 files changed, 4 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
|
||||
index dcbcd64..3e1a489 100644
|
||||
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
|
||||
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
|
||||
@@ -3343,12 +3343,16 @@ static __initdata struct omap_hwmod *omap36xx_hwmods[] = {
|
||||
&omap36xx_sr2_hwmod,
|
||||
&omap3xxx_usbhsotg_hwmod,
|
||||
&omap3xxx_mailbox_hwmod,
|
||||
+ &omap3xxx_es3plus_mmc1_hwmod,
|
||||
+ &omap3xxx_es3plus_mmc2_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
static __initdata struct omap_hwmod *am35xx_hwmods[] = {
|
||||
&omap3xxx_dss_core_hwmod, /* XXX ??? */
|
||||
&am35xx_usbhsotg_hwmod,
|
||||
+ &omap3xxx_es3plus_mmc1_hwmod,
|
||||
+ &omap3xxx_es3plus_mmc2_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 70fa21fa8918eaa6eb4e7bc98be328412804f52c Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Tue, 2 Aug 2011 21:55:34 -0500
|
||||
Subject: [PATCH 1/3] panda: fix wl12xx regulator
|
||||
|
||||
pulled from: http://elinux.org/Panda_How_to_kernel_3_0_rel
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/twl-common.c | 1 +
|
||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
|
||||
index 10b20c6..5a1f23a 100644
|
||||
--- a/arch/arm/mach-omap2/twl-common.c
|
||||
+++ b/arch/arm/mach-omap2/twl-common.c
|
||||
@@ -281,6 +281,7 @@ static struct regulator_init_data omap4_vusb_idata = {
|
||||
static struct regulator_init_data omap4_clk32kg_idata = {
|
||||
.constraints = {
|
||||
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
||||
+ .always_on = true,
|
||||
},
|
||||
};
|
||||
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
From b0bd9a744aaaa95cae2640d00b3e046862399f4d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Fri, 16 Mar 2012 10:23:09 -0500
|
||||
Subject: [PATCH 2/3] panda enable bluetooth
|
||||
|
||||
The PandaBoard features a Texas Instruments WiLink7 Bluetooth
|
||||
chip, supported by the "btwilink" driver. The "uim" deamon
|
||||
requires sysfs entries that are filled in using this platform data.
|
||||
|
||||
Signed-off-by: Mircea Gherzan <mgherzan@gmail.com>
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap4panda.c | 21 +++++++++++++++++++--
|
||||
include/linux/ti_wilink_st.h | 2 ++
|
||||
2 files changed, 21 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
|
||||
index 51b1c93..9f133ce 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap4panda.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap4panda.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <linux/i2c/twl.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
#include <linux/regulator/fixed.h>
|
||||
+#include <linux/ti_wilink_st.h>
|
||||
#include <linux/wl12xx.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
@@ -56,15 +57,29 @@
|
||||
#define HDMI_GPIO_HPD 63 /* Hotplug detect */
|
||||
|
||||
/* wl127x BT, FM, GPS connectivity chip */
|
||||
-static int wl1271_gpios[] = {46, -1, -1};
|
||||
+static struct ti_st_plat_data wilink_platform_data = {
|
||||
+ .nshutdown_gpio = 46,
|
||||
+ .dev_name = "/dev/ttyO1",
|
||||
+ .flow_cntrl = 1,
|
||||
+ .baud_rate = 3000000,
|
||||
+ .chip_enable = NULL,
|
||||
+ .suspend = NULL,
|
||||
+ .resume = NULL,
|
||||
+};
|
||||
+
|
||||
static struct platform_device wl1271_device = {
|
||||
.name = "kim",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
- .platform_data = &wl1271_gpios,
|
||||
+ .platform_data = &wilink_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
+static struct platform_device btwilink_device = {
|
||||
+ .name = "btwilink",
|
||||
+ .id = -1,
|
||||
+};
|
||||
+
|
||||
static struct gpio_led gpio_leds[] = {
|
||||
{
|
||||
.name = "pandaboard::status1",
|
||||
@@ -91,9 +106,11 @@ static struct platform_device leds_gpio = {
|
||||
},
|
||||
};
|
||||
|
||||
+
|
||||
static struct platform_device *panda_devices[] __initdata = {
|
||||
&leds_gpio,
|
||||
&wl1271_device,
|
||||
+ &btwilink_device,
|
||||
};
|
||||
|
||||
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
|
||||
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
|
||||
index 2ef4385..3ca0269 100644
|
||||
--- a/include/linux/ti_wilink_st.h
|
||||
+++ b/include/linux/ti_wilink_st.h
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef TI_WILINK_ST_H
|
||||
#define TI_WILINK_ST_H
|
||||
|
||||
+#include <linux/skbuff.h>
|
||||
+
|
||||
/**
|
||||
* enum proto-type - The protocol on WiLink chips which share a
|
||||
* common physical interface like UART.
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From d55373d5923e5486c0f63c3fe907bb3b168673b4 Mon Sep 17 00:00:00 2001
|
||||
From: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
|
||||
Date: Tue, 25 Oct 2011 10:06:39 +0200
|
||||
Subject: [PATCH 3/3] ti-st/st-kim: fixing firmware path
|
||||
|
||||
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
|
||||
---
|
||||
drivers/misc/ti-st/st_kim.c | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
|
||||
index 43ef8d1..00c2ecd 100644
|
||||
--- a/drivers/misc/ti-st/st_kim.c
|
||||
+++ b/drivers/misc/ti-st/st_kim.c
|
||||
@@ -224,7 +224,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
|
||||
if (version & 0x8000)
|
||||
maj_ver |= 0x0008;
|
||||
|
||||
- sprintf(bts_scr_name, "TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver);
|
||||
+ sprintf(bts_scr_name, "ti-connectivity/TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver);
|
||||
|
||||
/* to be accessed later via sysfs entry */
|
||||
kim_gdata->version.full = version;
|
||||
@@ -267,7 +267,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
|
||||
long len = 0;
|
||||
unsigned char *ptr = NULL;
|
||||
unsigned char *action_ptr = NULL;
|
||||
- unsigned char bts_scr_name[30] = { 0 }; /* 30 char long bts scr name? */
|
||||
+ unsigned char bts_scr_name[50] = { 0 }; /* 50 char long bts scr name? */
|
||||
int wr_room_space;
|
||||
int cmd_size;
|
||||
unsigned long timeout;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
From 0d8912990ee89be4166d30d44ed5522590605a3d Mon Sep 17 00:00:00 2001
|
||||
From: Steve Sakoman <steve@sakoman.com>
|
||||
Date: Tue, 19 Jan 2010 21:19:15 -0800
|
||||
Subject: [PATCH 1/3] OMAP: DSS2: add bootarg for selecting svideo
|
||||
|
||||
OMAP: DSS2: add bootarg for selecting svideo or composite for tv output
|
||||
also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/video/omap2/dss/venc.c | 22 ++++++++++++++++++++++
|
||||
drivers/video/omap2/omapfb/omapfb-main.c | 10 +++++++++-
|
||||
2 files changed, 31 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
|
||||
index 7533458..b404095 100644
|
||||
--- a/drivers/video/omap2/dss/venc.c
|
||||
+++ b/drivers/video/omap2/dss/venc.c
|
||||
@@ -87,6 +87,11 @@
|
||||
#define VENC_OUTPUT_TEST 0xC8
|
||||
#define VENC_DAC_B__DAC_C 0xC8
|
||||
|
||||
+static char *tv_connection;
|
||||
+
|
||||
+module_param_named(tvcable, tv_connection, charp, 0);
|
||||
+MODULE_PARM_DESC(tvcable, "TV connection type (svideo, composite)");
|
||||
+
|
||||
struct venc_config {
|
||||
u32 f_control;
|
||||
u32 vidout_ctrl;
|
||||
@@ -474,6 +479,23 @@ static int venc_panel_probe(struct omap_dss_device *dssdev)
|
||||
{
|
||||
dssdev->panel.timings = omap_dss_pal_timings;
|
||||
|
||||
+ /* Allow the TV output to be overriden */
|
||||
+ if (tv_connection) {
|
||||
+ if (strcmp(tv_connection, "svideo") == 0) {
|
||||
+ printk(KERN_INFO
|
||||
+ "omapdss: tv output is svideo.\n");
|
||||
+ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO;
|
||||
+ } else if (strcmp(tv_connection, "composite") == 0) {
|
||||
+ printk(KERN_INFO
|
||||
+ "omapdss: tv output is composite.\n");
|
||||
+ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE;
|
||||
+ } else {
|
||||
+ printk(KERN_INFO
|
||||
+ "omapdss: unsupported output type'%s'.\n",
|
||||
+ tv_connection);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
|
||||
index 70aa47d..dd27b00 100644
|
||||
--- a/drivers/video/omap2/omapfb/omapfb-main.c
|
||||
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
|
||||
@@ -2091,7 +2091,15 @@ static int omapfb_mode_to_timings(const char *mode_str,
|
||||
int r;
|
||||
|
||||
#ifdef CONFIG_OMAP2_DSS_VENC
|
||||
- if (strcmp(mode_str, "pal") == 0) {
|
||||
+ if (strcmp(mode_str, "pal-16") == 0) {
|
||||
+ *timings = omap_dss_pal_timings;
|
||||
+ *bpp = 16;
|
||||
+ return 0;
|
||||
+ } else if (strcmp(mode_str, "ntsc-16") == 0) {
|
||||
+ *timings = omap_dss_ntsc_timings;
|
||||
+ *bpp = 16;
|
||||
+ return 0;
|
||||
+ } else if (strcmp(mode_str, "pal") == 0) {
|
||||
*timings = omap_dss_pal_timings;
|
||||
*bpp = 24;
|
||||
return 0;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 882636ad4c5577ae404c8215baf974f01a303b7f Mon Sep 17 00:00:00 2001
|
||||
From: Steve Sakoman <steve@sakoman.com>
|
||||
Date: Sat, 19 Dec 2009 06:52:43 -0800
|
||||
Subject: [PATCH 2/3] video: add timings for hd720
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/video/modedb.c | 4 ++++
|
||||
1 files changed, 4 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
|
||||
index a9a907c..5b686de 100644
|
||||
--- a/drivers/video/modedb.c
|
||||
+++ b/drivers/video/modedb.c
|
||||
@@ -103,6 +103,10 @@ static const struct fb_videomode modedb[] = {
|
||||
{ NULL, 70, 1024, 768, 13333, 144, 24, 29, 3, 136, 6, 0,
|
||||
FB_VMODE_NONINTERLACED },
|
||||
|
||||
+ /* 1280x720 @ 60 Hz, 45 kHz hsync, CEA 681-E Format 4 */
|
||||
+ { "hd720", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5, 0,
|
||||
+ FB_VMODE_NONINTERLACED },
|
||||
+
|
||||
/* 1280x1024 @ 87 Hz interlaced, 51 kHz hsync */
|
||||
{ NULL, 87, 1280, 1024, 12500, 56, 16, 128, 1, 216, 12, 0,
|
||||
FB_VMODE_INTERLACED },
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From c329d9c39d444411d2fbd76b38823ae3f524a688 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Sakoman <steve@sakoman.com>
|
||||
Date: Wed, 12 Jan 2011 05:54:55 -0800
|
||||
Subject: [PATCH 3/3] omap: mmc: Adjust dto to eliminate timeout errors
|
||||
|
||||
A number of SD card types were experiencing timeout errors. This
|
||||
could also lead to data corruption in some cases.
|
||||
|
||||
This fix proposed by Sukumar Ghoral of TI.
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
drivers/mmc/host/omap_hsmmc.c | 1 +
|
||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
|
||||
index d5fe43d..f190d63 100644
|
||||
--- a/drivers/mmc/host/omap_hsmmc.c
|
||||
+++ b/drivers/mmc/host/omap_hsmmc.c
|
||||
@@ -1513,6 +1513,7 @@ static void set_data_timeout(struct omap_hsmmc_host *host,
|
||||
cycle_ns = 1000000000 / (clk_get_rate(host->fclk) / clkd);
|
||||
timeout = timeout_ns / cycle_ns;
|
||||
timeout += timeout_clks;
|
||||
+ timeout *= 2;
|
||||
if (timeout) {
|
||||
while ((timeout & 0x80000000) == 0) {
|
||||
dto += 1;
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From 2b3c730256f7c9ab32beaccf33f44713d25f4a85 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Fri, 25 Feb 2011 10:41:07 -0600
|
||||
Subject: [PATCH 1/2] omap3: touchbook: remove mmc gpio_wp
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3touchbook.c | 8 +-------
|
||||
1 files changed, 1 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
|
||||
index a2d0d19..6b4cd92 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
|
||||
@@ -99,7 +99,7 @@ static struct omap2_hsmmc_info mmc[] = {
|
||||
{
|
||||
.mmc = 1,
|
||||
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
|
||||
- .gpio_wp = 29,
|
||||
+ .gpio_wp = -EINVAL,
|
||||
},
|
||||
{} /* Terminator */
|
||||
};
|
||||
@@ -117,12 +117,6 @@ static struct gpio_led gpio_leds[];
|
||||
static int touchbook_twl_gpio_setup(struct device *dev,
|
||||
unsigned gpio, unsigned ngpio)
|
||||
{
|
||||
- if (system_rev >= 0x20 && system_rev <= 0x34301000) {
|
||||
- omap_mux_init_gpio(23, OMAP_PIN_INPUT);
|
||||
- mmc[0].gpio_wp = 23;
|
||||
- } else {
|
||||
- omap_mux_init_gpio(29, OMAP_PIN_INPUT);
|
||||
- }
|
||||
/* gpio + 0 is "mmc0_cd" (input/IRQ) */
|
||||
mmc[0].gpio_cd = gpio + 0;
|
||||
omap2_hsmmc_init(mmc);
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 8b320724e0d7f17acb22d4af9ec73f0d28ed05d0 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Nelson <robertcnelson@gmail.com>
|
||||
Date: Fri, 25 Feb 2011 11:32:37 -0600
|
||||
Subject: [PATCH 2/2] omap3: touchbook: drop u-boot readonly
|
||||
|
||||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
|
||||
---
|
||||
arch/arm/mach-omap2/board-omap3touchbook.c | 1 -
|
||||
1 files changed, 0 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
|
||||
index 6b4cd92..5d209c1 100644
|
||||
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
|
||||
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
|
||||
@@ -74,7 +74,6 @@ static struct mtd_partition omap3touchbook_nand_partitions[] = {
|
||||
.name = "U-Boot",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
|
||||
.size = 15 * NAND_BLOCK_SIZE,
|
||||
- .mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
{
|
||||
.name = "U-Boot Env",
|
||||
--
|
||||
1.7.7.4
|
||||
|
||||
90
recipes-kernel/linux/linux-mainline_3.2.bb
Normal file
90
recipes-kernel/linux/linux-mainline_3.2.bb
Normal file
@@ -0,0 +1,90 @@
|
||||
require linux.inc
|
||||
|
||||
DESCRIPTION = "Linux kernel for TI processors"
|
||||
KERNEL_IMAGETYPE = "uImage"
|
||||
|
||||
COMPATIBLE_MACHINE = "(beagleboard)"
|
||||
|
||||
PV = "3.2.16"
|
||||
# v3.2.16 tag
|
||||
SRCREV_pn-${PN} = "b1be7dd1ec231ae751d0ce3acd0d2e5760704a6f"
|
||||
|
||||
# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
|
||||
MACHINE_KERNEL_PR_append = "a"
|
||||
|
||||
FILESPATH =. "${FILE_DIRNAME}/linux-mainline-3.2:${FILE_DIRNAME}/linux-mainline-3.2/${MACHINE}:"
|
||||
|
||||
SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git;branch=linux-3.2.y;protocol=git \
|
||||
file://distro/0001-kbuild-deb-pkg-set-host-machine-after-dpkg-gencontro.patch \
|
||||
file://omap_cpufreq/0001-cpufreq-OMAP-cleanup-for-multi-SoC-support-move-into.patch \
|
||||
file://omap_cpufreq/0002-cpufreq-OMAP-Add-SMP-support-for-OMAP4.patch \
|
||||
file://omap_cpufreq/0003-cpufreq-OMAP-Enable-all-CPUs-in-shared-policy-mask.patch \
|
||||
file://omap_cpufreq/0004-cpufreq-OMAP-notify-even-with-bad-boot-frequency.patch \
|
||||
file://omap_cpufreq/0005-cpufreq-OMAP-move-clk-name-decision-to-init.patch \
|
||||
file://omap_cpufreq/0006-cpufreq-OMAP-deny-initialization-if-no-mpudev.patch \
|
||||
file://omap_cpufreq/0007-cpufreq-OMAP-dont-support-freq_table.patch \
|
||||
file://omap_cpufreq/0008-cpufreq-OMAP-only-supports-OPP-library.patch \
|
||||
file://omap_cpufreq/0009-cpufreq-OMAP-put-clk-if-cpu_init-failed.patch \
|
||||
file://omap_cpufreq/0010-cpufreq-OMAP-fix-freq_table-leak.patch \
|
||||
file://omap_cpufreq/0011-cpufreq-OMAP-fixup-for-omap_device-changes-include-l.patch \
|
||||
file://micrel_zippy2/0001-ksz8851-eeprom-93cx6-add-drive_data.patch \
|
||||
file://micrel_zippy2/0002-ksz8851-eeprom-93cx6-add-eeprom_93cx6_write.patch \
|
||||
file://micrel_zippy2/0003-ksz8851-read_mac_addr.patch \
|
||||
file://micrel_zippy2/0004-ksz8851-93cx6-eeprom-access.patch \
|
||||
file://micrel_zippy2/0005-ks8851.h-it-helps-to-include-the-include-file.patch \
|
||||
file://micrel_zippy2/0006-ksz8851-move-to-header.patch \
|
||||
file://micrel_zippy2/0007-ksz8851-move-more-to-header.patch \
|
||||
file://micrel_zippy2/0008-ksz8851-share-ks8851_tx_hdr-union.patch \
|
||||
file://micrel_zippy2/0009-ksz8851-add-is_level_irq.patch \
|
||||
file://micrel_zippy2/0010-ksz8851-turn-off-hardware-interrupt-druing-receive-p.patch \
|
||||
file://micrel_zippy2/0011-ksz8851-make-sure-is-awake-before-writing-mac.patch \
|
||||
file://micrel_zippy2/0012-ksz8851-add-mutex-lock-unlock-to-ks.patch \
|
||||
file://micrel_zippy2/0013-ksz8851-add-ks8851_tx_check.patch \
|
||||
file://micrel_zippy2/0014-ksz8851-move-ks8851_set_powermode.patch \
|
||||
file://sakoman/0001-OMAP-DSS2-add-bootarg-for-selecting-svideo.patch \
|
||||
file://sakoman/0002-video-add-timings-for-hd720.patch \
|
||||
file://sakoman/0003-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch \
|
||||
file://beagle/0001-expansion-add-buddy-param-for-expansionboard-names.patch \
|
||||
file://beagle/0002-expansion-add-mmc-regulator-and-ds1307-rtc.patch \
|
||||
file://beagle/0003-expansion-add-zippy.patch \
|
||||
file://beagle/0004-expansion-add-zippy2.patch \
|
||||
file://beagle/0005-expansion-add-trainer.patch \
|
||||
file://beagle/0006-expansion-add-ulcd.patch \
|
||||
file://beagle/0007-beagleboard-reinstate-usage-of-hi-speed-PLL-divider.patch \
|
||||
file://beagle/0008-Turn-on-the-USB-regulator-on-Beagle-xM-explicitly.patch \
|
||||
file://beagle/0009-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch \
|
||||
file://beagle/0010-beagleboard-fix-uLCD7-support.patch \
|
||||
file://beagle/0011-default-to-fifo-mode-5-for-old-musb-beagles.patch \
|
||||
file://beagle/0012-backlight-Add-TLC59108-backlight-control-driver.patch \
|
||||
file://beagle/0013-tlc59108-adjust-for-beagleboard-uLCD7.patch \
|
||||
file://devkit8000/0001-arm-omap-devkit8000-for-lcd-use-samsung_lte_panel.patch \
|
||||
file://touchbook/0001-omap3-touchbook-remove-mmc-gpio_wp.patch \
|
||||
file://touchbook/0002-omap3-touchbook-drop-u-boot-readonly.patch \
|
||||
file://panda/0001-panda-fix-wl12xx-regulator.patch \
|
||||
file://panda/0002-panda-enable-bluetooth.patch \
|
||||
file://panda/0003-ti-st-st-kim-fixing-firmware-path.patch \
|
||||
file://omap_fixes/0001-omap3-Increase-limit-on-bootarg-mpurate.patch \
|
||||
file://omap_fixes/0002-ARM-OMAP-AM3517-3505-fix-crash-on-boot-due-to-incorr.patch \
|
||||
file://omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch \
|
||||
file://omap_fixes/0004-ARM-OMAP4-clock-Add-CPU-local-timer-clock-node.patch \
|
||||
file://omap_fixes/0005-ARM-OMAP3-hwmod-data-disable-multiblock-reads-on-MMC.patch \
|
||||
file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \
|
||||
\
|
||||
file://defconfig"
|
||||
|
||||
SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
# Sadly perf is broken:
|
||||
#| util/hist.c: In function '__hists__add_entry':
|
||||
#| util/hist.c:240:27: error: invalid type argument of '->' (have 'struct hist_entry')
|
||||
#| util/hist.c:241:23: error: invalid type argument of '->' (have 'struct hist_entry')
|
||||
do_compile_perf() {
|
||||
:
|
||||
}
|
||||
|
||||
do_install_perf() {
|
||||
:
|
||||
}
|
||||
Reference in New Issue
Block a user