* [PATCH 0/3] hisi_sas add hip07 support
@ 2016-09-20 10:48 John Garry
2016-09-20 10:48 ` [PATCH 1/3] devicetree: bindings: scsi: hisi_sas " John Garry
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: John Garry @ 2016-09-20 10:48 UTC (permalink / raw)
To: jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
martin.petersen-QHcLZuEGTsvQT0dZR+AlfA,
devicetree-u79uwXL29TY76Z2rM5mHXA, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A
Cc: linuxarm-hv44wF8Li93QT0dZR+AlfA,
zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A,
xuwei5-C8/M+/jPZTeaMJb+Lgu22Q, john.garry2-s/0ZXS5h9803lw97EnAbAg,
linux-scsi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, hare-IBi9RG/b67k, John Garry
This patchset introduces support for hip07 SoC.
The hip07 SoC has the same v2 hw as in hip06.
Support for different reference clock is required
as some SAS registers need be programmed
differently, depending on the refclock rate.
Related patchset:
- https://patchwork.ozlabs.org/patch/665172/
Once 4.9-rc1 is released, the D03 dts can be
updated for the refclock.
Note: there will be only 1 D03 dts, UEFI will update
the refclock rate for that board in the fdt at
boot time.
John Garry (3):
devicetree: bindings: scsi: hisi_sas add hip07 support
hisi_sas: add device tree support for hip07
hisi_sas: add v2 hw support for different refclk
Documentation/devicetree/bindings/scsi/hisilicon-sas.txt | 3 ++-
drivers/scsi/hisi_sas/hisi_sas.h | 2 ++
drivers/scsi/hisi_sas/hisi_sas_main.c | 7 +++++++
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 ++++++--
4 files changed, 17 insertions(+), 3 deletions(-)
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] devicetree: bindings: scsi: hisi_sas hip07 support
2016-09-20 10:48 [PATCH 0/3] hisi_sas add hip07 support John Garry
@ 2016-09-20 10:48 ` John Garry
[not found] ` <1474368540-186535-2-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-09-20 10:48 ` [PATCH 2/3] hisi_sas: add device tree support for hip07 John Garry
[not found] ` <1474368540-186535-1-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2 siblings, 1 reply; 6+ messages in thread
From: John Garry @ 2016-09-20 10:48 UTC (permalink / raw)
To: jejb, martin.petersen, devicetree, mark.rutland, robh+dt
Cc: linuxarm, zhangfei.gao, xuwei5, john.garry2, linux-scsi,
linux-kernel, hare, John Garry, Xiang Chen
Add support for hip07 chipset to bindings.
Chipset hip07 has v2 hw.
The sas-v2 quirk amt is expanded to cover hip07.
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
Documentation/devicetree/bindings/scsi/hisilicon-sas.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
index bf2411f..e604527 100644
--- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
+++ b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
@@ -6,6 +6,7 @@ Main node required properties:
- compatible : value should be as follows:
(a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset
(b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset
+ (c) "hisilicon,hip07-sas-v2" for v2 hw in hip07 chipset
- sas-addr : array of 8 bytes for host SAS address
- reg : Address and length of the SAS register
- hisilicon,sas-syscon: phandle of syscon used for sas control
@@ -47,7 +48,7 @@ Main node required properties:
increasing order.
Optional main node properties:
- - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
+ - hip06/7-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
"am-max-transmissions" limitation.
Example:
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] hisi_sas: add device tree support for hip07
2016-09-20 10:48 [PATCH 0/3] hisi_sas add hip07 support John Garry
2016-09-20 10:48 ` [PATCH 1/3] devicetree: bindings: scsi: hisi_sas " John Garry
@ 2016-09-20 10:48 ` John Garry
[not found] ` <1474368540-186535-1-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2016-09-20 10:48 UTC (permalink / raw)
To: jejb, martin.petersen, devicetree, mark.rutland, robh+dt
Cc: linuxarm, zhangfei.gao, xuwei5, john.garry2, linux-scsi,
linux-kernel, hare, John Garry, Xiang Chen
Chipset hip07 incorporates v2 hw.
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 9825a3f..c1e3aa7 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -777,7 +777,8 @@ static void init_reg_v2_hw(struct hisi_hba *hisi_hba)
/* Global registers init */
/* Deal with am-max-transmissions quirk */
- if (device_property_present(dev, "hip06-sas-v2-quirk-amt")) {
+ if (device_property_present(dev, "hip06-sas-v2-quirk-amt") ||
+ device_property_present(dev, "hip07-sas-v2-quirk-amt")) {
hisi_sas_write32(hisi_hba, AM_CFG_MAX_TRANS, 0x2020);
hisi_sas_write32(hisi_hba, AM_CFG_SINGLE_PORT_MAX_TRANS,
0x2020);
@@ -2319,6 +2320,7 @@ static int hisi_sas_v2_remove(struct platform_device *pdev)
static const struct of_device_id sas_v2_of_match[] = {
{ .compatible = "hisilicon,hip06-sas-v2",},
+ { .compatible = "hisilicon,hip07-sas-v2",},
{},
};
MODULE_DEVICE_TABLE(of, sas_v2_of_match);
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] hisi_sas: add v2 hw support for different refclk
[not found] ` <1474368540-186535-1-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2016-09-20 10:49 ` John Garry
0 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2016-09-20 10:49 UTC (permalink / raw)
To: jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
martin.petersen-QHcLZuEGTsvQT0dZR+AlfA,
devicetree-u79uwXL29TY76Z2rM5mHXA, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A
Cc: linuxarm-hv44wF8Li93QT0dZR+AlfA,
zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A,
xuwei5-C8/M+/jPZTeaMJb+Lgu22Q, john.garry2-s/0ZXS5h9803lw97EnAbAg,
linux-scsi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, hare-IBi9RG/b67k, John Garry,
Xiang Chen
Some hip06 D03 and hip07 D05 boards have different
reference clock frequencies for the SAS controller.
Register PHY_CTRL needs to be programmed differently
according to this frequency, so add support for this.
The default register setting in PHY_CTRL is for 50MHz,
so only update this register when the refclk frequency
is 66MHz.
The register cannot be set according to hip06 or hip07
as some variants of hip06 D03 board are 50MHz and some
are 66MHz (early editions). All hip07 D05 are 50MHz.
For ACPI we expect the _RST handler to set the correct
value for PHY_CTRL (we take an alternate approach for
DT and ACPI as ACPI does not support fixed-clock device
type).
Signed-off-by: John Garry <john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Xiang Chen <chenxiang66-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
---
drivers/scsi/hisi_sas/hisi_sas.h | 2 ++
drivers/scsi/hisi_sas/hisi_sas_main.c | 7 +++++++
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index 72c9852..64046c5 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -13,6 +13,7 @@
#define _HISI_SAS_H_
#include <linux/acpi.h>
+#include <linux/clk.h>
#include <linux/dmapool.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
@@ -183,6 +184,7 @@ struct hisi_hba {
u32 ctrl_reset_reg;
u32 ctrl_reset_sts_reg;
u32 ctrl_clock_ena_reg;
+ u32 refclk_frequency_mhz;
u8 sas_addr[SAS_ADDR_SIZE];
int n_phy;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 2f872f7..0bc3165 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1396,6 +1396,7 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
struct hisi_hba *hisi_hba;
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
+ struct clk *refclk;
shost = scsi_host_alloc(&hisi_sas_sht, sizeof(*hisi_hba));
if (!shost)
@@ -1432,6 +1433,12 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
goto err_out;
}
+ refclk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(refclk))
+ dev_info(dev, "no ref clk property\n");
+ else
+ hisi_hba->refclk_frequency_mhz = clk_get_rate(refclk) / 1000000;
+
if (device_property_read_u32(dev, "phy-count", &hisi_hba->n_phy))
goto err_out;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index c1e3aa7..7014d99 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -837,7 +837,9 @@ static void init_reg_v2_hw(struct hisi_hba *hisi_hba)
hisi_sas_phy_write32(hisi_hba, i, SL_RX_BCAST_CHK_MSK, 0x0);
hisi_sas_phy_write32(hisi_hba, i, CHL_INT_COAL_EN, 0x0);
hisi_sas_phy_write32(hisi_hba, i, PHYCTRL_OOB_RESTART_MSK, 0x0);
- hisi_sas_phy_write32(hisi_hba, i, PHY_CTRL, 0x199B694);
+ if (hisi_hba->refclk_frequency_mhz == 66)
+ hisi_sas_phy_write32(hisi_hba, i, PHY_CTRL, 0x199B694);
+ /* else, do nothing -> leave it how you found it */
}
for (i = 0; i < hisi_hba->queue_count; i++) {
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] devicetree: bindings: scsi: hisi_sas hip07 support
[not found] ` <1474368540-186535-2-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2016-09-23 18:36 ` Rob Herring
2016-09-24 18:51 ` John Garry
0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2016-09-23 18:36 UTC (permalink / raw)
To: John Garry
Cc: jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
martin.petersen-QHcLZuEGTsvQT0dZR+AlfA,
devicetree-u79uwXL29TY76Z2rM5mHXA, mark.rutland-5wv7dgnIgG8,
linuxarm-hv44wF8Li93QT0dZR+AlfA,
zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A,
xuwei5-C8/M+/jPZTeaMJb+Lgu22Q, john.garry2-s/0ZXS5h9803lw97EnAbAg,
linux-scsi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, hare-IBi9RG/b67k, Xiang Chen
On Tue, Sep 20, 2016 at 06:48:58PM +0800, John Garry wrote:
> Add support for hip07 chipset to bindings.
>
> Chipset hip07 has v2 hw.
>
> The sas-v2 quirk amt is expanded to cover hip07.
>
> Signed-off-by: John Garry <john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Xiang Chen <chenxiang66-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
> ---
> Documentation/devicetree/bindings/scsi/hisilicon-sas.txt | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
> index bf2411f..e604527 100644
> --- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
> +++ b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
> @@ -6,6 +6,7 @@ Main node required properties:
> - compatible : value should be as follows:
> (a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset
> (b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset
> + (c) "hisilicon,hip07-sas-v2" for v2 hw in hip07 chipset
> - sas-addr : array of 8 bytes for host SAS address
> - reg : Address and length of the SAS register
> - hisilicon,sas-syscon: phandle of syscon used for sas control
> @@ -47,7 +48,7 @@ Main node required properties:
> increasing order.
>
> Optional main node properties:
> - - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
> + - hip06/7-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
Just use the existing property name for hip07.
> "am-max-transmissions" limitation.
>
> Example:
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] devicetree: bindings: scsi: hisi_sas hip07 support
2016-09-23 18:36 ` Rob Herring
@ 2016-09-24 18:51 ` John Garry
0 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2016-09-24 18:51 UTC (permalink / raw)
To: Rob Herring
Cc: jejb, martin.petersen, devicetree, mark.rutland, linuxarm,
zhangfei.gao, xuwei5, john.garry2, linux-scsi, linux-kernel, hare,
Xiang Chen
On 23/09/2016 19:36, Rob Herring wrote:
> On Tue, Sep 20, 2016 at 06:48:58PM +0800, John Garry wrote:
>> Add support for hip07 chipset to bindings.
>>
>> Chipset hip07 has v2 hw.
>>
>> The sas-v2 quirk amt is expanded to cover hip07.
>>
>> Signed-off-by: John Garry <john.garry@huawei.com>
>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>> ---
>> Documentation/devicetree/bindings/scsi/hisilicon-sas.txt | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
>> index bf2411f..e604527 100644
>> --- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
>> +++ b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
>> @@ -6,6 +6,7 @@ Main node required properties:
>> - compatible : value should be as follows:
>> (a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset
>> (b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset
>> + (c) "hisilicon,hip07-sas-v2" for v2 hw in hip07 chipset
>> - sas-addr : array of 8 bytes for host SAS address
>> - reg : Address and length of the SAS register
>> - hisilicon,sas-syscon: phandle of syscon used for sas control
>> @@ -47,7 +48,7 @@ Main node required properties:
>> increasing order.
>>
>> Optional main node properties:
>> - - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
>> + - hip06/7-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
>
> Just use the existing property name for hip07.
OK, but you mean existing hip06 property (hip06-sas-v2-quirk-amt), right?
>
>> "am-max-transmissions" limitation.
>>
>> Example:
>> --
>> 1.9.1
>>
>
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-09-24 18:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20 10:48 [PATCH 0/3] hisi_sas add hip07 support John Garry
2016-09-20 10:48 ` [PATCH 1/3] devicetree: bindings: scsi: hisi_sas " John Garry
[not found] ` <1474368540-186535-2-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-09-23 18:36 ` Rob Herring
2016-09-24 18:51 ` John Garry
2016-09-20 10:48 ` [PATCH 2/3] hisi_sas: add device tree support for hip07 John Garry
[not found] ` <1474368540-186535-1-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-09-20 10:49 ` [PATCH 3/3] hisi_sas: add v2 hw support for different refclk John Garry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).