fix uno/ultimo harddisk detection
authorhschang <chang@dev3>
Wed, 6 Aug 2014 07:46:17 +0000 (16:46 +0900)
committerhschang <chang@dev3>
Wed, 6 Aug 2014 07:46:56 +0000 (16:46 +0900)
meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch [new file with mode: 0644]
meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm7335.patch [deleted file]
meta-bsp/bm750/recipes/linux/linux-vuplus_3.9.6.bbappend
meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch [new file with mode: 0644]
meta-bsp/vuultimo/recipes/linux/linux-vuplus_3.9.6.bbappend
meta-bsp/vuuno/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch [new file with mode: 0644]
meta-bsp/vuuno/recipes/linux/linux-vuplus_3.9.6.bbappend

diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch b/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch
new file mode 100644 (file)
index 0000000..cbfc4b7
--- /dev/null
@@ -0,0 +1,55 @@
+diff --git a/drivers/ata/sata_brcmstb.c b/drivers/ata/sata_brcmstb.c
+index 7ba20e0..1e2e947 100644
+--- a/drivers/ata/sata_brcmstb.c
++++ b/drivers/ata/sata_brcmstb.c
+@@ -330,6 +330,22 @@ static void brcm_EnableOOBWindowFix(void __iomem *mmio_base, int port)
+       mdio_write_reg(mmio_base, port, 0x0D, sval);
+ }
++static void brcm_Enable256AlignDetection(void __iomem *mmio_base, int port)
++{
++        uint32_t tmp32;
++        void __iomem *port_mmio;
++
++        port_mmio = PORT_BASE(mmio_base, port);
++
++        tmp32 = readl(port_mmio + K2_SATA_SICR1_OFFSET);
++        tmp32 |= 0x08000000;
++        writel(tmp32, port_mmio + K2_SATA_SICR1_OFFSET);
++
++        tmp32 = readl(port_mmio + K2_SATA_SICR2_OFFSET);
++        tmp32 |= 0x00800000;
++        writel(tmp32, port_mmio + K2_SATA_SICR2_OFFSET);
++}
++
+ static void brcm_AnalogReset(void __iomem *mmio_base, int port)
+ {
+       /* do analog reset */
+@@ -385,6 +401,8 @@ static void brcm_InitSata_1_5Gb(void __iomem *mmio_base, int port)
+       brcm_SetPllTxRxCtrl(mmio_base, port);
+       brcm_EnableOOBWindowFix(mmio_base, port);
++      brcm_Enable256AlignDetection(mmio_base, port);
++
+       if (!port) {
+ #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
+               /* use 75Mhz PLL clock */
+@@ -446,6 +464,8 @@ static void brcm_InitSata2_3Gb(void __iomem *mmio_base, int port)
+       brcm_SetPllTxRxCtrl(mmio_base, port);
+       brcm_EnableOOBWindowFix(mmio_base, port);
++      brcm_Enable256AlignDetection(mmio_base, port);
++
+       if (!port) {
+ #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
+               /* use 75Mhz PLL clock */
+@@ -1135,7 +1155,9 @@ static int k2_sata_resume(struct device *dev)
+               ap = host->ports[i];
+               ata_for_each_link(link, ap, EDGE) {
++                      spin_unlock_irqrestore(&hp->lock, flags);
+                       sata_std_hardreset(link, NULL, 1000);
++                      spin_lock_irqsave(&hp->lock, flags);
+               }
+       }
diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm7335.patch b/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm7335.patch
deleted file mode 100644 (file)
index cbfc4b7..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-diff --git a/drivers/ata/sata_brcmstb.c b/drivers/ata/sata_brcmstb.c
-index 7ba20e0..1e2e947 100644
---- a/drivers/ata/sata_brcmstb.c
-+++ b/drivers/ata/sata_brcmstb.c
-@@ -330,6 +330,22 @@ static void brcm_EnableOOBWindowFix(void __iomem *mmio_base, int port)
-       mdio_write_reg(mmio_base, port, 0x0D, sval);
- }
-+static void brcm_Enable256AlignDetection(void __iomem *mmio_base, int port)
-+{
-+        uint32_t tmp32;
-+        void __iomem *port_mmio;
-+
-+        port_mmio = PORT_BASE(mmio_base, port);
-+
-+        tmp32 = readl(port_mmio + K2_SATA_SICR1_OFFSET);
-+        tmp32 |= 0x08000000;
-+        writel(tmp32, port_mmio + K2_SATA_SICR1_OFFSET);
-+
-+        tmp32 = readl(port_mmio + K2_SATA_SICR2_OFFSET);
-+        tmp32 |= 0x00800000;
-+        writel(tmp32, port_mmio + K2_SATA_SICR2_OFFSET);
-+}
-+
- static void brcm_AnalogReset(void __iomem *mmio_base, int port)
- {
-       /* do analog reset */
-@@ -385,6 +401,8 @@ static void brcm_InitSata_1_5Gb(void __iomem *mmio_base, int port)
-       brcm_SetPllTxRxCtrl(mmio_base, port);
-       brcm_EnableOOBWindowFix(mmio_base, port);
-+      brcm_Enable256AlignDetection(mmio_base, port);
-+
-       if (!port) {
- #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
-               /* use 75Mhz PLL clock */
-@@ -446,6 +464,8 @@ static void brcm_InitSata2_3Gb(void __iomem *mmio_base, int port)
-       brcm_SetPllTxRxCtrl(mmio_base, port);
-       brcm_EnableOOBWindowFix(mmio_base, port);
-+      brcm_Enable256AlignDetection(mmio_base, port);
-+
-       if (!port) {
- #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
-               /* use 75Mhz PLL clock */
-@@ -1135,7 +1155,9 @@ static int k2_sata_resume(struct device *dev)
-               ap = host->ports[i];
-               ata_for_each_link(link, ap, EDGE) {
-+                      spin_unlock_irqrestore(&hp->lock, flags);
-                       sata_std_hardreset(link, NULL, 1000);
-+                      spin_lock_irqsave(&hp->lock, flags);
-               }
-       }
index 25ffa7b..45f7298 100644 (file)
@@ -1,6 +1,6 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:"
 
-PR .= "-bsp2"
+PR .= "-bsp3"
 SRC_URI += "\
-        file://linux-sata_bcm7335.patch;patch=1;pnum=1 \
+        file://linux-sata_bcm.patch \
 "
diff --git a/meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch b/meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch
new file mode 100644 (file)
index 0000000..cbfc4b7
--- /dev/null
@@ -0,0 +1,55 @@
+diff --git a/drivers/ata/sata_brcmstb.c b/drivers/ata/sata_brcmstb.c
+index 7ba20e0..1e2e947 100644
+--- a/drivers/ata/sata_brcmstb.c
++++ b/drivers/ata/sata_brcmstb.c
+@@ -330,6 +330,22 @@ static void brcm_EnableOOBWindowFix(void __iomem *mmio_base, int port)
+       mdio_write_reg(mmio_base, port, 0x0D, sval);
+ }
++static void brcm_Enable256AlignDetection(void __iomem *mmio_base, int port)
++{
++        uint32_t tmp32;
++        void __iomem *port_mmio;
++
++        port_mmio = PORT_BASE(mmio_base, port);
++
++        tmp32 = readl(port_mmio + K2_SATA_SICR1_OFFSET);
++        tmp32 |= 0x08000000;
++        writel(tmp32, port_mmio + K2_SATA_SICR1_OFFSET);
++
++        tmp32 = readl(port_mmio + K2_SATA_SICR2_OFFSET);
++        tmp32 |= 0x00800000;
++        writel(tmp32, port_mmio + K2_SATA_SICR2_OFFSET);
++}
++
+ static void brcm_AnalogReset(void __iomem *mmio_base, int port)
+ {
+       /* do analog reset */
+@@ -385,6 +401,8 @@ static void brcm_InitSata_1_5Gb(void __iomem *mmio_base, int port)
+       brcm_SetPllTxRxCtrl(mmio_base, port);
+       brcm_EnableOOBWindowFix(mmio_base, port);
++      brcm_Enable256AlignDetection(mmio_base, port);
++
+       if (!port) {
+ #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
+               /* use 75Mhz PLL clock */
+@@ -446,6 +464,8 @@ static void brcm_InitSata2_3Gb(void __iomem *mmio_base, int port)
+       brcm_SetPllTxRxCtrl(mmio_base, port);
+       brcm_EnableOOBWindowFix(mmio_base, port);
++      brcm_Enable256AlignDetection(mmio_base, port);
++
+       if (!port) {
+ #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
+               /* use 75Mhz PLL clock */
+@@ -1135,7 +1155,9 @@ static int k2_sata_resume(struct device *dev)
+               ap = host->ports[i];
+               ata_for_each_link(link, ap, EDGE) {
++                      spin_unlock_irqrestore(&hp->lock, flags);
+                       sata_std_hardreset(link, NULL, 1000);
++                      spin_lock_irqsave(&hp->lock, flags);
+               }
+       }
index b531b5b..a8ca9f0 100644 (file)
@@ -1,9 +1,10 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:"
 
-PR .= "-bsp1"
+PR .= "-bsp2"
 
 SRC_URI += "\
-        file://vu_ultimo_fixed_mtd.patch;patch=1;pnum=1 \
+        file://vu_ultimo_fixed_mtd.patch \
+        file://linux-sata_bcm.patch \
         "       
 
 
diff --git a/meta-bsp/vuuno/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch b/meta-bsp/vuuno/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch
new file mode 100644 (file)
index 0000000..cbfc4b7
--- /dev/null
@@ -0,0 +1,55 @@
+diff --git a/drivers/ata/sata_brcmstb.c b/drivers/ata/sata_brcmstb.c
+index 7ba20e0..1e2e947 100644
+--- a/drivers/ata/sata_brcmstb.c
++++ b/drivers/ata/sata_brcmstb.c
+@@ -330,6 +330,22 @@ static void brcm_EnableOOBWindowFix(void __iomem *mmio_base, int port)
+       mdio_write_reg(mmio_base, port, 0x0D, sval);
+ }
++static void brcm_Enable256AlignDetection(void __iomem *mmio_base, int port)
++{
++        uint32_t tmp32;
++        void __iomem *port_mmio;
++
++        port_mmio = PORT_BASE(mmio_base, port);
++
++        tmp32 = readl(port_mmio + K2_SATA_SICR1_OFFSET);
++        tmp32 |= 0x08000000;
++        writel(tmp32, port_mmio + K2_SATA_SICR1_OFFSET);
++
++        tmp32 = readl(port_mmio + K2_SATA_SICR2_OFFSET);
++        tmp32 |= 0x00800000;
++        writel(tmp32, port_mmio + K2_SATA_SICR2_OFFSET);
++}
++
+ static void brcm_AnalogReset(void __iomem *mmio_base, int port)
+ {
+       /* do analog reset */
+@@ -385,6 +401,8 @@ static void brcm_InitSata_1_5Gb(void __iomem *mmio_base, int port)
+       brcm_SetPllTxRxCtrl(mmio_base, port);
+       brcm_EnableOOBWindowFix(mmio_base, port);
++      brcm_Enable256AlignDetection(mmio_base, port);
++
+       if (!port) {
+ #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
+               /* use 75Mhz PLL clock */
+@@ -446,6 +464,8 @@ static void brcm_InitSata2_3Gb(void __iomem *mmio_base, int port)
+       brcm_SetPllTxRxCtrl(mmio_base, port);
+       brcm_EnableOOBWindowFix(mmio_base, port);
++      brcm_Enable256AlignDetection(mmio_base, port);
++
+       if (!port) {
+ #ifdef CONFIG_BRCM_SATA_75MHZ_PLL
+               /* use 75Mhz PLL clock */
+@@ -1135,7 +1155,9 @@ static int k2_sata_resume(struct device *dev)
+               ap = host->ports[i];
+               ata_for_each_link(link, ap, EDGE) {
++                      spin_unlock_irqrestore(&hp->lock, flags);
+                       sata_std_hardreset(link, NULL, 1000);
++                      spin_lock_irqsave(&hp->lock, flags);
+               }
+       }
index bc27547..f4253c8 100644 (file)
@@ -1,6 +1,7 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:"
 
-PR .= "-bsp1"
+PR .= "-bsp2"
 
 SRC_URI += "\
+       file://linux-sata_bcm.patch \
 "