arm: Add basic support for Mediatek Cortex-A7 SoCs
Subsystems (6)
Matthias Brugger
maintainerv7 cover arm: Add basic support for Mediatek Cortex-A7 SoCs
Seventh round for the Mediatek basic support patches.
Due to the discussion about the need of request the memory needed by a device [0], I implemented the function of_io_request_and_map. The clocksource drivers uses proper error handling and keep on booting the device instead of calling panic.
[0] http://www.spinics.net/lists/arm-kernel/msg336924.html
---
This patch set adds basic support for the Mediatek Cortex-A7 SoCs. Support is quite basic, as the only component working up to now are the timers.
The patch series is build against torvalds/master tree.
Changes for v7:
1. OF address
- add of_io_request_and_map
2. Clocksource timer
- use pr_warnings and error handling instead of panic
- fix macro parentheses
- use of_io_request_and_map
3. Others
- rename SoC DT bindings to mediatek.txt
- fixed typos
Changes for v6:
- fix compatible string of the timer
- encapsulate timer setup in function
- add more information to the timer commit message
- add address in timer DTS bindings documentation
Changes for v5:
1. Clocksource timer
- Change the compatible string to mt6577
2. Timer DT bindings
- Change compatible string to mt6577
Changes for v4:
1. Clocksource timer
- use cpu_possible_mask
2. Timer DT bindings
- Delete comments about the frequency of the clocks
- Add clock-names for the input clocks
3. Basic SoC support
- add clock-names for the timer
- rename the label of the clocks nodes
Changes for v3:
1. Clocksource timer
- Set cpu_mask_all and irq in clock_event_device
- Use device private structure for driver specific values
2. Timer DT bindings
- Define order of the clock phandles
- Fix typos
3. Basic SoC support
- DTS: set gic to a15-gic
- DTS: order by physical address
- Remove call to dt_init function
Changes for v2:
1. Clocksource timer
- Delete unused parts for sched_clock_source
- Use irq_request instead of setup_irq
- Remove unused SMP parts
- Fix some style issues
- use of_address_to resource and request_mem_region
- delete use of named clock
- select CLKSRC_MMIO in driver Kconfig
2. DT bindings
- delete named clock bindings
3. Basic SoC support
- Clean-up Kconfig
- Add documentation of the SoC compatible property
- DTS: rename SoC file to mt6589.dts
- DTS: Delete not present cache controller
- DTS: Add missing GICv2 properties
- DTS: Change clock names
- DTS: Add Aquaris5 board
4. Add earlyprintk
- patch droped until serial driver is available
5. Add support for Aquaris5 mobile phone
Matthias Brugger (7):
of: Provide function to request and map memory
clocksource: Add support for the Mediatek SoCs
dt-bindings: add mtk-timer bindings
vendor-prefixes: add prefix for Mediaktek Inc.
arm: add basic support for Mediatek MT6589 boards
dt-bindings: add documentation for Mediatek SoC
arm: mediatek: add dts for Aquaris5 mobile phone
Documentation/devicetree/bindings/arm/mediatek.txt | 8 + .../bindings/timer/mediatek,mtk-timer.txt | 18 ++ .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/boot/dts/mt6589-aquaris5.dts | 25 ++ arch/arm/boot/dts/mt6589.dtsi | 94 +++++++ arch/arm/mach-mediatek/Kconfig | 6 + arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mediatek.c | 27 ++ drivers/clocksource/Kconfig | 5 + drivers/clocksource/Makefile | 1 + drivers/clocksource/mtk_timer.c | 260 ++++++++++++++++++++ drivers/of/address.c | 28 +++ include/linux/of_address.h | 8 + 15 files changed, 485 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek.txt create mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt create mode 100644 arch/arm/boot/dts/mt6589-aquaris5.dts create mode 100644 arch/arm/boot/dts/mt6589.dtsi create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/mediatek.c create mode 100644 drivers/clocksource/mtk_timer.c
Signature · 1 line
1.7.9.5
Matthias Brugger
maintainerPATCH v7 1/7 of: Provide function to request and map memory
A call to of_iomap does not request the memory region. This patch adds the function of_io_request_and_map which requests the memory region before mapping it.
--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)
drivers/of/address.c +28 -0
@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node +* @device: the device whose io range will be mapped +* @index: index of the io range +* @name: name of the resource +* +* Returns a pointer to the requested and mapped memory +*/ +void __iomem *of_io_request_and_map (struct device_node *np,int index,char *name) +{ +struct resource res; +void __iomem *mem; + +if (of_address_to_resource (np, index, &res)) +return NULL ; + +if (!request_mem_region (res.start,resource_size (&res), name)) +return NULL ; + + mem =ioremap (res.start,resource_size (&res)); +if (!mem) +release_mem_region (res.start,resource_size (&res)); + +return mem; +} +EXPORT_SYMBOL (of_io_request_and_map);
include/linux/of_address.h +8 -0
@@ -96,6 +96,8 @@ static inline struct of_pci_range *of_pci_range_parser_one(extern int of_address_to_resource (struct device_node *dev,int index,struct resource *r);void __iomem *of_iomap (struct device_node *node,int index); +void __iomem *of_io_request_and_map (struct device_node *device, +int index,char *name);#else static inline int of_address_to_resource (struct device_node *dev,int index,struct resource *r)
@@ -107,6 +109,12 @@ static inline void __iomem *of_iomap(struct device_node *device, int index) {return NULL ; } + +static inline void __iomem *of_io_request_and_map (struct device_node *device, +int index,char *name) +{ +return NULL ; +}#endif #if defined(CONFIG_OF_ADDRESS ) && defined(CONFIG_PCI )
Signature · 1 line
1.7.9.5
PATCH v7 1/7 of: Provide function to request and map memory
Quoted 15 lines · Matthias Brugger
A call to
of_iomapdoes not request the memory region. This patch adds the functionof_io_request_and_mapwhich requests the memory region before mapping it.Signed-off-by Matthias Brugger <[email protected]>--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)drivers/of/address.c +0
-0
drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 727
Quoted 7 lines
drivers/of/address.c +4
-0@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node
I believe docbook requires this to be 1 line.
Quoted 5 lines
drivers/of/address.c +5
-0+* @device: the device whose io range will be mapped +* @index: index of the io range +* @name: name of the resource +* +* Returns a pointer to the requested and mapped memory
drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 742
Quoted 10 lines
drivers/of/address.c +10
-0+*/ +void __iomem *of_io_request_and_map (struct device_node *np,int index,char *name) +{ +struct resource res; +void __iomem *mem; + +if (of_address_to_resource (np, index, &res)) +return NULL ; + +if (!request_mem_region (res.start,resource_size (&res), name))
Use the np->name here and drop the name parameter.
Quoted 38 lines
drivers/of/address.c +9
-0+return NULL ; + + mem =ioremap (res.start,resource_size (&res)); +if (!mem) +release_mem_region (res.start,resource_size (&res)); + +return mem; +} +EXPORT_SYMBOL (of_io_request_and_map);include/linux/of_address.h +8
-1@@ -96,6 +96,8 @@ static inline struct of_pci_range *of_pci_range_parser_one(extern int of_address_to_resource (struct device_node *dev,int index,struct resource *r);void __iomem *of_iomap (struct device_node *node,int index); +void __iomem *of_io_request_and_map (struct device_node *device, +int index,char *name);#else static inline int of_address_to_resource (struct device_node *dev,int index,struct resource *r)@@ -107,6 +109,12 @@ static inline void __iomem *of_iomap(struct device_node *device, int index) {return NULL ; } + +static inline void __iomem *of_io_request_and_map (struct device_node *device, +int index,char *name) +{ +return NULL ; +}#endif #if defined(CONFIG_OF_ADDRESS ) && defined(CONFIG_PCI ) --1.7.9.5
PATCH v7 1/7 of: Provide function to request and map memory
Quoted 12 lines · Rob Herring
Quoted 10 lines · Matthias Brugger
A call to
of_iomapdoes not request the memory region. This patch adds the functionof_io_request_and_mapwhich requests the memory region before mapping it.Signed-off-by Matthias Brugger <[email protected]>--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)
Quoted 14 lines
drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 727
Quoted 12 lines
drivers/of/address.c +4
-0@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node I believe docbook requires this to be 1 line.
No longer so. That was fixed a couple of years ago.
Signature · 1 line
~Randy
PATCH v7 1/7 of: Provide function to request and map memory
In reply to Rob HerringQuoted 36 lines · Rob Herring
Quoted 15 lines · Matthias Brugger
A call to
of_iomapdoes not request the memory region. This patch adds the functionof_io_request_and_mapwhich requests the memory region before mapping it.Signed-off-by Matthias Brugger <[email protected]>--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)drivers/of/address.c +0
-0drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 727
Quoted 7 lines
drivers/of/address.c +4
-0@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node I believe docbook requires this to be 1 line.
Quoted 9 lines
drivers/of/address.c +9
-0+* @device: the device whose io range will be mapped +* @index: index of the io range +* @name: name of the resource +* +* Returns a pointer to the requested and mapped memory +*/ +void __iomem *of_io_request_and_map (struct device_node *np,int index,char *name) +{ +struct resource res;
Quoted 8 lines
drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 742
Quoted 6 lines
drivers/of/address.c +6
-0+void __iomem *mem; + +if (of_address_to_resource (np, index, &res)) +return NULL ; + +if (!request_mem_region (res.start,resource_size (&res), name))Use the
np->namehere and drop the name parameter.
Name here would be the name of the owner (the driver), not the name of the node. Passing the name separately is fine by me.
You can merge this with the rest of the series.
g.
Quoted 44 lines
Quoted 37 lines
drivers/of/address.c +9
-0+return NULL ; + + mem =ioremap (res.start,resource_size (&res)); +if (!mem) +release_mem_region (res.start,resource_size (&res)); + +return mem; +} +EXPORT_SYMBOL (of_io_request_and_map);include/linux/of_address.h +8
-1@@ -96,6 +96,8 @@ static inline struct of_pci_range *of_pci_range_parser_one(extern int of_address_to_resource (struct device_node *dev,int index,struct resource *r);void __iomem *of_iomap (struct device_node *node,int index); +void __iomem *of_io_request_and_map (struct device_node *device, +int index,char *name);#else static inline int of_address_to_resource (struct device_node *dev,int index,struct resource *r)@@ -107,6 +109,12 @@ static inline void __iomem *of_iomap(struct device_node *device, int index) {return NULL ; } + +static inline void __iomem *of_io_request_and_map (struct device_node *device, +int index,char *name) +{ +return NULL ; +}#endif #if defined(CONFIG_OF_ADDRESS ) && defined(CONFIG_PCI ) --Quoted 2 lines
1.7.9.5
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v7 1/7 of: Provide function to request and map memory
Quoted 46 lines · Grant Likely
Quoted 36 lines · Rob Herring
Quoted 15 lines · Matthias Brugger
A call to
of_iomapdoes not request the memory region. This patch adds the functionof_io_request_and_mapwhich requests the memory region before mapping it.Signed-off-by Matthias Brugger <[email protected]>--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)drivers/of/address.c +0
-0drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 727
Quoted 7 lines
drivers/of/address.c +4
-0@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node I believe docbook requires this to be 1 line.
Quoted 9 lines
drivers/of/address.c +9
-0+* @device: the device whose io range will be mapped +* @index: index of the io range +* @name: name of the resource +* +* Returns a pointer to the requested and mapped memory +*/ +void __iomem *of_io_request_and_map (struct device_node *np,int index,char *name) +{ +struct resource res;Quoted 8 lines
drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 742
Quoted 6 lines
drivers/of/address.c +6
-0+void __iomem *mem; + +if (of_address_to_resource (np, index, &res)) +return NULL ; + +if (!request_mem_region (res.start,resource_size (&res), name))Use the
np->namehere and drop the name parameter.
Quoted 2 lines
Name here would be the name of the owner (the driver), not the name of the node. Passing the name separately is fine by me.
This function is for when there is no driver. If there is a driver, the devm_* functions should be used. I would like to see some standard naming and consistency here rather than allowing random strings or NULL to be passed by the caller.
Rob
Matthias Brugger
maintainerPATCH v7 1/7 of: Provide function to request and map memory
2014-06-09 16:36 GMT+02:00 Rob Herring <[email protected]>:
Quoted 47 lines · Grant Likely
Quoted 46 lines · Rob Herring
Quoted 44 lines
Quoted 15 lines · Matthias Brugger
A call to
of_iomapdoes not request the memory region. This patch adds the functionof_io_request_and_mapwhich requests the memory region before mapping it.Signed-off-by Matthias Brugger <[email protected]>--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)drivers/of/address.c +0
-0drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 727
Quoted 7 lines
drivers/of/address.c +4
-0@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node I believe docbook requires this to be 1 line.
Quoted 5 lines
drivers/of/address.c +5
-0+* @device: the device whose io range will be mapped +* @index: index of the io range +* @name: name of the resource +* +* Returns a pointer to the requested and mapped memory drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 742
Quoted 10 lines
drivers/of/address.c +10
-0+*/ +void __iomem *of_io_request_and_map (struct device_node *np,int index,char *name) +{ +struct resource res; +void __iomem *mem; + +if (of_address_to_resource (np, index, &res)) +return NULL ; + +if (!request_mem_region (res.start,resource_size (&res), name))Use the
np->namehere and drop the name parameter.
Quoted 7 lines
Quoted 2 lines
Name here would be the name of the owner (the driver), not the name of the node. Passing the name separately is fine by me.
This function is for when there is no driver. If there is a driver, the devm_* functions should be used. I would like to see some standard naming and consistency here rather than allowing random strings or NULL to be passed by the caller.
A driver can request and map more then one memory region, so it is convenient that they have different names. Therefor the extra parameter.
Another possibility would be to use np->name together with the index to get unique names for every region requested by the driver
Regards,
Matthias
Signature · 1 line
motzblog.wordpress.com
PATCH v7 1/7 of: Provide function to request and map memory
In reply to Rob HerringQuoted 47 lines · Rob Herring
Quoted 46 lines · Grant Likely
Quoted 44 lines · Rob Herring
Quoted 15 lines · Matthias Brugger
A call to
of_iomapdoes not request the memory region. This patch adds the functionof_io_request_and_mapwhich requests the memory region before mapping it.Signed-off-by Matthias Brugger <[email protected]>--- drivers/of/address.c | 28 ++++++++++++++++++++++++++++ include/linux/of_address.h | 8 ++++++++ 2 files changed, 36 insertions(+)drivers/of/address.c +0
-0drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 727
Quoted 7 lines
drivers/of/address.c +4
-0@@ -721,3 +721,31 @@ void __iomem *of_iomap(struct device_node *np, int index)return ioremap (res.start,resource_size (&res)); }EXPORT_SYMBOL (of_iomap); + +/** +* of_io_request_and_map - Requests a resource and maps the memory mapped IO +* for a given device_node I believe docbook requires this to be 1 line.
Quoted 5 lines
drivers/of/address.c +5
-0+* @device: the device whose io range will be mapped +* @index: index of the io range +* @name: name of the resource +* +* Returns a pointer to the requested and mapped memory drivers/of/address.c void __iomem *of_iomap(struct device_node *np, int index) · line 742
Quoted 10 lines
drivers/of/address.c +10
-0+*/ +void __iomem *of_io_request_and_map (struct device_node *np,int index,char *name) +{ +struct resource res; +void __iomem *mem; + +if (of_address_to_resource (np, index, &res)) +return NULL ; + +if (!request_mem_region (res.start,resource_size (&res), name))Use the
np->namehere and drop the name parameter.
Quoted 7 lines
Quoted 2 lines
Name here would be the name of the owner (the driver), not the name of the node. Passing the name separately is fine by me.
This function is for when there is no driver. If there is a driver, the devm_* functions should be used. I would like to see some standard naming and consistency here rather than allowing random strings or NULL to be passed by the caller.
The node name doesn't provide a whole lot of help here though because we want to identify the code creating the resource, not the node. I'm not going to make a big deal about it. I've told Matthias on IRC that he can go ahead and merge it because it is a very minor issue. If you feel strongly about it, then we'll get him to change it or do a follow-up patch to change the function signature.
g.
Matthias Brugger
maintainerPATCH v7 2/7 clocksource: Add support for the Mediatek SoCs
In reply to Matthias BruggerThis patch adds a clock source and clock event for the timer found on the Mediatek SoCs.
The Mediatek General Purpose Timer block provides five 32 bit timers and one 64 bit timer.
Two 32 bit timers are used by this driver:
TIMER1: clock events supporting periodic and oneshot events
TIMER2: clock source configured as a free running counter
The General Purpose Timer block can be run with two clocks. A 13 MHz system clock and the RTC clock running at 32 KHz. This implementation uses the system clock with no clock source divider.
The interrupts are shared between the different timers and have to be read back from a register. We just enable one interrupt for the clock event. The clock event timer is used by all cores.
--- drivers/clocksource/Kconfig | 5 + drivers/clocksource/Makefile | 1 + drivers/clocksource/mtk_timer.c | 260 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 266 insertions(+) create mode 100644 drivers/clocksource/mtk_timer.c
drivers/clocksource/Kconfig +5 -0
@@ -144,6 +144,11 @@ config VF_PIT_TIMER config SYS_SUPPORTS_SH_CMT bool +config MTK_TIMER + select CLKSRC_OF + select CLKSRC_MMIO + bool + config SYS_SUPPORTS_SH_MTU2 bool
drivers/clocksource/Makefile +1 -0
@@ -33,6 +33,7 @@ obj-$(CONFIG_CLKSRC_EXYNOS_MCT) += exynos_mct.o obj-$(CONFIG_CLKSRC_SAMSUNG_PWM) += samsung_pwm_timer.o obj-$(CONFIG_VF_PIT_TIMER) += vf_pit_timer.o obj-$(CONFIG_CLKSRC_QCOM) += qcom-timer.o +obj-$(CONFIG_MTK_TIMER) += mtk_timer.o obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o
drivers/clocksource/mtk_timer.c new file +260 -0
260 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Matthias Brugger
maintainerPATCH v7 3/7 dt-bindings: add mtk-timer bindings
In reply to Matthias BruggerAdd binding documentation for the General Porpose Timer driver of the Mediatek SoCs.
--- .../bindings/timer/mediatek,mtk-timer.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt new file +18 -0
@@ -0,0 +1,18 @@ +Mediatek MT6577, MT6572 and MT6589 Timers +--------------------------------------- + +Required properties: +- compatible: Should be "mediatek,mt6577-timer" +- reg: Should contain location and length for timers register. +- clocks: Clocks driving the timer hardware. This list should include two + clocks. The order is system clock and as second clock the RTC clock. + +Examples: + + timer at 10008000 { + compatible = "mediatek,mt6577-timer"; + reg = <0x10008000 0x80>; + interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_LOW>; + clocks = <&system_clk>, <&rtc_clk>; + clock-names = "system-clk", "rtc-clk"; + };
Signature · 1 line
1.7.9.5
Matthias Brugger
maintainerPATCH v7 4/7 vendor-prefixes: add prefix for Mediaktek Inc.
In reply to Matthias Brugger--- .../devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -75,6 +75,7 @@ linux Linux-specific binding lsi LSI Corp. (LSI Logic) marvell Marvell Technology Group Ltd. maxim Maxim Integrated Products +mediatek MediaTek Inc. microchip Microchip Technology Inc. mosaixtech Mosaix Technologies, Inc. moxa Moxa
Signature · 1 line
1.7.9.5
Matthias Brugger
maintainerPATCH v7 5/7 arm: add basic support for Mediatek MT6589 boards
In reply to Matthias BruggerThis adds a generic devicetree board file and a dtsi for boards based on MT6589 SoCs from Mediatek.
Apart from the generic parts (gic, clocks) the only component currently supported are the timers.
--- arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/boot/dts/mt6589.dtsi | 94 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-mediatek/Kconfig | 6 +++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mediatek.c | 27 +++++++++++ 6 files changed, 131 insertions(+) create mode 100644 arch/arm/boot/dts/mt6589.dtsi create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/mediatek.c
arch/arm/Kconfig +2 -0
@@ -997,6 +997,8 @@ source "arch/arm/mach-mv78xx0/Kconfig" source "arch/arm/mach-imx/Kconfig" +source "arch/arm/mach-mediatek/Kconfig" + source "arch/arm/mach-mxs/Kconfig" source "arch/arm/mach-netx/Kconfig"
arch/arm/Makefile +1 -0
@@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_MSM) += msm machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 machine-$(CONFIG_ARCH_MVEBU) += mvebu machine-$(CONFIG_ARCH_MXC) += imx +machine-$(CONFIG_ARCH_MEDIATEK) += mediatek machine-$(CONFIG_ARCH_MXS) += mxs machine-$(CONFIG_ARCH_NETX) += netx machine-$(CONFIG_ARCH_NOMADIK) += nomadik
arch/arm/boot/dts/mt6589.dtsi new file +94 -0
94 lines not on this page · raw message
arch/arm/mach-mediatek/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +config ARCH_MEDIATEK + bool "Mediatek MT6589 SoC" if ARCH_MULTI_V7 + select ARM_GIC + select MTK_TIMER + help + Support for Mediatek Cortex-A7 Quad-Core-SoC MT6589.
arch/arm/mach-mediatek/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_ARCH_MEDIATEK) += mediatek.o
arch/arm/mach-mediatek/mediatek.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* Device Tree support for Mediatek SoCs +* +* Copyright (c) 2014 MundoReader S.L. +* Author: Matthias Brugger <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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. +*/ +#include <linux/init.h> +#include <asm/mach/arch.h> + +static const char *const mediatek_board_dt_compat[] = { +"mediatek,mt6589" , +NULL , +}; + +DT_MACHINE_START (MEDIATEK_DT ,"Mediatek Cortex-A7 (Device Tree)" ) + .dt_compat = mediatek_board_dt_compat, +MACHINE_END
Signature · 1 line
1.7.9.5
PATCH v7 5/7 arm: add basic support for Mediatek MT6589 boards
Quoted 95 lines · Matthias Brugger
This adds a generic devicetree board file and a dtsi for boards based on MT6589 SoCs from Mediatek.
Apart from the generic parts (gic, clocks) the only component currently supported are the timers.
Signed-off-by Matthias Brugger <[email protected]>--- arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/boot/dts/mt6589.dtsi | 94 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-mediatek/Kconfig | 6 +++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mediatek.c | 27 +++++++++++ 6 files changed, 131 insertions(+) create mode 100644 arch/arm/boot/dts/mt6589.dtsi create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/mediatek.carch/arm/Kconfig +2
-0@@ -997,6 +997,8 @@ source "arch/arm/mach-mv78xx0/Kconfig" source "arch/arm/mach-imx/Kconfig" +source "arch/arm/mach-mediatek/Kconfig" + source "arch/arm/mach-mxs/Kconfig" source "arch/arm/mach-netx/Kconfig"arch/arm/Makefile +1
-0@@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_MSM) += msm machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 machine-$(CONFIG_ARCH_MVEBU) += mvebu machine-$(CONFIG_ARCH_MXC) += imx +machine-$(CONFIG_ARCH_MEDIATEK) += mediatek machine-$(CONFIG_ARCH_MXS) += mxs machine-$(CONFIG_ARCH_NETX) += netx machine-$(CONFIG_ARCH_NOMADIK) += nomadikarch/arm/boot/dts/mt6589.dtsi new file +44
-0@@ -0,0 +1,94 @@ +/* + * Copyright (c) 2014 MundoReader S.L. + * Author: Matthias Brugger <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include "skeleton.dtsi" + +/ { + compatible = "mediatek,mt6589"; + interrupt-parent = <&gic>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x0>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x1>; + }; + cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x2>; + }; + cpu at 3 { + device_type = "cpu";
arch/arm/boot/dts/mt6589.dtsi line 54
Quoted 10 lines
arch/arm/boot/dts/mt6589.dtsi new file +10
-0+ compatible = "arm,cortex-a7"; + reg = <0x3>; + }; + + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges;
This is just nonsense. This /clocks node is in no way special -- /clocks was never reserved as a place to put clocks that we guarantee to probe. It's just an arbitrary containter node, and the fact we happen to probe clocks under it is an implementation detail (and arguably a bug).
I argued in the past to at least have them as a simple-bus, necessitating ranges, #address-cells, and #size-cells you have here, but you'r missing the compatible = "simple-bus", rendering the exercise pointless.
Quoted 9 lines
arch/arm/boot/dts/mt6589.dtsi new file +9
-0+ + system_clk: dummy13m { + compatible = "fixed-clock"; + clock-frequency = <13000000>; + #clock-cells = <0>; + }; + + rtc_clk: dummy32k { + compatible = "fixed-clock";
arch/arm/boot/dts/mt6589.dtsi line 73
Quoted 10 lines
arch/arm/boot/dts/mt6589.dtsi new file +10
-0+ clock-frequency = <32000>; + #clock-cells = <0>; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + clock-ranges;
Why the clock-ranges? You refer to them explicitly below.
Quoted 11 lines
arch/arm/boot/dts/mt6589.dtsi new file +11
-0+ ranges; + + timer: timer at 10008000 { + compatible = "mediatek,mt6577-timer"; + reg = <0x10008000 0x80>; + interrupts = <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>; + clocks = <&system_clk>, <&rtc_clk>; + clock-names = "system-clk", "rtc-clk"; + }; + + gic: interrupt-controller at 10212000 {
arch/arm/boot/dts/mt6589.dtsi line 94
Quoted 10 lines
arch/arm/boot/dts/mt6589.dtsi new file +10
-0+ compatible = "arm,cortex-a15-gic"; + interrupt-controller; + #interrupt-cells = <3>; + reg = <0x10211000 0x1000>, + <0x10212000 0x1000>, + <0x10214000 0x2000>, + <0x10216000 0x2000>; + }; + }; +};
No architected timers?
Quoted 42 lines
arch/arm/mach-mediatek/Kconfig new file +6
-0@@ -0,0 +1,6 @@ +config ARCH_MEDIATEK + bool "Mediatek MT6589 SoC" if ARCH_MULTI_V7 + select ARM_GIC + select MTK_TIMER + help + Support for Mediatek Cortex-A7 Quad-Core-SoC MT6589.arch/arm/mach-mediatek/Makefile new file +1
-0@@ -0,0 +1 @@ +obj-$(CONFIG_ARCH_MEDIATEK) += mediatek.oarch/arm/mach-mediatek/mediatek.c new file +17
-0@@ -0,0 +1,27 @@ +/* +* Device Tree support for Mediatek SoCs +* +* Copyright (c) 2014 MundoReader S.L. +* Author: Matthias Brugger <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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. +*/ +#include <linux/init.h>
arch/arm/mach-mediatek/mediatek.c line 27
Quoted 10 lines
arch/arm/mach-mediatek/mediatek.c new file +10
-0+#include <asm/mach/arch.h> + +static const char *const mediatek_board_dt_compat[] = { +"mediatek,mt6589" , +NULL , +}; + +DT_MACHINE_START (MEDIATEK_DT ,"Mediatek Cortex-A7 (Device Tree)" ) + .dt_compat = mediatek_board_dt_compat, +MACHINE_END
If this is all we have, surely we can get by with the defaults?
Cheers,
Mark.
Matthias Brugger
maintainerPATCH v7 5/7 arm: add basic support for Mediatek MT6589 boards
2014-06-05 20:21 GMT+02:00 Mark Rutland <[email protected]>:
Quoted 154 lines · Matthias Brugger
Quoted 95 lines
This adds a generic devicetree board file and a dtsi for boards based on MT6589 SoCs from Mediatek.
Apart from the generic parts (gic, clocks) the only component currently supported are the timers.
Signed-off-by Matthias Brugger <[email protected]>--- arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/boot/dts/mt6589.dtsi | 94 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-mediatek/Kconfig | 6 +++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mediatek.c | 27 +++++++++++ 6 files changed, 131 insertions(+) create mode 100644 arch/arm/boot/dts/mt6589.dtsi create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/mediatek.carch/arm/Kconfig +2
-0@@ -997,6 +997,8 @@ source "arch/arm/mach-mv78xx0/Kconfig" source "arch/arm/mach-imx/Kconfig" +source "arch/arm/mach-mediatek/Kconfig" + source "arch/arm/mach-mxs/Kconfig" source "arch/arm/mach-netx/Kconfig"arch/arm/Makefile +1
-0@@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_MSM) += msm machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 machine-$(CONFIG_ARCH_MVEBU) += mvebu machine-$(CONFIG_ARCH_MXC) += imx +machine-$(CONFIG_ARCH_MEDIATEK) += mediatek machine-$(CONFIG_ARCH_MXS) += mxs machine-$(CONFIG_ARCH_NETX) += netx machine-$(CONFIG_ARCH_NOMADIK) += nomadikarch/arm/boot/dts/mt6589.dtsi new file +44
-0@@ -0,0 +1,94 @@ +/* + * Copyright (c) 2014 MundoReader S.L. + * Author: Matthias Brugger <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include "skeleton.dtsi" + +/ { + compatible = "mediatek,mt6589"; + interrupt-parent = <&gic>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x0>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x1>; + }; + cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x2>; + }; + cpu at 3 { + device_type = "cpu";arch/arm/boot/dts/mt6589.dtsi line 54
Quoted 10 lines
arch/arm/boot/dts/mt6589.dtsi new file +10
-0+ compatible = "arm,cortex-a7"; + reg = <0x3>; + }; + + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges;This is just nonsense. This /clocks node is in no way special -- /clocks was never reserved as a place to put clocks that we guarantee to probe. It's just an arbitrary containter node, and the fact we happen to probe clocks under it is an implementation detail (and arguably a bug).
I argued in the past to at least have them as a simple-bus, necessitating ranges, #address-cells, and #size-cells you have here, but you'r missing the compatible = "simple-bus", rendering the exercise pointless.
Quoted 9 lines
arch/arm/boot/dts/mt6589.dtsi new file +9
-0+ + system_clk: dummy13m { + compatible = "fixed-clock"; + clock-frequency = <13000000>; + #clock-cells = <0>; + }; + + rtc_clk: dummy32k { + compatible = "fixed-clock";arch/arm/boot/dts/mt6589.dtsi line 73
Quoted 10 lines
arch/arm/boot/dts/mt6589.dtsi new file +10
-0+ clock-frequency = <32000>; + #clock-cells = <0>; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + clock-ranges;Why the clock-ranges? You refer to them explicitly below.
Quoted 15 lines
arch/arm/boot/dts/mt6589.dtsi new file +15
-0+ ranges; + + timer: timer at 10008000 { + compatible = "mediatek,mt6577-timer"; + reg = <0x10008000 0x80>; + interrupts = <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>; + clocks = <&system_clk>, <&rtc_clk>; + clock-names = "system-clk", "rtc-clk"; + }; + + gic: interrupt-controller at 10212000 { + compatible = "arm,cortex-a15-gic"; + interrupt-controller; + #interrupt-cells = <3>; + reg = <0x10211000 0x1000>,
Quoted 8 lines
arch/arm/boot/dts/mt6589.dtsi line 94
Quoted 6 lines
arch/arm/boot/dts/mt6589.dtsi new file +6
-0+ <0x10212000 0x1000>, + <0x10214000 0x2000>, + <0x10216000 0x2000>; + }; + }; +};No architected timers?
I was trying to get the arch timer working [0], but unfortunately with no luck.
[0] http://article.gmane.org/gmane.linux.ports.arm.kernel/321976
Quoted 48 lines
Quoted 48 lines
arch/arm/mach-mediatek/Kconfig new file +6
-0@@ -0,0 +1,6 @@ +config ARCH_MEDIATEK + bool "Mediatek MT6589 SoC" if ARCH_MULTI_V7 + select ARM_GIC + select MTK_TIMER + help + Support for Mediatek Cortex-A7 Quad-Core-SoC MT6589.arch/arm/mach-mediatek/Makefile new file +1
-0@@ -0,0 +1 @@ +obj-$(CONFIG_ARCH_MEDIATEK) += mediatek.oarch/arm/mach-mediatek/mediatek.c new file +21
-0@@ -0,0 +1,27 @@ +/* +* Device Tree support for Mediatek SoCs +* +* Copyright (c) 2014 MundoReader S.L. +* Author: Matthias Brugger <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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. +*/ +#include <linux/init.h> +#include <asm/mach/arch.h> + +static const char *const mediatek_board_dt_compat[] = { +"mediatek,mt6589" ,
Quoted 8 lines
arch/arm/mach-mediatek/mediatek.c line 27
Quoted 6 lines
arch/arm/mach-mediatek/mediatek.c new file +6
-0+ NULL, +}; + +DT_MACHINE_START (MEDIATEK_DT ,"Mediatek Cortex-A7 (Device Tree)" ) + .dt_compat = mediatek_board_dt_compat, +MACHINE_END If this is all we have, surely we can get by with the defaults?
We reach to the point where the bootconsole gets disabled. Due to the still missing console driver, we get stuck there.
Best regards,
Matthias
Quoted 8 lines
Cheers,
Mark._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 1 line
motzblog.wordpress.com
Matthias Brugger
maintainerPATCH v7 6/7 dt-bindings: add documentation for Mediatek SoC
In reply to Matthias BruggerThis adds a DT binding documentation for the MT6589 SoC from Mediatek.
--- Documentation/devicetree/bindings/arm/mediatek.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek.txt
Documentation/devicetree/bindings/arm/mediatek.txt new file +8 -0
@@ -0,0 +1,8 @@ +Mediatek MT6589 Platforms Device Tree Bindings + +Boards with a SoC of the Mediatek MT6589 shall have the following property: + +Required root node property: + +compatible: must contain "mediatek,mt6589" +
Signature · 1 line
1.7.9.5
Matthias Brugger
maintainerPATCH v7 7/7 arm: mediatek: add dts for Aquaris5 mobile phone
In reply to Matthias BruggerThe Aquaris5 is a mobile phone based on the MT6589 SoC.
--- arch/arm/boot/dts/mt6589-aquaris5.dts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 arch/arm/boot/dts/mt6589-aquaris5.dts
arch/arm/boot/dts/mt6589-aquaris5.dts new file +25 -0
@@ -0,0 +1,25 @@ +/* + * Copyright (c) 2014 MundoReader S.L. + * Author: Matthias Brugger <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +/dts-v1/; +#include "mt6589.dtsi" + +/ { + model = "bq Aquaris5"; + + memory { + reg = <0x80000000 0x40000000>; + }; +};
Signature · 1 line
1.7.9.5