* Re: [PATCH v20 2/4] mailbox: mediatek: Add Mediatek CMDQ driver
From: Jassi Brar @ 2017-01-26 4:38 UTC (permalink / raw)
To: HS Liao
Cc: Rob Herring, Matthias Brugger, Daniel Kurtz, Sascha Hauer,
Devicetree List, Linux Kernel Mailing List,
linux-arm-kernel@lists.infradead.org, linux-mediatek,
srv_heupstream, Sascha Hauer, Philipp Zabel, Nicolas Boichat,
CK HU, cawa cheng, Bibby Hsieh, YT Shen, Daoyuan Huang, Damon Chu
In-Reply-To: <1483499169-16329-3-git-send-email-hs.liao@mediatek.com>
On Wed, Jan 4, 2017 at 8:36 AM, HS Liao <hs.liao@mediatek.com> wrote:
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> new file mode 100644
> index 0000000..747bcd3
> --- /dev/null
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
...
> +static void cmdq_task_exec(struct cmdq_pkt *pkt, struct cmdq_thread *thread)
> +{
> + struct cmdq *cmdq;
> + struct cmdq_task *task;
> + unsigned long curr_pa, end_pa;
> +
> + cmdq = dev_get_drvdata(thread->chan->mbox->dev);
> +
> + /* Client should not flush new tasks if suspended. */
> + WARN_ON(cmdq->suspended);
> +
> + task = kzalloc(sizeof(*task), GFP_ATOMIC);
> + task->cmdq = cmdq;
> + INIT_LIST_HEAD(&task->list_entry);
> + task->pa_base = dma_map_single(cmdq->mbox.dev, pkt->va_base,
> + pkt->cmd_buf_size, DMA_TO_DEVICE);
>
You seem to parse the requests and responses, that should ideally be
done in client driver.
Also, we are here in atomic context, can you move it in client driver
(before the spin_lock)?
Maybe by adding a new 'pa_base' member as well in 'cmdq_pkt'.
....
> +
> + cmdq->mbox.num_chans = CMDQ_THR_MAX_COUNT;
> + cmdq->mbox.ops = &cmdq_mbox_chan_ops;
> + cmdq->mbox.of_xlate = cmdq_xlate;
> +
> + /* make use of TXDONE_BY_ACK */
> + cmdq->mbox.txdone_irq = false;
> + cmdq->mbox.txdone_poll = false;
> +
> + for (i = 0; i < ARRAY_SIZE(cmdq->thread); i++) {
>
You mean i < CMDQ_THR_MAX_COUNT
> + cmdq->thread[i].base = cmdq->base + CMDQ_THR_BASE +
> + CMDQ_THR_SIZE * i;
> + INIT_LIST_HEAD(&cmdq->thread[i].task_busy_list);
>
You seem the queue mailbox requests in this controller driver? why not
use the mailbox api for that?
> + init_timer(&cmdq->thread[i].timeout);
> + cmdq->thread[i].timeout.function = cmdq_thread_handle_timeout;
> + cmdq->thread[i].timeout.data = (unsigned long)&cmdq->thread[i];
>
Here again... you seem to ignore the polling mechanism provided by the
mailbox api, and implement your own.
> diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h b/include/linux/mailbox/mtk-cmdq-mailbox.h
> new file mode 100644
> index 0000000..3433c64
> --- /dev/null
> +++ b/include/linux/mailbox/mtk-cmdq-mailbox.h
....
> +
> +struct cmdq_pkt {
> + void *va_base;
>
maybe add 'pa_base' here so you don't have to do dma_map_single() in send_data
> + size_t cmd_buf_size; /* command occupied size */
> + size_t buf_size; /* real buffer size */
> + struct cmdq_task_cb cb;
> +};
> +
> +#endif /* __MTK_CMDQ_MAILBOX_H__ */
> --
> 1.9.1
>
^ permalink raw reply
* Re: [PATCH 2/2] net-next: ethernet: mediatek: change the compatible string
From: David Miller @ 2017-01-25 19:36 UTC (permalink / raw)
To: john-Pj+rj9U5foFAfugRpC6u6w
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, sean.wang-NuS5LvNUpcJWk0Htik3J/w,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <1485332455-34743-2-git-send-email-john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>
From: John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>
Date: Wed, 25 Jan 2017 09:20:55 +0100
> When the binding was defined, I was not aware that mt2701 was an earlier
> version of the SoC. For sake of consistency, the ethernet driver should
> use mt2701 inside the compat string as this is the earliest SoC with the
> ethernet core.
>
> The ethernet driver is currently of no real use until we finish and
> upstream the DSA driver. There are no users of this binding yet. It should
> be safe to fix this now before it is too late and we need to provide
> backward compatibility for the mt7623-eth compat string.
>
> Reported-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Signed-off-by: John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>
Applied.
--
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
* Re: [PATCH 1/2] Documentation: devicetree: change the mediatek ethernet compatible string
From: David Miller @ 2017-01-25 19:36 UTC (permalink / raw)
To: john; +Cc: robh+dt, matthias.bgg, netdev, sean.wang, devicetree,
linux-mediatek
In-Reply-To: <1485332455-34743-1-git-send-email-john@phrozen.org>
From: John Crispin <john@phrozen.org>
Date: Wed, 25 Jan 2017 09:20:54 +0100
> When the binding was defined, I was not aware that mt2701 was an earlier
> version of the SoC. For sake of consistency, the ethernet driver should
> use mt2701 inside the compat string as this is the earliest SoC with the
> ethernet core.
>
> The ethernet driver is currently of no real use until we finish and
> upstream the DSA driver. There are no users of this binding yet. It should
> be safe to fix this now before it is too late and we need to provide
> backward compatibility for the mt7623-eth compat string.
>
> Reported-by: Sean Wang <sean.wang@mediatek.com>
> Signed-off-by: John Crispin <john@phrozen.org>
Applied.
^ permalink raw reply
* Re: [PATCH] spi: mediatek: Manually set dma_ops for spi_master device
From: Robin Murphy @ 2017-01-25 17:59 UTC (permalink / raw)
To: Daniel Kurtz
Cc: Leilk Liu, open list, open list:SPI SUBSYSTEM, Matthias Brugger,
Mark Brown, moderated list:ARM/Mediatek SoC support, groeck,
Dmitry Torokhov, moderated list:ARM/Mediatek SoC support
In-Reply-To: <CAGS+omBV3o1hergAjU3_9ok5NTmk8Z315zo3yW9jU_jA+reZCQ@mail.gmail.com>
On 25/01/17 10:24, Daniel Kurtz wrote:
> Hi Robin,
>
> On Tue, Jan 24, 2017 at 11:14 PM, Robin Murphy <robin.murphy@arm.com> wrote:
>> Hi Dan,
>
> [snip...]
>
>>> And I really don't know why we needed to set the coherent_dma_mask to 0 to
>>> avoid SPI transaction errors.
>>
>> Following what I mentioned above, "git grep dma_alloc drivers/spi" makes
>> it seem like coherent DMA isn't used anywhere relevant, which is rather
>> puzzling. Unless of course somewhere along the line somebody's done the
>> dev->dma_mask = &dev->dma_coherent_mask hack, with the result that
>> writing one mask hits both, making *all* DMA fail and big transfers fall
>> back to PIO.
>
> You mean this last line?
>
>>> @@ -575,6 +576,10 @@ static int mtk_spi_probe(struct platform_device *pdev)
>>> goto err_put_master;
>>> }
>>>
>>> + /* Call of_dma_configure to set up spi_master's dma_ops */
>>> + of_dma_configure(&master->dev, master->dev.of_node);
>>> + /* But explicitly set the coherent_dma_mask to 0 */
>>> + master->dev.coherent_dma_mask = 0;
>>> if (!pdev->dev.dma_mask)
>>> pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
> ^^^^^
Ha, I totally failed to spot that!
> As predicted, setting the dma_mask = 0 causes "all DMA to fail". In
> particular, dma_capable() always returns false, so
> swiotlb_map_sg_attrs() takes the map_single() path, instead of just
> assigning:
>
> sg->dma_address = dev_addr;
>
> swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
> enum dma_data_direction dir, unsigned long attrs)
> {
> struct scatterlist *sg;
> int i;
>
> BUG_ON(dir == DMA_NONE);
>
> for_each_sg(sgl, sg, nelems, i) {
> phys_addr_t paddr = sg_phys(sg);
> dma_addr_t dev_addr = phys_to_dma(hwdev, paddr);
>
> if (swiotlb_force == SWIOTLB_FORCE ||
> !dma_capable(hwdev, dev_addr, sg->length)) {
> phys_addr_t map = map_single(hwdev, sg_phys(sg),
> sg->length, dir, attrs);
> ...
> }
> sg->dma_address = phys_to_dma(hwdev, map);
> } else
> sg->dma_address = dev_addr;
> sg_dma_len(sg) = sg->length;
> }
> return nelems;
> }
>
> So, I think this means that the only reason the MTK SPI driver ever
> worked before was that it was tested on an older kernel, so the
> spi_master was defaulting to swiotlb_dma_ops with a 0 dma_mask, and
> therefore it was using SWIOTLB bounce buffers (via 'map_single'), and
> not actually ever doing real DMA.
Well, it's still "real DMA" if the device is able to slurp data out of
the bounce buffer. That suggests there might be some mismatch between
the default DMA mask it's getting given and the actual hardware
capability (i.e. the bounce buffer happens to fall somewhere accessible,
but other addresses may not be) - is crazy 33-bit mode involved here?
Robin.
> I'm in a bit over my head here, any suggestions on how to fix this?
>
> -Dan
>
^ permalink raw reply
* [GIT PULL] arm64: mediatek: dts changes for v4.11
From: Matthias Brugger @ 2017-01-25 13:48 UTC (permalink / raw)
To: arm
Cc: Dawei Chien, Daniel Kurtz,
moderated list:ARM/Mediatek SoC support, Bibby Hsieh,
linux-arm-kernel@lists.infradead.org
Hi Arnd, hi Olof,
Please merge the following changes for 64-bit dts files.
Thanks,
Matthias
---
The following changes since commit 7ce7d89f48834cefece7804d38fc5d85382edf77:
Linux 4.10-rc1 (2016-12-25 16:13:08 -0800)
are available in the git repository at:
https://github.com/mbgg/linux-mediatek.git tags/v4.10-next-dts
for you to fetch changes up to 6de18454e06f4eb9c0c7008d3999cd1d0b289d42:
arm64: dts: mt8173: add node for thermal calibration (2017-01-23
10:18:13 +0100)
----------------------------------------------------------------
For mt8173:
- set mm_sel clock to 400 MHz to support 4K HDMI
- adjust power efficiency between the little and big cores
- add a node for thermal calibration via e-fuse data
----------------------------------------------------------------
Bibby Hsieh (1):
arm64: dts: mt8173: add mmsel clocks for 4K support
Daniel Kurtz (1):
arm64: dts: mt8173: Fix cpu_thermal cooling-maps contributions
dawei.chien@mediatek.com (1):
arm64: dts: mt8173: add node for thermal calibration
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
^ permalink raw reply
* [GIT PULL] arm: mediatek: dts changes for v4.11
From: Matthias Brugger @ 2017-01-25 13:46 UTC (permalink / raw)
To: arm-DgEjT+Ai2ygdnm+yROfE0A
Cc: James Liao, Leilk Liu, zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w,
honghui.zhang-NuS5LvNUpcJWk0Htik3J/w, Dawei Chien,
moderated list:ARM/Mediatek SoC support, John Crispin, xiaolei li,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Hi Arnd, hi Olof,
Please merge the following changes for 32-bit dts files.
Thanks,
Matthias
---
The following changes since commit 7ce7d89f48834cefece7804d38fc5d85382edf77:
Linux 4.10-rc1 (2016-12-25 16:13:08 -0800)
are available in the git repository at:
https://github.com/mbgg/linux-mediatek.git tags/v4.10-next-dts32
for you to fetch changes up to e348dc74f798c2df31c685bf0c814396f4f3b735:
arm: dts: mt2701: Add thermal device node. (2017-01-24 11:24:35 +0100)
----------------------------------------------------------------
Lots of updates for mt2701:
Rearrange the dt nodes and fix unit address for pincontroler
Add nodes for:
- clock controller subsystems
- scpsys controller
- iommu and smi
- spi
- nand
- auxadc
- thermal controller and zones
Email address updated for mt7623 devicetree files.
----------------------------------------------------------------
Dawei Chien (1):
arm: dts: mt2701: Add thermal device node.
Honghui Zhang (1):
ARM: dts: mt2701: add iommu/smi dtsi node for mt2701
James Liao (3):
arm: dts: mt2701: Sort DT nodes by register address
arm: dts: mt2701: Add subsystem clock controller device nodes
arm: dts: mt2701: Add power domain controller device node
John Crispin (1):
ARM: dts: mediatek: update my email address
Leilk Liu (1):
arm: dts: mt2701: Add spi device node
Xiaolei Li (1):
arm: dts: mt2701: Add nand device node
Zhiyong Tao (1):
arm: dts: mt2701: Add auxadc device node.
arch/arm/boot/dts/mt2701-evb.dts | 54 +++++++++
arch/arm/boot/dts/mt2701.dtsi | 247
++++++++++++++++++++++++++++++++++++---
arch/arm/boot/dts/mt7623-evb.dts | 2 +-
arch/arm/boot/dts/mt7623.dtsi | 2 +-
4 files changed, 285 insertions(+), 20 deletions(-)
^ permalink raw reply
* Re: [PATCH] spi: mediatek: Manually set dma_ops for spi_master device
From: Mark Brown @ 2017-01-25 12:34 UTC (permalink / raw)
To: Daniel Kurtz
Cc: Robin Murphy, Leilk Liu, open list, open list:SPI SUBSYSTEM,
Matthias Brugger, moderated list:ARM/Mediatek SoC support, groeck,
Dmitry Torokhov, moderated list:ARM/Mediatek SoC support
In-Reply-To: <CAGS+omBV3o1hergAjU3_9ok5NTmk8Z315zo3yW9jU_jA+reZCQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
On Wed, Jan 25, 2017 at 06:24:12PM +0800, Daniel Kurtz wrote:
> I'm in a bit over my head here, any suggestions on how to fix this?
As both Robin and I said the driver should be using the platform device
which physically exists rather than the virtual master device.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH] pinctrl: mediatek: Use real dependencies
From: Matthias Brugger @ 2017-01-25 10:57 UTC (permalink / raw)
To: Jean Delvare, linux-gpio, linux-mediatek
Cc: Linus Walleij, Biao Huang, James Liao, Andreas Färber
In-Reply-To: <20170125103209.1d97b0bd@endymion>
On 01/25/2017 10:32 AM, Jean Delvare wrote:
> Do not hide pinctrl drivers for Mediatek platforms using
> conditionals. Doing so actually leaves the symbols present (but
> always disabled) on all other platforms, which is confusing and
> inefficient. Better use real dependencies so that the symbols do not
> exist at all on platforms where they are not relevant.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Reported-by: Andreas Färber <afaerber@suse.de>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/pinctrl/mediatek/Kconfig | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> --- linux-4.10-rc4.orig/drivers/pinctrl/mediatek/Kconfig 2017-01-01 23:31:53.000000000 +0100
> +++ linux-4.10-rc4/drivers/pinctrl/mediatek/Kconfig 2017-01-25 10:29:00.465436987 +0100
> @@ -10,25 +10,29 @@ config PINCTRL_MTK
>
> # For ARMv7 SoCs
> config PINCTRL_MT2701
> - bool "Mediatek MT2701 pin control" if COMPILE_TEST && !MACH_MT2701
> + bool "Mediatek MT2701 pin control"
> + depends on MACH_MT2701 || COMPILE_TEST
> depends on OF
> default MACH_MT2701
> select PINCTRL_MTK
>
> config PINCTRL_MT7623
> - bool "Mediatek MT7623 pin control" if COMPILE_TEST && !MACH_MT7623
> + bool "Mediatek MT7623 pin control"
> + depends on MACH_MT7623 || COMPILE_TEST
> depends on OF
> default MACH_MT7623
> select PINCTRL_MTK_COMMON
>
> config PINCTRL_MT8135
> - bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135
> + bool "Mediatek MT8135 pin control"
> + depends on MACH_MT8135 || COMPILE_TEST
> depends on OF
> default MACH_MT8135
> select PINCTRL_MTK
>
> config PINCTRL_MT8127
> - bool "Mediatek MT8127 pin control" if COMPILE_TEST && !MACH_MT8127
> + bool "Mediatek MT8127 pin control"
> + depends on MACH_MT8127 || COMPILE_TEST
> depends on OF
> default MACH_MT8127
> select PINCTRL_MTK
> @@ -43,7 +47,8 @@ config PINCTRL_MT8173
>
> # For PMIC
> config PINCTRL_MT6397
> - bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397
> + bool "Mediatek MT6397 pin control"
> + depends on MFD_MT6397 || COMPILE_TEST
> depends on OF
> default MFD_MT6397
> select PINCTRL_MTK
>
>
^ permalink raw reply
* Re: [PATCH 1/2] Documentation: devicetree: change the mediatek ethernet compatible string
From: Matthias Brugger @ 2017-01-25 10:43 UTC (permalink / raw)
To: John Crispin, Rob Herring, David S. Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <1485332455-34743-1-git-send-email-john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>
On 01/25/2017 09:20 AM, John Crispin wrote:
> When the binding was defined, I was not aware that mt2701 was an earlier
> version of the SoC. For sake of consistency, the ethernet driver should
> use mt2701 inside the compat string as this is the earliest SoC with the
> ethernet core.
>
> The ethernet driver is currently of no real use until we finish and
> upstream the DSA driver. There are no users of this binding yet. It should
> be safe to fix this now before it is too late and we need to provide
> backward compatibility for the mt7623-eth compat string.
>
> Reported-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Signed-off-by: John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>
> ---
sounds reasonable to me:
Reviewed-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Documentation/devicetree/bindings/net/mediatek-net.txt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
> index c010faf..c7194e8 100644
> --- a/Documentation/devicetree/bindings/net/mediatek-net.txt
> +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
> @@ -7,7 +7,7 @@ have dual GMAC each represented by a child node..
> * Ethernet controller node
>
> Required properties:
> -- compatible: Should be "mediatek,mt7623-eth"
> +- compatible: Should be "mediatek,mt2701-eth"
> - reg: Address and length of the register set for the device
> - interrupts: Should contain the three frame engines interrupts in numeric
> order. These are fe_int0, fe_int1 and fe_int2.
>
--
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
* Re: [PATCH] spi: mediatek: Manually set dma_ops for spi_master device
From: Daniel Kurtz @ 2017-01-25 10:24 UTC (permalink / raw)
To: Robin Murphy
Cc: Leilk Liu, open list, open list:SPI SUBSYSTEM, Matthias Brugger,
Mark Brown, moderated list:ARM/Mediatek SoC support,
groeck-F7+t8E8rja9g9hUCZPvPmw, Dmitry Torokhov,
moderated list:ARM/Mediatek SoC support
In-Reply-To: <b1180920-8ead-40e8-6155-8510226e719b-5wv7dgnIgG8@public.gmane.org>
Hi Robin,
On Tue, Jan 24, 2017 at 11:14 PM, Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> wrote:
> Hi Dan,
[snip...]
>> And I really don't know why we needed to set the coherent_dma_mask to 0 to
>> avoid SPI transaction errors.
>
> Following what I mentioned above, "git grep dma_alloc drivers/spi" makes
> it seem like coherent DMA isn't used anywhere relevant, which is rather
> puzzling. Unless of course somewhere along the line somebody's done the
> dev->dma_mask = &dev->dma_coherent_mask hack, with the result that
> writing one mask hits both, making *all* DMA fail and big transfers fall
> back to PIO.
You mean this last line?
>> @@ -575,6 +576,10 @@ static int mtk_spi_probe(struct platform_device *pdev)
>> goto err_put_master;
>> }
>>
>> + /* Call of_dma_configure to set up spi_master's dma_ops */
>> + of_dma_configure(&master->dev, master->dev.of_node);
>> + /* But explicitly set the coherent_dma_mask to 0 */
>> + master->dev.coherent_dma_mask = 0;
>> if (!pdev->dev.dma_mask)
>> pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
^^^^^
As predicted, setting the dma_mask = 0 causes "all DMA to fail". In
particular, dma_capable() always returns false, so
swiotlb_map_sg_attrs() takes the map_single() path, instead of just
assigning:
sg->dma_address = dev_addr;
swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
enum dma_data_direction dir, unsigned long attrs)
{
struct scatterlist *sg;
int i;
BUG_ON(dir == DMA_NONE);
for_each_sg(sgl, sg, nelems, i) {
phys_addr_t paddr = sg_phys(sg);
dma_addr_t dev_addr = phys_to_dma(hwdev, paddr);
if (swiotlb_force == SWIOTLB_FORCE ||
!dma_capable(hwdev, dev_addr, sg->length)) {
phys_addr_t map = map_single(hwdev, sg_phys(sg),
sg->length, dir, attrs);
...
}
sg->dma_address = phys_to_dma(hwdev, map);
} else
sg->dma_address = dev_addr;
sg_dma_len(sg) = sg->length;
}
return nelems;
}
So, I think this means that the only reason the MTK SPI driver ever
worked before was that it was tested on an older kernel, so the
spi_master was defaulting to swiotlb_dma_ops with a 0 dma_mask, and
therefore it was using SWIOTLB bounce buffers (via 'map_single'), and
not actually ever doing real DMA.
I'm in a bit over my head here, any suggestions on how to fix this?
-Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" 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
* Re: [PATCH] media: platform: constify vb2_ops structures
From: Lad, Prabhakar @ 2017-01-25 10:08 UTC (permalink / raw)
To: Bhumika Goyal
Cc: Julia Lawall, Mauro Carvalho Chehab, minghsiu.tsai, houlong.wei,
andrew-ct.chen, matthias.bgg, linux-media, LKML, LAK,
linux-mediatek
In-Reply-To: <1484990984-16136-1-git-send-email-bhumirks@gmail.com>
Hi,
Thanks for the patch.
On Sat, Jan 21, 2017 at 9:29 AM, Bhumika Goyal <bhumirks@gmail.com> wrote:
> Declare vb2_ops structures as const as they are only stored in
> the ops field of a vb2_queue structure. This field is of type
> const, so vb2_ops structures having same properties can be made
> const too.
> Done using Coccinelle:
>
> @r1 disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct vb2_ops i@p={...};
>
> @ok1@
> identifier r1.i;
> position p;
> struct sta2x11_vip vip;
> struct vb2_queue q;
> @@
> (
> vip.vb_vidq.ops=&i@p
> |
> q.ops=&i@p
> )
>
> @bad@
> position p!={r1.p,ok1.p};
> identifier r1.i;
> @@
> i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> +const
> struct vb2_ops i;
>
> Cross compiled the media/platform/blackfin/bfin_capture.o file for
> blackfin architecture.
>
> File size before:
> text data bss dec hex filename
> 6776 176 0 6952 1b28 platform/blackfin/bfin_capture.o
>
The description doesnt match the changes. Can you please split the
patches separately one for vpif_capture.c and vpif_display.c,
one for mtk_mdp_m2m.c and lastly for pxa_camera.c .
Cheers,
--Prabhakar Lad
^ permalink raw reply
* Re: [PATCH] pinctrl: mediatek: Use real dependencies
From: John Crispin @ 2017-01-25 9:34 UTC (permalink / raw)
To: Jean Delvare, linux-gpio, linux-mediatek
Cc: Matthias Brugger, Biao Huang, Linus Walleij, Andreas Färber,
James Liao
In-Reply-To: <20170125103209.1d97b0bd@endymion>
On 25/01/2017 10:32, Jean Delvare wrote:
> Do not hide pinctrl drivers for Mediatek platforms using
> conditionals. Doing so actually leaves the symbols present (but
> always disabled) on all other platforms, which is confusing and
> inefficient. Better use real dependencies so that the symbols do not
> exist at all on platforms where they are not relevant.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Reported-by: Andreas Färber <afaerber@suse.de>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
for the mt7623 part
Acked-by: John Crispin <john@phrozen.org>
> ---
> drivers/pinctrl/mediatek/Kconfig | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> --- linux-4.10-rc4.orig/drivers/pinctrl/mediatek/Kconfig 2017-01-01 23:31:53.000000000 +0100
> +++ linux-4.10-rc4/drivers/pinctrl/mediatek/Kconfig 2017-01-25 10:29:00.465436987 +0100
> @@ -10,25 +10,29 @@ config PINCTRL_MTK
>
> # For ARMv7 SoCs
> config PINCTRL_MT2701
> - bool "Mediatek MT2701 pin control" if COMPILE_TEST && !MACH_MT2701
> + bool "Mediatek MT2701 pin control"
> + depends on MACH_MT2701 || COMPILE_TEST
> depends on OF
> default MACH_MT2701
> select PINCTRL_MTK
>
> config PINCTRL_MT7623
> - bool "Mediatek MT7623 pin control" if COMPILE_TEST && !MACH_MT7623
> + bool "Mediatek MT7623 pin control"
> + depends on MACH_MT7623 || COMPILE_TEST
> depends on OF
> default MACH_MT7623
> select PINCTRL_MTK_COMMON
>
> config PINCTRL_MT8135
> - bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135
> + bool "Mediatek MT8135 pin control"
> + depends on MACH_MT8135 || COMPILE_TEST
> depends on OF
> default MACH_MT8135
> select PINCTRL_MTK
>
> config PINCTRL_MT8127
> - bool "Mediatek MT8127 pin control" if COMPILE_TEST && !MACH_MT8127
> + bool "Mediatek MT8127 pin control"
> + depends on MACH_MT8127 || COMPILE_TEST
> depends on OF
> default MACH_MT8127
> select PINCTRL_MTK
> @@ -43,7 +47,8 @@ config PINCTRL_MT8173
>
> # For PMIC
> config PINCTRL_MT6397
> - bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397
> + bool "Mediatek MT6397 pin control"
> + depends on MFD_MT6397 || COMPILE_TEST
> depends on OF
> default MFD_MT6397
> select PINCTRL_MTK
>
>
^ permalink raw reply
* [PATCH] pinctrl: mediatek: Use real dependencies
From: Jean Delvare @ 2017-01-25 9:32 UTC (permalink / raw)
To: linux-gpio, linux-mediatek
Cc: Linus Walleij, Matthias Brugger, Biao Huang, James Liao,
Andreas Färber
Do not hide pinctrl drivers for Mediatek platforms using
conditionals. Doing so actually leaves the symbols present (but
always disabled) on all other platforms, which is confusing and
inefficient. Better use real dependencies so that the symbols do not
exist at all on platforms where they are not relevant.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reported-by: Andreas Färber <afaerber@suse.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
---
drivers/pinctrl/mediatek/Kconfig | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- linux-4.10-rc4.orig/drivers/pinctrl/mediatek/Kconfig 2017-01-01 23:31:53.000000000 +0100
+++ linux-4.10-rc4/drivers/pinctrl/mediatek/Kconfig 2017-01-25 10:29:00.465436987 +0100
@@ -10,25 +10,29 @@ config PINCTRL_MTK
# For ARMv7 SoCs
config PINCTRL_MT2701
- bool "Mediatek MT2701 pin control" if COMPILE_TEST && !MACH_MT2701
+ bool "Mediatek MT2701 pin control"
+ depends on MACH_MT2701 || COMPILE_TEST
depends on OF
default MACH_MT2701
select PINCTRL_MTK
config PINCTRL_MT7623
- bool "Mediatek MT7623 pin control" if COMPILE_TEST && !MACH_MT7623
+ bool "Mediatek MT7623 pin control"
+ depends on MACH_MT7623 || COMPILE_TEST
depends on OF
default MACH_MT7623
select PINCTRL_MTK_COMMON
config PINCTRL_MT8135
- bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135
+ bool "Mediatek MT8135 pin control"
+ depends on MACH_MT8135 || COMPILE_TEST
depends on OF
default MACH_MT8135
select PINCTRL_MTK
config PINCTRL_MT8127
- bool "Mediatek MT8127 pin control" if COMPILE_TEST && !MACH_MT8127
+ bool "Mediatek MT8127 pin control"
+ depends on MACH_MT8127 || COMPILE_TEST
depends on OF
default MACH_MT8127
select PINCTRL_MTK
@@ -43,7 +47,8 @@ config PINCTRL_MT8173
# For PMIC
config PINCTRL_MT6397
- bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397
+ bool "Mediatek MT6397 pin control"
+ depends on MFD_MT6397 || COMPILE_TEST
depends on OF
default MFD_MT6397
select PINCTRL_MTK
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply
* [PATCH 2/2] net-next: ethernet: mediatek: change the compatible string
From: John Crispin @ 2017-01-25 8:20 UTC (permalink / raw)
To: Rob Herring, Matthias Brugger, David S. Miller
Cc: netdev, Sean Wang, devicetree, linux-mediatek, John Crispin
In-Reply-To: <1485332455-34743-1-git-send-email-john@phrozen.org>
When the binding was defined, I was not aware that mt2701 was an earlier
version of the SoC. For sake of consistency, the ethernet driver should
use mt2701 inside the compat string as this is the earliest SoC with the
ethernet core.
The ethernet driver is currently of no real use until we finish and
upstream the DSA driver. There are no users of this binding yet. It should
be safe to fix this now before it is too late and we need to provide
backward compatibility for the mt7623-eth compat string.
Reported-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 25ae0c5..9e75768 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2515,7 +2515,7 @@ static int mtk_remove(struct platform_device *pdev)
}
const struct of_device_id of_mtk_match[] = {
- { .compatible = "mediatek,mt7623-eth" },
+ { .compatible = "mediatek,mt2701-eth" },
{},
};
MODULE_DEVICE_TABLE(of, of_mtk_match);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/2] Documentation: devicetree: change the mediatek ethernet compatible string
From: John Crispin @ 2017-01-25 8:20 UTC (permalink / raw)
To: Rob Herring, Matthias Brugger, David S. Miller
Cc: netdev, Sean Wang, devicetree, linux-mediatek, John Crispin
When the binding was defined, I was not aware that mt2701 was an earlier
version of the SoC. For sake of consistency, the ethernet driver should
use mt2701 inside the compat string as this is the earliest SoC with the
ethernet core.
The ethernet driver is currently of no real use until we finish and
upstream the DSA driver. There are no users of this binding yet. It should
be safe to fix this now before it is too late and we need to provide
backward compatibility for the mt7623-eth compat string.
Reported-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
Documentation/devicetree/bindings/net/mediatek-net.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
index c010faf..c7194e8 100644
--- a/Documentation/devicetree/bindings/net/mediatek-net.txt
+++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
@@ -7,7 +7,7 @@ have dual GMAC each represented by a child node..
* Ethernet controller node
Required properties:
-- compatible: Should be "mediatek,mt7623-eth"
+- compatible: Should be "mediatek,mt2701-eth"
- reg: Address and length of the register set for the device
- interrupts: Should contain the three frame engines interrupts in numeric
order. These are fe_int0, fe_int1 and fe_int2.
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH v2 1/2] Documentation: mtk-quadspi: update DT bindings
From: John Crispin @ 2017-01-25 5:39 UTC (permalink / raw)
To: Guochun Mao, Brian Norris
Cc: David Woodhouse, Boris Brezillon, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, Rob Herring, Mark Rutland, Matthias Brugger,
Russell King, linux-mtd, devicetree, linux-arm-kernel,
linux-mediatek, linux-kernel
In-Reply-To: <1485315515-29942-2-git-send-email-guochun.mao@mediatek.com>
On 25/01/2017 04:38, Guochun Mao wrote:
> Add "mediatek,mt2701-nor" for nor flash node's compatible.
>
> Signed-off-by: Guochun Mao <guochun.mao@mediatek.com>
> ---
> .../devicetree/bindings/mtd/mtk-quadspi.txt | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt b/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
> index fb314f0..5ded66a 100644
> --- a/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
> +++ b/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
> @@ -1,7 +1,13 @@
> * Serial NOR flash controller for MTK MT81xx (and similar)
>
> Required properties:
> -- compatible: should be "mediatek,mt8173-nor";
> +- compatible: The possible values are:
> + "mediatek,mt2701-nor"
> + "mediatek,mt7623-nor"
Thanks !
Acked-by: John Crispin <john@phrozen.org>
> + "mediatek,mt8173-nor"
> + For mt8173, compatible should be "mediatek,mt8173-nor".
> + For every other SoC, should contain both the SoC-specific compatible string
> + and "mediatek,mt8173-nor".
> - reg: physical base address and length of the controller's register
> - clocks: the phandle of the clocks needed by the nor controller
> - clock-names: the names of the clocks
>
^ permalink raw reply
* Re: [PATCH 08/16] arm: dts: add spi nodes to the mt7623.dtsi file
From: John Crispin @ 2017-01-25 5:38 UTC (permalink / raw)
To: Matthias Brugger, Rob Herring
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Andreas Färber,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <69d73342-d710-5f6d-567b-8e75a84fdb18-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 24/01/2017 23:39, Matthias Brugger wrote:
>
>
> On 01/23/2017 12:29 PM, John Crispin wrote:
>> Add SPI nodes to the mt7623.dtsi file.
>>
>> Signed-off-by: John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>
>> ---
>> arch/arm/boot/dts/mt7623.dtsi | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/mt7623.dtsi
>> b/arch/arm/boot/dts/mt7623.dtsi
>> index 8ac4569..c8f38e1 100644
>> --- a/arch/arm/boot/dts/mt7623.dtsi
>> +++ b/arch/arm/boot/dts/mt7623.dtsi
>> @@ -15,6 +15,7 @@
>> #include <dt-bindings/interrupt-controller/irq.h>
>> #include <dt-bindings/interrupt-controller/arm-gic.h>
>> #include <dt-bindings/clock/mt2701-clk.h>
>> +#include <dt-bindings/phy/phy.h>
>
> Why do you need this include here?
>
> Regards,
> Matthias
>
should be part of the ubs patch. V2 coming up in a tad
John
>> #include <dt-bindings/pinctrl/mt7623-pinfunc.h>
>> #include <dt-bindings/power/mt2701-power.h>
>> #include <dt-bindings/reset/mt2701-resets.h>
>> @@ -281,6 +282,17 @@
>> status = "disabled";
>> };
>>
>> + spi: spi@1100a000 {
>> + compatible = "mediatek,mt7623-spi",
>> + "mediatek,mt6589-spi";
>> + reg = <0 0x1100a000 0 0x1000>;
>> + interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_LOW>;
>> + clocks = <&pericfg CLK_PERI_SPI0>;
>> + clock-names = "main";
>> +
>> + status = "disabled";
>> + };
>> +
>> hifsys: syscon@1a000000 {
>> compatible = "mediatek,mt7623-hifsys",
>> "mediatek,mt2701-hifsys",
>>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
--
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
* [PATCH v2 2/2] arm: dts: mt2701: add nor flash node
From: Guochun Mao @ 2017-01-25 3:38 UTC (permalink / raw)
To: Brian Norris, John Crispin
Cc: David Woodhouse, Boris Brezillon, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, Rob Herring, Mark Rutland, Matthias Brugger,
Russell King, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Guochun Mao
In-Reply-To: <1485315515-29942-1-git-send-email-guochun.mao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add Mediatek nor flash node.
Signed-off-by: Guochun Mao <guochun.mao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
arch/arm/boot/dts/mt2701-evb.dts | 25 +++++++++++++++++++++++++
arch/arm/boot/dts/mt2701.dtsi | 12 ++++++++++++
2 files changed, 37 insertions(+)
diff --git a/arch/arm/boot/dts/mt2701-evb.dts b/arch/arm/boot/dts/mt2701-evb.dts
index 082ca88..85e5ae8 100644
--- a/arch/arm/boot/dts/mt2701-evb.dts
+++ b/arch/arm/boot/dts/mt2701-evb.dts
@@ -24,6 +24,31 @@
};
};
+&nor_flash {
+ pinctrl-names = "default";
+ pinctrl-0 = <&nor_pins_default>;
+ status = "okay";
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ };
+};
+
+&pio {
+ nor_pins_default: nor {
+ pins1 {
+ pinmux = <MT2701_PIN_240_EXT_XCS__FUNC_EXT_XCS>,
+ <MT2701_PIN_241_EXT_SCK__FUNC_EXT_SCK>,
+ <MT2701_PIN_239_EXT_SDIO0__FUNC_EXT_SDIO0>,
+ <MT2701_PIN_238_EXT_SDIO1__FUNC_EXT_SDIO1>,
+ <MT2701_PIN_237_EXT_SDIO2__FUNC_EXT_SDIO2>,
+ <MT2701_PIN_236_EXT_SDIO3__FUNC_EXT_SDIO3>;
+ drive-strength = <MTK_DRIVE_4mA>;
+ bias-pull-up;
+ };
+ };
+};
+
&uart0 {
status = "okay";
};
diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index bdf8954..1eefce4 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -227,6 +227,18 @@
status = "disabled";
};
+ nor_flash: spi@11014000 {
+ compatible = "mediatek,mt2701-nor",
+ "mediatek,mt8173-nor";
+ reg = <0 0x11014000 0 0xe0>;
+ clocks = <&pericfg CLK_PERI_FLASH>,
+ <&topckgen CLK_TOP_FLASH_SEL>;
+ clock-names = "spi", "sf";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
mmsys: syscon@14000000 {
compatible = "mediatek,mt2701-mmsys", "syscon";
reg = <0 0x14000000 0 0x1000>;
--
1.7.9.5
--
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
* [PATCH v2 1/2] Documentation: mtk-quadspi: update DT bindings
From: Guochun Mao @ 2017-01-25 3:38 UTC (permalink / raw)
To: Brian Norris, John Crispin
Cc: David Woodhouse, Boris Brezillon, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, Rob Herring, Mark Rutland, Matthias Brugger,
Russell King, linux-mtd, devicetree, linux-arm-kernel,
linux-mediatek, linux-kernel, Guochun Mao
In-Reply-To: <1485315515-29942-1-git-send-email-guochun.mao@mediatek.com>
Add "mediatek,mt2701-nor" for nor flash node's compatible.
Signed-off-by: Guochun Mao <guochun.mao@mediatek.com>
---
.../devicetree/bindings/mtd/mtk-quadspi.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt b/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
index fb314f0..5ded66a 100644
--- a/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
+++ b/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
@@ -1,7 +1,13 @@
* Serial NOR flash controller for MTK MT81xx (and similar)
Required properties:
-- compatible: should be "mediatek,mt8173-nor";
+- compatible: The possible values are:
+ "mediatek,mt2701-nor"
+ "mediatek,mt7623-nor"
+ "mediatek,mt8173-nor"
+ For mt8173, compatible should be "mediatek,mt8173-nor".
+ For every other SoC, should contain both the SoC-specific compatible string
+ and "mediatek,mt8173-nor".
- reg: physical base address and length of the controller's register
- clocks: the phandle of the clocks needed by the nor controller
- clock-names: the names of the clocks
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 0/2] addr nor flash node for mt2701
From: Guochun Mao @ 2017-01-25 3:38 UTC (permalink / raw)
To: Brian Norris, John Crispin
Cc: David Woodhouse, Boris Brezillon, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, Rob Herring, Mark Rutland, Matthias Brugger,
Russell King, linux-mtd, devicetree, linux-arm-kernel,
linux-mediatek, linux-kernel
Update DT bindings, clarify compatible strings that mt2701-nor node should contain.
This patch series based on v4.10-rc2, include MT2701 spi nor node.
Dependent on "Add clock and power domain DT nodes for Mediatek MT2701"
[1] http://lists.infradead.org/pipermail/linux-mediatek/2016-December/007637.html
Guochun Mao (2):
Documentation: mtk-quadspi: update DT bindings
arm: dts: mt2701: add nor flash node
.../devicetree/bindings/mtd/mtk-quadspi.txt | 8 ++++++-
arch/arm/boot/dts/mt2701-evb.dts | 25 ++++++++++++++++++++++
arch/arm/boot/dts/mt2701.dtsi | 12 +++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
--
1.8.1.1.dirty
^ permalink raw reply
* Re: [PATCH v2] clk: mediatek: Fix MT2701 dependencies
From: James Liao @ 2017-01-25 3:01 UTC (permalink / raw)
To: Jean Delvare
Cc: Erin Lo, Stephen Boyd, Andreas Färber, Michael Turquette,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Shunli Wang,
Matthias Brugger, linux-clk-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170124130704.14015da3@endymion>
On Tue, 2017-01-24 at 13:07 +0100, Jean Delvare wrote:
> If I say "no" to "Clock driver for Mediatek MT2701", I don't want to
> be asked individually about each sub-driver. No means no.
>
> Additionally, this driver shouldn't be proposed at all on non-mediatek
> builds, unless build-testing.
>
> Signed-off-by: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
> Fixes: e9862118272a ("clk: mediatek: Add MT2701 clock support")
> Reviewed-by: Andreas Färber <afaerber-l3A5Bk7waGM@public.gmane.org>
> Reviewed-by: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Cc: Shunli Wang <shunli.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Cc: Erin Lo <erin.lo-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Cc: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Michael Turquette <mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
> Cc: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
> Changes since v1:
> * Restrict to 32-bit ARM.
>
> drivers/clk/mediatek/Kconfig | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> --- linux-4.10-rc4.orig/drivers/clk/mediatek/Kconfig 2017-01-16 11:13:07.146675028 +0100
> +++ linux-4.10-rc4/drivers/clk/mediatek/Kconfig 2017-01-24 12:55:50.192100713 +0100
> @@ -8,44 +8,45 @@ config COMMON_CLK_MEDIATEK
>
> config COMMON_CLK_MT2701
> bool "Clock driver for Mediatek MT2701"
> + depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST
> select COMMON_CLK_MEDIATEK
> - default ARCH_MEDIATEK
> + default ARCH_MEDIATEK && ARM
> ---help---
> This driver supports Mediatek MT2701 basic clocks.
>
> config COMMON_CLK_MT2701_MMSYS
> bool "Clock driver for Mediatek MT2701 mmsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 mmsys clocks.
>
> config COMMON_CLK_MT2701_IMGSYS
> bool "Clock driver for Mediatek MT2701 imgsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 imgsys clocks.
>
> config COMMON_CLK_MT2701_VDECSYS
> bool "Clock driver for Mediatek MT2701 vdecsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 vdecsys clocks.
>
> config COMMON_CLK_MT2701_HIFSYS
> bool "Clock driver for Mediatek MT2701 hifsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 hifsys clocks.
>
> config COMMON_CLK_MT2701_ETHSYS
> bool "Clock driver for Mediatek MT2701 ethsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 ethsys clocks.
>
> config COMMON_CLK_MT2701_BDPSYS
> bool "Clock driver for Mediatek MT2701 bdpsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 bdpsys clocks.
>
>
>
^ permalink raw reply
* Re: [PATCH] clk: mediatek: Fix MT8135 dependencies
From: James Liao @ 2017-01-25 3:00 UTC (permalink / raw)
To: Jean Delvare
Cc: Matthias Brugger, Stephen Boyd,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-clk-u79uwXL29TY76Z2rM5mHXA, Andreas Färber
In-Reply-To: <20170124130912.14375a32@endymion>
On Tue, 2017-01-24 at 13:09 +0100, Jean Delvare wrote:
> The MT8135 is a 32-bit SoC, so only propose it on ARM architecture,
> not ARM64.
>
> Signed-off-by: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
> Fixes: 234d511d8c15 ("clk: mediatek: Add hardware dependency")
> Cc: Andreas Färber <afaerber-l3A5Bk7waGM@public.gmane.org>
> Cc: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Cc: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
> drivers/clk/mediatek/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- linux-4.10-rc4.orig/drivers/clk/mediatek/Kconfig 2017-01-24 12:55:50.192100713 +0100
> +++ linux-4.10-rc4/drivers/clk/mediatek/Kconfig 2017-01-24 12:59:08.703066604 +0100
> @@ -52,9 +52,9 @@ config COMMON_CLK_MT2701_BDPSYS
>
> config COMMON_CLK_MT8135
> bool "Clock driver for Mediatek MT8135"
> - depends on ARCH_MEDIATEK || COMPILE_TEST
> + depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST
> select COMMON_CLK_MEDIATEK
> - default ARCH_MEDIATEK
> + default ARCH_MEDIATEK && ARM
> ---help---
> This driver supports Mediatek MT8135 clocks.
>
>
^ permalink raw reply
* Re: [PATCH] clk: mediatek: Fix MT8135 dependencies
From: Matthias Brugger @ 2017-01-24 23:46 UTC (permalink / raw)
To: Jean Delvare, linux-clk, linux-mediatek
Cc: Andreas Färber, James Liao, Stephen Boyd
In-Reply-To: <20170124130912.14375a32@endymion>
On 01/24/2017 01:09 PM, Jean Delvare wrote:
> The MT8135 is a 32-bit SoC, so only propose it on ARM architecture,
> not ARM64.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Fixes: 234d511d8c15 ("clk: mediatek: Add hardware dependency")
> Cc: Andreas Färber <afaerber@suse.de>
> Cc: James Liao <jamesjj.liao@mediatek.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/clk/mediatek/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> --- linux-4.10-rc4.orig/drivers/clk/mediatek/Kconfig 2017-01-24 12:55:50.192100713 +0100
> +++ linux-4.10-rc4/drivers/clk/mediatek/Kconfig 2017-01-24 12:59:08.703066604 +0100
> @@ -52,9 +52,9 @@ config COMMON_CLK_MT2701_BDPSYS
>
> config COMMON_CLK_MT8135
> bool "Clock driver for Mediatek MT8135"
> - depends on ARCH_MEDIATEK || COMPILE_TEST
> + depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST
> select COMMON_CLK_MEDIATEK
> - default ARCH_MEDIATEK
> + default ARCH_MEDIATEK && ARM
> ---help---
> This driver supports Mediatek MT8135 clocks.
>
>
^ permalink raw reply
* Re: [PATCH v2] clk: mediatek: Fix MT2701 dependencies
From: Matthias Brugger @ 2017-01-24 23:45 UTC (permalink / raw)
To: Jean Delvare, linux-clk, linux-mediatek
Cc: Andreas Färber, James Liao, Shunli Wang, Erin Lo,
Stephen Boyd, Michael Turquette
In-Reply-To: <20170124130704.14015da3@endymion>
On 01/24/2017 01:07 PM, Jean Delvare wrote:
> If I say "no" to "Clock driver for Mediatek MT2701", I don't want to
> be asked individually about each sub-driver. No means no.
>
> Additionally, this driver shouldn't be proposed at all on non-mediatek
> builds, unless build-testing.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Fixes: e9862118272a ("clk: mediatek: Add MT2701 clock support")
> Reviewed-by: Andreas Färber <afaerber@suse.de>
> Reviewed-by: James Liao <jamesjj.liao@mediatek.com>
> Cc: Shunli Wang <shunli.wang@mediatek.com>
> Cc: Erin Lo <erin.lo@mediatek.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> Changes since v1:
> * Restrict to 32-bit ARM.
>
> drivers/clk/mediatek/Kconfig | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> --- linux-4.10-rc4.orig/drivers/clk/mediatek/Kconfig 2017-01-16 11:13:07.146675028 +0100
> +++ linux-4.10-rc4/drivers/clk/mediatek/Kconfig 2017-01-24 12:55:50.192100713 +0100
> @@ -8,44 +8,45 @@ config COMMON_CLK_MEDIATEK
>
> config COMMON_CLK_MT2701
> bool "Clock driver for Mediatek MT2701"
> + depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST
> select COMMON_CLK_MEDIATEK
> - default ARCH_MEDIATEK
> + default ARCH_MEDIATEK && ARM
> ---help---
> This driver supports Mediatek MT2701 basic clocks.
>
> config COMMON_CLK_MT2701_MMSYS
> bool "Clock driver for Mediatek MT2701 mmsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 mmsys clocks.
>
> config COMMON_CLK_MT2701_IMGSYS
> bool "Clock driver for Mediatek MT2701 imgsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 imgsys clocks.
>
> config COMMON_CLK_MT2701_VDECSYS
> bool "Clock driver for Mediatek MT2701 vdecsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 vdecsys clocks.
>
> config COMMON_CLK_MT2701_HIFSYS
> bool "Clock driver for Mediatek MT2701 hifsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 hifsys clocks.
>
> config COMMON_CLK_MT2701_ETHSYS
> bool "Clock driver for Mediatek MT2701 ethsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 ethsys clocks.
>
> config COMMON_CLK_MT2701_BDPSYS
> bool "Clock driver for Mediatek MT2701 bdpsys"
> - select COMMON_CLK_MT2701
> + depends on COMMON_CLK_MT2701
> ---help---
> This driver supports Mediatek MT2701 bdpsys clocks.
>
>
>
^ permalink raw reply
* Re: [PATCH 2/6] usb: mtu3: add reference clock
From: Matthias Brugger @ 2017-01-24 23:23 UTC (permalink / raw)
To: Chunfeng Yun
Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
Mark Rutland, Ian Campbell, linux-kernel, linux-arm-kernel,
linux-usb, linux-mediatek, devicetree
In-Reply-To: <1484878825.10292.58.camel@mhfsdcap03>
On 01/20/2017 03:20 AM, Chunfeng Yun wrote:
> On Thu, 2017-01-19 at 13:22 +0100, Matthias Brugger wrote:
>>
>> On 18/01/17 07:08, Chunfeng Yun wrote:
>>> usually, the reference clock comes from 26M oscillator directly,
>>> but some SoCs are not, add it for compatibility.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>> ---
>>> drivers/usb/mtu3/mtu3.h | 1 +
>>> drivers/usb/mtu3/mtu3_plat.c | 21 +++++++++++++++++++--
>>> 2 files changed, 20 insertions(+), 2 deletions(-)
> [...]
>>> @@ -154,6 +162,7 @@ static int ssusb_rscs_init(struct ssusb_mtk *ssusb)
>>> static void ssusb_rscs_exit(struct ssusb_mtk *ssusb)
>>> {
>>> clk_disable_unprepare(ssusb->sys_clk);
>>> + clk_disable_unprepare(ssusb->ref_clk);
>>> regulator_disable(ssusb->vusb33);
>>> ssusb_phy_power_off(ssusb);
>>> ssusb_phy_exit(ssusb);
>>> @@ -216,6 +225,12 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
>>> return PTR_ERR(ssusb->sys_clk);
>>> }
>>>
>>> + ssusb->ref_clk = devm_clk_get(dev, "ref_ck");
>>> + if (IS_ERR(ssusb->ref_clk)) {
>>> + dev_err(dev, "failed to get ref clock\n");
>>> + return PTR_ERR(ssusb->ref_clk);
>>> + }
>>> +
>>
>> That would break older dts bindings, right?
> Yes, So I send a new patch for the related dts. Maybe it's not a
> problem, only one dts file need be updated currently.
>
>> ref_ck must be optional for the code.
> I tend to make it be optional for the dts, but not for the code.
> There are some "fixed-clock" which can be treated as dummy ones, and if
> a clock is really optional, we can use one fixed-clock in dts, and keep
> the code simple.
> In fact, the reference clock is essential for usb controller.
Well the thing is that there are devices in the field with an older dtb
which would break on a newer kernel. That's why we need to make it work
with the old dtb in the code as well.
Regards,
Matthias
>>
>> Regards,
>> Matthias
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox