From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:55:07
Actions Semiconductor was listed on NASDAQ as ACTS until Dec 16, 2016.
Cc: mp-cs at actions-semi.com
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v2 -> v3:
* Fixed sort order after rename
v1 -> v2:
* Reverted from "acts" to "actions" (cf. IAP140 "mrvl" vs. "marvell")
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:55:09
The Actions Semi S500 is a quad-core ARM Cortex-A9 SoC.
The LeMaker Guitar is an SODIMM-format module with that SoC.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v2 -> v3 -> v4: unchanged
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended text
Documentation/devicetree/bindings/arm/actions.txt | 24 +++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/actions.txt
@@ -961,6 +961,12 @@ must already be setup and configured. Options are not yet supported.+ owl,<addr>+ Start an early, polled-mode console on a serial port+ of an Actions Semi SoC, such as S500 or S900, at the+ specified address. The serial port must already be+ setup and configured. Options are not yet supported.+ smh Use ARM semihosting calls for early console. s3c2410,<addr>
@@ -0,0 +1,17 @@+Actions Semi Owl Smart Power System (SPS)++Required properties:+- compatible : "actions,s500-sps" for S500+- reg : Offset and length of the register set for the device.+- #power-domain-cells : Must be 1.+ See macros in:+ include/dt-bindings/power/s500-powergate.h for S500+++Example:++ sps: power-controller at b01b0100 {+ compatible = "actions,s500-sps";+ reg = <0xb01b0100 0x100>;+ #power-domain-cells = <1>;+ };
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:55:26
Give the serial driver a fixed-clock as input for baudrate 115200.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v2 -> v3 -> v4: unchanged
v2: new
arch/arm64/boot/dts/actions/s900-bubblegum-96.dts | 7 +++++++
1 file changed, 7 insertions(+)
@@ -1689,7 +1689,7 @@ config SERIAL_MVEBU_CONSOLEOtherwise,say'N'.configSERIAL_OWL-bool"Actions Semi Owl serial port support"+tristate"Actions Semi Owl serial port support"depends onARCH_ACTIONS||COMPILE_TESTselectSERIAL_COREhelp
@@ -54,6 +92,380 @@ static inline u32 owl_uart_read(struct uart_port *port, unsigned int off)returnreadl(port->membase+off);}+staticvoidowl_uart_set_mctrl(structuart_port*port,unsignedintmctrl)+{+}++staticunsignedintowl_uart_get_mctrl(structuart_port*port)+{+returnTIOCM_CAR|TIOCM_DSR|TIOCM_CTS;+}++staticunsignedintowl_uart_tx_empty(structuart_port*port)+{+unsignedlongflags;+u32val;+unsignedintret;++spin_lock_irqsave(&port->lock,flags);++val=owl_uart_read(port,OWL_UART_STAT);+ret=(val&OWL_UART_STAT_TFES)?TIOCSER_TEMT:0;++spin_unlock_irqrestore(&port->lock,flags);++returnret;+}++staticvoidowl_uart_stop_rx(structuart_port*port)+{+u32val;++val=owl_uart_read(port,OWL_UART_CTL);+val&=~(OWL_UART_CTL_RXIE|OWL_UART_CTL_RXDE);+owl_uart_write(port,val,OWL_UART_CTL);++val=owl_uart_read(port,OWL_UART_STAT);+val|=OWL_UART_STAT_RIP;+owl_uart_write(port,val,OWL_UART_STAT);+}++staticvoidowl_uart_stop_tx(structuart_port*port)+{+u32val;++val=owl_uart_read(port,OWL_UART_CTL);+val&=~(OWL_UART_CTL_TXIE|OWL_UART_CTL_TXDE);+owl_uart_write(port,val,OWL_UART_CTL);++val=owl_uart_read(port,OWL_UART_STAT);+val|=OWL_UART_STAT_TIP;+owl_uart_write(port,val,OWL_UART_STAT);+}++staticvoidowl_uart_start_tx(structuart_port*port)+{+u32val;++if(uart_tx_stopped(port)){+owl_uart_stop_tx(port);+return;+}++val=owl_uart_read(port,OWL_UART_STAT);+val|=OWL_UART_STAT_TIP;+owl_uart_write(port,val,OWL_UART_STAT);++val=owl_uart_read(port,OWL_UART_CTL);+val|=OWL_UART_CTL_TXIE;+owl_uart_write(port,val,OWL_UART_CTL);+}++staticvoidowl_uart_send_chars(structuart_port*port)+{+structcirc_buf*xmit=&port->state->xmit;+unsignedintch;++if(uart_tx_stopped(port))+return;++if(port->x_char){+while(!(owl_uart_read(port,OWL_UART_STAT)&OWL_UART_STAT_TFFU))+cpu_relax();+owl_uart_write(port,port->x_char,OWL_UART_TXDAT);+port->icount.tx++;+port->x_char=0;+}++while(!(owl_uart_read(port,OWL_UART_STAT)&OWL_UART_STAT_TFFU)){+if(uart_circ_empty(xmit))+break;++ch=xmit->buf[xmit->tail];+owl_uart_write(port,ch,OWL_UART_TXDAT);+xmit->tail=(xmit->tail+1)&(SERIAL_XMIT_SIZE-1);+port->icount.tx++;+}++if(uart_circ_chars_pending(xmit)<WAKEUP_CHARS)+uart_write_wakeup(port);++if(uart_circ_empty(xmit))+owl_uart_stop_tx(port);+}++staticvoidowl_uart_receive_chars(structuart_port*port)+{+u32stat,val;++val=owl_uart_read(port,OWL_UART_CTL);+val&=~OWL_UART_CTL_TRFS_TX;+owl_uart_write(port,val,OWL_UART_CTL);++stat=owl_uart_read(port,OWL_UART_STAT);+while(!(stat&OWL_UART_STAT_RFEM)){+charflag=TTY_NORMAL;++if(stat&OWL_UART_STAT_RXER)+port->icount.overrun++;++if(stat&OWL_UART_STAT_RXST){+/* We are not able to distinguish the error type. */+port->icount.brk++;+port->icount.frame++;++stat&=port->read_status_mask;+if(stat&OWL_UART_STAT_RXST)+flag=TTY_PARITY;+}else+port->icount.rx++;++val=owl_uart_read(port,OWL_UART_RXDAT);+val&=0xff;++if((stat&port->ignore_status_mask)==0)+tty_insert_flip_char(&port->state->port,val,flag);++stat=owl_uart_read(port,OWL_UART_STAT);+}++spin_unlock(&port->lock);+tty_flip_buffer_push(&port->state->port);+spin_lock(&port->lock);+}++staticirqreturn_towl_uart_irq(intirq,void*dev_id)+{+structuart_port*port=(structuart_port*)dev_id;+u32stat;++spin_lock(&port->lock);++stat=owl_uart_read(port,OWL_UART_STAT);++if(stat&OWL_UART_STAT_RIP)+owl_uart_receive_chars(port);++if(stat&OWL_UART_STAT_TIP)+owl_uart_send_chars(port);++stat=owl_uart_read(port,OWL_UART_STAT);+stat|=OWL_UART_STAT_RIP|OWL_UART_STAT_TIP;+owl_uart_write(port,stat,OWL_UART_STAT);++spin_unlock(&port->lock);++returnIRQ_HANDLED;+}++staticvoidowl_uart_shutdown(structuart_port*port)+{+u32val;+unsignedlongflags;++spin_lock_irqsave(&port->lock,flags);++val=owl_uart_read(port,OWL_UART_CTL);+val&=~(OWL_UART_CTL_TXIE|OWL_UART_CTL_RXIE+|OWL_UART_CTL_TXDE|OWL_UART_CTL_RXDE|OWL_UART_CTL_EN);+owl_uart_write(port,val,OWL_UART_CTL);++spin_unlock_irqrestore(&port->lock,flags);++free_irq(port->irq,port);+}++staticintowl_uart_startup(structuart_port*port)+{+u32val;+unsignedlongflags;+intret;++ret=request_irq(port->irq,owl_uart_irq,IRQF_TRIGGER_HIGH,+"owl-uart",port);+if(ret)+returnret;++spin_lock_irqsave(&port->lock,flags);++val=owl_uart_read(port,OWL_UART_STAT);+val|=OWL_UART_STAT_RIP|OWL_UART_STAT_TIP+|OWL_UART_STAT_RXER|OWL_UART_STAT_TFER|OWL_UART_STAT_RXST;+owl_uart_write(port,val,OWL_UART_STAT);++val=owl_uart_read(port,OWL_UART_CTL);+val|=OWL_UART_CTL_RXIE|OWL_UART_CTL_TXIE;+val|=OWL_UART_CTL_EN;+owl_uart_write(port,val,OWL_UART_CTL);++spin_unlock_irqrestore(&port->lock,flags);++return0;+}++staticvoidowl_uart_change_baudrate(structowl_uart_port*owl_port,+unsignedlongbaud)+{+clk_set_rate(owl_port->clk,baud*8);+}++staticvoidowl_uart_set_termios(structuart_port*port,+structktermios*termios,+structktermios*old)+{+structowl_uart_port*owl_port=to_owl_uart_port(port);+unsignedintbaud;+u32ctl;+unsignedlongflags;++spin_lock_irqsave(&port->lock,flags);++/* We don't support modem control lines. */+termios->c_cflag&=~(HUPCL|CMSPAR);+termios->c_cflag|=CLOCAL;++/* We don't support BREAK character recognition. */+termios->c_iflag&=~(IGNBRK|BRKINT);++ctl=owl_uart_read(port,OWL_UART_CTL);++ctl&=~OWL_UART_CTL_DWLS_MASK;+switch(termios->c_cflag&CSIZE){+caseCS5:+ctl|=OWL_UART_CTL_DWLS_5BITS;+break;+caseCS6:+ctl|=OWL_UART_CTL_DWLS_6BITS;+break;+caseCS7:+ctl|=OWL_UART_CTL_DWLS_7BITS;+break;+caseCS8:+default:+ctl|=OWL_UART_CTL_DWLS_8BITS;+break;+}++if(termios->c_cflag&CSTOPB)+ctl|=OWL_UART_CTL_STPS_2BITS;+else+ctl&=~OWL_UART_CTL_STPS_2BITS;++ctl&=~OWL_UART_CTL_PRS_MASK;+if(termios->c_cflag&PARENB){+if(termios->c_cflag&CMSPAR){+if(termios->c_cflag&PARODD)+ctl|=OWL_UART_CTL_PRS_MARK;+else+ctl|=OWL_UART_CTL_PRS_SPACE;+}elseif(termios->c_cflag&PARODD)+ctl|=OWL_UART_CTL_PRS_ODD;+else+ctl|=OWL_UART_CTL_PRS_EVEN;+}else+ctl|=OWL_UART_CTL_PRS_NONE;++if(termios->c_cflag&CRTSCTS)+ctl|=OWL_UART_CTL_AFE;+else+ctl&=~OWL_UART_CTL_AFE;++owl_uart_write(port,ctl,OWL_UART_CTL);++baud=uart_get_baud_rate(port,termios,old,9600,3200000);+owl_uart_change_baudrate(owl_port,baud);++port->read_status_mask|=OWL_UART_STAT_RXER;+if(termios->c_iflag&INPCK)+port->read_status_mask|=OWL_UART_STAT_RXST;++uart_update_timeout(port,termios->c_cflag,baud);++spin_unlock_irqrestore(&port->lock,flags);+}++staticvoidowl_uart_release_port(structuart_port*port)+{+structplatform_device*pdev=to_platform_device(port->dev);+structresource*res;++res=platform_get_resource(pdev,IORESOURCE_MEM,0);+if(!res)+return;++if(port->flags&UPF_IOREMAP){+devm_release_mem_region(port->dev,port->mapbase,+resource_size(res));+devm_iounmap(port->dev,port->membase);+port->membase=NULL;+}+}++staticintowl_uart_request_port(structuart_port*port)+{+structplatform_device*pdev=to_platform_device(port->dev);+structresource*res;++res=platform_get_resource(pdev,IORESOURCE_MEM,0);+if(!res)+return-ENXIO;++if(!devm_request_mem_region(port->dev,port->mapbase,+resource_size(res),dev_name(port->dev)))+return-EBUSY;++if(port->flags&UPF_IOREMAP){+port->membase=devm_ioremap_nocache(port->dev,port->mapbase,+resource_size(res));+if(!port->membase)+return-EBUSY;+}++return0;+}++staticconstchar*owl_uart_type(structuart_port*port)+{+return(port->type==PORT_OWL)?"owl-uart":NULL;+}++staticintowl_uart_verify_port(structuart_port*port,+structserial_struct*ser)+{+if(port->type!=PORT_OWL)+return-EINVAL;++if(port->irq!=ser->irq)+return-EINVAL;++return0;+}++staticvoidowl_uart_config_port(structuart_port*port,intflags)+{+if(flags&UART_CONFIG_TYPE){+port->type=PORT_OWL;+owl_uart_request_port(port);+}+}++staticstructuart_opsowl_uart_ops={+.set_mctrl=owl_uart_set_mctrl,+.get_mctrl=owl_uart_get_mctrl,+.tx_empty=owl_uart_tx_empty,+.start_tx=owl_uart_start_tx,+.stop_rx=owl_uart_stop_rx,+.stop_tx=owl_uart_stop_tx,+.startup=owl_uart_startup,+.shutdown=owl_uart_shutdown,+.set_termios=owl_uart_set_termios,+.type=owl_uart_type,+.config_port=owl_uart_config_port,+.request_port=owl_uart_request_port,+.release_port=owl_uart_release_port,+.verify_port=owl_uart_verify_port,+};+#ifdef CONFIG_SERIAL_OWL_CONSOLEstaticvoidowl_console_putchar(structuart_port*port,intch)
@@ -132,4 +595,130 @@ owl_uart_early_console_setup(struct earlycon_device *device, const char *opt)OF_EARLYCON_DECLARE(owl,"actions,owl-uart",owl_uart_early_console_setup);-#endif /* CONFIG_SERIAL_OWL_CONSOLE */+#define OWL_UART_CONSOLE (&owl_uart_console)+#else+#define OWL_UART_CONSOLE NULL+#endif++staticstructuart_driverowl_uart_driver={+.owner=THIS_MODULE,+.driver_name="owl-uart",+.dev_name=OWL_UART_DEV_NAME,+.nr=OWL_UART_PORT_NUM,+.cons=OWL_UART_CONSOLE,+};++staticintowl_uart_probe(structplatform_device*pdev)+{+structresource*res_mem,*res_irq;+structowl_uart_port*owl_port;+intret;++if(pdev->dev.of_node)+pdev->id=of_alias_get_id(pdev->dev.of_node,"serial");++if(pdev->id<0||pdev->id>=OWL_UART_PORT_NUM){+dev_err(&pdev->dev,"id %d out of range\n",pdev->id);+return-EINVAL;+}++res_mem=platform_get_resource(pdev,IORESOURCE_MEM,0);+if(!res_mem){+dev_err(&pdev->dev,"could not get mem\n");+return-ENODEV;+}++res_irq=platform_get_resource(pdev,IORESOURCE_IRQ,0);+if(!res_irq){+dev_err(&pdev->dev,"could not get irq\n");+return-ENODEV;+}++if(owl_uart_ports[pdev->id]){+dev_err(&pdev->dev,"port %d already allocated\n",pdev->id);+return-EBUSY;+}++owl_port=devm_kzalloc(&pdev->dev,sizeof(*owl_port),GFP_KERNEL);+if(!owl_port)+return-ENOMEM;++owl_port->clk=clk_get(&pdev->dev,NULL);+if(IS_ERR(owl_port->clk)){+dev_err(&pdev->dev,"could not get clk\n");+returnPTR_ERR(owl_port->clk);+}++owl_port->port.dev=&pdev->dev;+owl_port->port.line=pdev->id;+owl_port->port.type=PORT_OWL;+owl_port->port.iotype=UPIO_MEM;+owl_port->port.mapbase=res_mem->start;+owl_port->port.irq=res_irq->start;+owl_port->port.uartclk=clk_get_rate(owl_port->clk);+owl_port->port.flags=UPF_BOOT_AUTOCONF|UPF_IOREMAP|UPF_LOW_LATENCY;+owl_port->port.x_char=0;+owl_port->port.fifosize=16;+owl_port->port.ops=&owl_uart_ops;++owl_uart_ports[pdev->id]=owl_port;+platform_set_drvdata(pdev,owl_port);++ret=uart_add_one_port(&owl_uart_driver,&owl_port->port);+if(ret)+owl_uart_ports[pdev->id]=NULL;++returnret;+}++staticintowl_uart_remove(structplatform_device*pdev)+{+structowl_uart_port*owl_port;++owl_port=platform_get_drvdata(pdev);+uart_remove_one_port(&owl_uart_driver,&owl_port->port);+owl_uart_ports[pdev->id]=NULL;++return0;+}++staticconststructof_device_idowl_uart_dt_matches[]={+{.compatible="actions,owl-uart"},+{}+};+MODULE_DEVICE_TABLE(of,owl_uart_dt_matches);++staticstructplatform_driverowl_uart_platform_driver={+.probe=owl_uart_probe,+.remove=owl_uart_remove,+.driver={+.name="owl-uart",+.of_match_table=owl_uart_dt_matches,+},+};++staticint__initowl_uart_init(void)+{+intret;++ret=uart_register_driver(&owl_uart_driver);+if(ret)+returnret;++ret=platform_driver_register(&owl_uart_platform_driver);+if(ret)+uart_unregister_driver(&owl_uart_driver);++returnret;+}++staticvoid__initowl_uart_exit(void)+{+platform_driver_unregister(&owl_uart_platform_driver);+uart_unregister_driver(&owl_uart_driver);+}++module_init(owl_uart_init);+module_exit(owl_uart_exit);++MODULE_LICENSE("GPL");
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:55:32
CPU2 has its own power domain PD_CPU2, and CPU3 has PD_CPU3.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v4: new (split off due to dt-bindings dependency)
arch/arm/boot/dts/s500.dtsi | 3 +++
1 file changed, 3 insertions(+)
@@ -193,6 +193,7 @@ nodes to be present and contain the properties described below. "spin-table" # On ARM 32-bit systems this property is optional and can be one of:+ "actions,s500-smp" "allwinner,sun6i-a31" "allwinner,sun8i-a23" "arm,realview-smp"
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:56:13
Add file patterns to cover the SPS power domain driver and DT binding.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v4: new
MAINTAINERS | 3 +++
1 file changed, 3 insertions(+)
@@ -1,5 +1,6 @@menu"SOC (System On Chip) specific Drivers"+source"drivers/soc/actions/Kconfig"source"drivers/soc/atmel/Kconfig"source"drivers/soc/bcm/Kconfig"source"drivers/soc/fsl/Kconfig"
@@ -2,6 +2,7 @@# Makefile for the Linux Kernel SOC specific device drivers.#+obj-$(CONFIG_ARCH_ACTIONS)+=actions/obj-$(CONFIG_ARCH_AT91)+=atmel/obj-y+=bcm/obj-$(CONFIG_ARCH_DOVE)+=dove/
@@ -58,14 +65,27 @@ void owl_secondary_startup(void);staticints500_wakeup_secondary(unsignedintcpu){+intret;+if(cpu>3)return-EINVAL;+/* The generic PM domain driver is not available this early. */switch(cpu){case2:+ret=owl_sps_set_pg(sps_base_addr,+OWL_SPS_PG_CTL_PWR_CPU2,+OWL_SPS_PG_CTL_ACK_CPU2,true);+if(ret)+returnret;+break;case3:-/* CPU2/3 are power-gated */-return-EINVAL;+ret=owl_sps_set_pg(sps_base_addr,+OWL_SPS_PG_CTL_PWR_CPU3,+OWL_SPS_PG_CTL_ACK_CPU3,true);+if(ret)+returnret;+break;}/* wait for CPUx to run to WFE instruction */
@@ -133,6 +153,18 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)return;}+node=of_find_compatible_node(NULL,NULL,"actions,s500-sps");+if(!node){+pr_err("%s: missing sps\n",__func__);+return;+}++sps_base_addr=of_iomap(node,0);+if(!sps_base_addr){+pr_err("%s: could not map sps registers\n",__func__);+return;+}+if(read_cpuid_part()==ARM_CPU_PART_CORTEX_A9){node=of_find_compatible_node(NULL,NULL,"arm,cortex-a9-scu");if(!node){
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:56:49
Use a custom S500 enable-method for all CPUs.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v3: new
arch/arm/boot/dts/s500.dtsi | 4 ++++
1 file changed, 4 insertions(+)
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-06 00:57:38
Add Smart Power System node for PM domains.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4:
* Extended commit message
* Split off association of power-domains (avoids include/dt-bindings/ dependency)
v3: new
arch/arm/boot/dts/s500.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
@@ -0,0 +1,166 @@+/*+*ActionsSemiLeopard+*+*Thisfileisbasedonarmrealviewsmpplatform.+*+*Copyright2012ActionsSemiInc.+*Author:ActionsSemi,Inc.+*+*Copyright(c)2017AndreasF?rber+*+*Thisprogramisfreesoftware;youcanredistributeitand/ormodifyit+*underthetermsoftheGNUGeneralPublicLicenseaspublishedbythe+*FreeSoftwareFoundation;eitherversion2oftheLicense,or(atyour+*option)anylaterversion.+*/++#include<linux/delay.h>+#include<linux/io.h>+#include<linux/of.h>+#include<linux/of_address.h>+#include<linux/smp.h>+#include<asm/cacheflush.h>+#include<asm/smp_plat.h>+#include<asm/smp_scu.h>++#define OWL_CPU1_ADDR 0x50+#define OWL_CPU1_FLAG 0x5c++#define OWL_CPUx_FLAG_BOOT 0x55aa++staticvoid__iomem*scu_base_addr;+staticvoid__iomem*timer_base_addr;+staticintncores;++staticDEFINE_SPINLOCK(boot_lock);++staticvoidwrite_pen_release(intval)+{+pen_release=val;+smp_wmb();+__cpuc_flush_dcache_area((void*)&pen_release,sizeof(pen_release));+outer_clean_range(__pa(&pen_release),__pa(&pen_release+1));+}++staticvoids500_smp_secondary_init(unsignedintcpu)+{+/*+*lettheprimaryprocessorknowwe'reoutofthe+*pen,thenheadoffintotheCentrypoint+*/+write_pen_release(-1);++spin_lock(&boot_lock);+spin_unlock(&boot_lock);+}++voidowl_secondary_startup(void);++staticints500_wakeup_secondary(unsignedintcpu)+{+if(cpu>3)+return-EINVAL;++switch(cpu){+case2:+case3:+/* CPU2/3 are power-gated */+return-EINVAL;+}++/* wait for CPUx to run to WFE instruction */+udelay(200);++writel(virt_to_phys(owl_secondary_startup),+timer_base_addr+OWL_CPU1_ADDR+(cpu-1)*4);+writel(OWL_CPUx_FLAG_BOOT,+timer_base_addr+OWL_CPU1_FLAG+(cpu-1)*4);++dsb_sev();+mb();++return0;+}++staticints500_smp_boot_secondary(unsignedintcpu,structtask_struct*idle)+{+unsignedlongtimeout;+intret;++ret=s500_wakeup_secondary(cpu);+if(ret)+returnret;++udelay(10);++spin_lock(&boot_lock);++/*+*Thesecondaryprocessoriswaitingtobereleasedfrom+*theholdingpen-releaseit,thenwaitforittoflag+*thatithasbeenreleasedbyresettingpen_release.+*/+write_pen_release(cpu_logical_map(cpu));+smp_send_reschedule(cpu);++timeout=jiffies+(1*HZ);+while(time_before(jiffies,timeout)){+if(pen_release==-1)+break;+}++writel(0,timer_base_addr+OWL_CPU1_ADDR+(cpu-1)*4);+writel(0,timer_base_addr+OWL_CPU1_FLAG+(cpu-1)*4);++spin_unlock(&boot_lock);++returnpen_release!=-1?-ENOSYS:0;+}++staticvoid__inits500_smp_prepare_cpus(unsignedintmax_cpus)+{+structdevice_node*node;++node=of_find_compatible_node(NULL,NULL,"actions,s500-timer");+if(!node){+pr_err("%s: missing timer\n",__func__);+return;+}++timer_base_addr=of_iomap(node,0);+if(!timer_base_addr){+pr_err("%s: could not map timer registers\n",__func__);+return;+}++if(read_cpuid_part()==ARM_CPU_PART_CORTEX_A9){+node=of_find_compatible_node(NULL,NULL,"arm,cortex-a9-scu");+if(!node){+pr_err("%s: missing scu\n",__func__);+return;+}++scu_base_addr=of_iomap(node,0);+if(!scu_base_addr){+pr_err("%s: could not map scu registers\n",__func__);+return;+}++/*+*Whilethenumberofcpusisgatheredfromdt,alsogetthe+*numberofcoresfromthescutoverifythisvaluewhen+*bootingthecores.+*/+ncores=scu_get_core_count(scu_base_addr);+pr_debug("%s: ncores %d\n",__func__,ncores);++scu_enable(scu_base_addr);+}+}++staticconststructsmp_operationss500_smp_ops__initconst={+.smp_prepare_cpus=s500_smp_prepare_cpus,+.smp_secondary_init=s500_smp_secondary_init,+.smp_boot_secondary=s500_smp_boot_secondary,+};+CPU_METHOD_OF_DECLARE(s500_smp,"actions,s500-smp",&s500_smp_ops);
@@ -1688,6 +1688,25 @@ config SERIAL_MVEBU_CONSOLEandwarningsandwhichallowsloginsinsingleusermode)Otherwise,say'N'.+configSERIAL_OWL+bool"Actions Semi Owl serial port support"+depends onARCH_ACTIONS||COMPILE_TEST+selectSERIAL_CORE+help+ThisdriverisforActionsSemiconductorS500/S900SoC'sUART.+Say'Y'hereifyouwishtousetheon-boardserialport.+Otherwise,say'N'.++configSERIAL_OWL_CONSOLE+bool"Console on Actions Semi Owl serial port"+depends onSERIAL_OWL=y+selectSERIAL_CORE_CONSOLE+selectSERIAL_EARLYCON+defaulty+help+Say'Y'hereifyouwishtouseActionsSemiconductorS500/S900UART+asthesystemconsole.Onlyearlyconisimplementedcurrently.+endmenuconfigSERIAL_MCTRL_GPIO
@@ -0,0 +1,16 @@+Actions Semi Owl UART++Required properties:+- compatible : "actions,s500-uart", "actions,owl-uart" for S500+ "actions,s900-uart", "actions,owl-uart" for S900+- reg : Offset and length of the register set for the device.+- interrupts : Should contain UART interrupt.+++Example:++ uart3: serial at b0126000 {+ compatible = "actions,s500-uart", "actions,owl-uart";+ reg = <0xb0126000 0x1000>;+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;+ };
@@ -151,6 +151,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000# Machine directory name. This list is sorted alphanumerically# by CONFIG_* macro name.+machine-$(CONFIG_ARCH_ACTIONS)+=actionsmachine-$(CONFIG_ARCH_ALPINE)+=alpinemachine-$(CONFIG_ARCH_ARTPEC)+=artpecmachine-$(CONFIG_ARCH_AT91)+=at91
You should re-encode the resulting baud rate into the termios
/* Don't rewrite B0 */
if (tty_termios_baud_rate(termios))
tty_termios_encode_baud_rate(termios, baud, baud);
From: Daniel Lezcano <hidden> Date: 2017-06-06 16:34:03
On Tue, Jun 06, 2017 at 02:54:02AM +0200, Andreas F?rber wrote:
The Actions Semi S500 SoC provides four timers, 2Hz0/1 and 32-bit TIMER0/1.
Use TIMER0 as clocksource and TIMER1 as clockevents.
Based on LeMaker linux-actions tree.
An S500 datasheet can be found on the LeMaker Guitar pages:
http://www.lemaker.org/product-guitar-download-29.html
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
+static int owl_uart_probe(struct platform_device *pdev)
+{
+ struct resource *res_mem, *res_irq;
+ struct owl_uart_port *owl_port;
+ int ret;
+
+ if (pdev->dev.of_node)
+ pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
+
+ if (pdev->id < 0 || pdev->id >= OWL_UART_PORT_NUM) {
+ dev_err(&pdev->dev, "id %d out of range\n", pdev->id);
+ return -EINVAL;
+ }
+
+ res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res_mem) {
+ dev_err(&pdev->dev, "could not get mem\n");
+ return -ENODEV;
+ }
You can use
struct resource *mem;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
x = devm_ioremap_resource();
if (IS_ERR(x))
return PTR_ERR(x);
and remote IOREMAP flag below.
+ res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!res_irq) {
+ dev_err(&pdev->dev, "could not get irq\n");
+ return -ENODEV;
+ }
+
+ ret = uart_add_one_port(&owl_uart_driver, &owl_port->port);
+ if (ret)
+ owl_uart_ports[pdev->id] = NULL;
...and thus, taking into consideration redundancy of that global var:
ret = uart_add_one_port(&owl_uart_driver, &owl_port->port);
if (ret)
retrun ret;
platform_set_drvdata(pdev, owl_port);
return 0;
+ return ret;
+}
+
+static int owl_uart_remove(struct platform_device *pdev)
+{
To make a start somewhere, given Daniel's ack for OWL_TIMER, I'm
applying this to my new linux-actions.git v4.13/arm64 branch:
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git/log/?h=v4.13/arm64
For arm I'm still giving Actions Semi a final chance to comment on the
vendor prefix and DT bindings (none on v3 and none for a week for v4).
Regards,
Andreas
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-18 18:46:41
Am 06.06.2017 um 02:53 schrieb Andreas F?rber:
Actions Semiconductor was listed on NASDAQ as ACTS until Dec 16, 2016.
Cc: mp-cs at actions-semi.com
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v2 -> v3:
* Fixed sort order after rename
v1 -> v2:
* Reverted from "acts" to "actions" (cf. IAP140 "mrvl" vs. "marvell")
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
With still no Acked-by or other reply from Actions, I have now applied
this patch to linux-actions.git v4.13/dt branch:
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git/log/?h=v4.13/dt
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-18 18:48:07
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
The Actions Semi S500 is a quad-core ARM Cortex-A9 SoC.
The LeMaker Guitar is an SODIMM-format module with that SoC.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v2 -> v3 -> v4: unchanged
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended text
Documentation/devicetree/bindings/arm/actions.txt | 24 +++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/actions.txt
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-18 20:43:59
Am 06.06.2017 um 18:33 schrieb Daniel Lezcano:
On Tue, Jun 06, 2017 at 02:54:02AM +0200, Andreas F?rber wrote:
quoted
The Actions Semi S500 SoC provides four timers, 2Hz0/1 and 32-bit TIMER0/1.
Use TIMER0 as clocksource and TIMER1 as clockevents.
Based on LeMaker linux-actions tree.
An S500 datasheet can be found on the LeMaker Guitar pages:
http://www.lemaker.org/product-guitar-download-29.html
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
Acked-by: Daniel Lezcano <redacted>
Thanks. It seems this is not going through a central clocksource tree,
so I'm applying it to a new linux-actions.git v4.13/soc branch:
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git/log/?h=v4.13/soc
Let me know if you intend to take it through some other tree instead.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Applied to linux-actions.git v4.13/arm branch:
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git/log/?h=v4.13/arm
There have been no more comments - I believe we could simplify it with a
Makefile hack as seen in mach-uniphier, but since no one asked for
dropping owl.c in 4 patch revisions, I'll consider that as follow-up.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-18 21:45:33
Greg,
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
This implements an earlycon for Actions Semi S500/S900 SoCs.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v2 -> v3:
* Adopted BIT() macro
v1 -> v2:
* Extended Kconfig help to mention earlycon (Arnd)
* Spelled out Actions Semiconductor in Kconfig help
* Adopted "actions" vendor prefix
drivers/tty/serial/Kconfig | 19 ++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/owl-uart.c | 135 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 155 insertions(+)
create mode 100644 drivers/tty/serial/owl-uart.c
The DT vendor prefix is applied to my linux-actions.git tree now, and
the serial binding has been ack'ed by Rob.
Is there anything keeping you from adding this patch, the preceding DT
binding (08/28) and the following documentation patch (10/28) to your
tree for 4.13?
The full serial driver (16/28) needs another spin and may miss 4.13, but
earlycon would prove the rest is working.
Thanks,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Following a previous discussion with Thomas (that Actions unfortunately
didn't follow-up to with replies here...), I am planning to respin with
s500*.dts[i] renamed to owl-s500*. That will avoid name clashes and will
future-proof the file pattern in MAINTAINERS.
For S900 I don't think we need owl-, as we have actions/* there.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-18 22:19:49
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
Cc: 96boards at ucrobotics.com
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v1 -> v2 -> v3 -> v4: unchanged
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
Still no response from uCRobotics on how exactly to write their company
name here, so applying as is to linux-actions.git v4.13/dt64 branch:
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git/log/?h=v4.13/dt64
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-18 22:29:31
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
The Actions Semi S900 is a quad-core ARM Cortex-A53 SoC.
The Bubblegum-96 is a 96Boards Consumer Edition compliant board (4/96).
Cc: 96boards at ucrobotics.com
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v2 -> v3 -> v4: unchanged
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended text
Documentation/devicetree/bindings/arm/actions.txt | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Still no comments from uCRobotics received...
Due to S500 dependency applying to linux-actions.git v4.13/dt branch:
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git/log/?h=v4.13/dt
Let me know if we need a topic branch for dt+dt64 instead.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
+
ARM/ADS SPHERE MACHINE SUPPORT
M: Lennert Buytenhek [off-list ref]
L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
On Sun, Jun 18, 2017 at 11:45:28PM +0200, Andreas F?rber wrote:
Greg,
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
quoted
This implements an earlycon for Actions Semi S500/S900 SoCs.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v2 -> v3:
* Adopted BIT() macro
v1 -> v2:
* Extended Kconfig help to mention earlycon (Arnd)
* Spelled out Actions Semiconductor in Kconfig help
* Adopted "actions" vendor prefix
drivers/tty/serial/Kconfig | 19 ++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/owl-uart.c | 135 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 155 insertions(+)
create mode 100644 drivers/tty/serial/owl-uart.c
The DT vendor prefix is applied to my linux-actions.git tree now, and
the serial binding has been ack'ed by Rob.
Is there anything keeping you from adding this patch, the preceding DT
binding (08/28) and the following documentation patch (10/28) to your
tree for 4.13?
Yeah, I don't have it in my queue anymore :)
Can you resend it just as a single patch?
thanks,
greg k-h
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-19 01:24:52
Am 19.06.2017 um 03:16 schrieb Greg Kroah-Hartman:
On Sun, Jun 18, 2017 at 11:45:28PM +0200, Andreas F?rber wrote:
quoted
Greg,
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
quoted
This implements an earlycon for Actions Semi S500/S900 SoCs.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
The DT vendor prefix is applied to my linux-actions.git tree now, and
the serial binding has been ack'ed by Rob.
Is there anything keeping you from adding this patch, the preceding DT
binding (08/28) and the following documentation patch (10/28) to your
tree for 4.13?
Yeah, I don't have it in my queue anymore :)
Can you resend it just as a single patch?
Do you mean squash the documentation into this tty patch? As you wish.
But the DT binding is supposed to be a separate patch - I can queue it
in my tree if you prefer.
Cheers,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
@@ -0,0 +1,16 @@+Actions Semi Owl UART++Required properties:+- compatible : "actions,s500-uart", "actions,owl-uart" for S500+ "actions,s900-uart", "actions,owl-uart" for S900+- reg : Offset and length of the register set for the device.+- interrupts : Should contain UART interrupt.+++Example:++ uart3: serial at b0126000 {+ compatible = "actions,s500-uart", "actions,owl-uart";+ reg = <0xb0126000 0x1000>;+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;+ };
@@ -961,6 +961,12 @@ must already be setup and configured. Options are not yet supported.+ owl,<addr>+ Start an early, polled-mode console on a serial port+ of an Actions Semi SoC, such as S500 or S900, at the+ specified address. The serial port must already be+ setup and configured. Options are not yet supported.+ smh Use ARM semihosting calls for early console. s3c2410,<addr>
@@ -1688,6 +1688,25 @@ config SERIAL_MVEBU_CONSOLEandwarningsandwhichallowsloginsinsingleusermode)Otherwise,say'N'.+configSERIAL_OWL+bool"Actions Semi Owl serial port support"+depends onARCH_ACTIONS||COMPILE_TEST+selectSERIAL_CORE+help+ThisdriverisforActionsSemiconductorS500/S900SoC'sUART.+Say'Y'hereifyouwishtousetheon-boardserialport.+Otherwise,say'N'.++configSERIAL_OWL_CONSOLE+bool"Console on Actions Semi Owl serial port"+depends onSERIAL_OWL=y+selectSERIAL_CORE_CONSOLE+selectSERIAL_EARLYCON+defaulty+help+Say'Y'hereifyouwishtouseActionsSemiconductorS500/S900UART+asthesystemconsole.Onlyearlyconisimplementedcurrently.+endmenuconfigSERIAL_MCTRL_GPIO
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-19 02:09:53
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
Use a custom S500 enable-method for all CPUs.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v3: new
arch/arm/boot/dts/s500.dtsi | 4 ++++
1 file changed, 4 insertions(+)
On Mon, Jun 19, 2017 at 03:24:44AM +0200, Andreas F?rber wrote:
Am 19.06.2017 um 03:16 schrieb Greg Kroah-Hartman:
quoted
On Sun, Jun 18, 2017 at 11:45:28PM +0200, Andreas F?rber wrote:
quoted
Greg,
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
quoted
This implements an earlycon for Actions Semi S500/S900 SoCs.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
The DT vendor prefix is applied to my linux-actions.git tree now, and
the serial binding has been ack'ed by Rob.
Is there anything keeping you from adding this patch, the preceding DT
binding (08/28) and the following documentation patch (10/28) to your
tree for 4.13?
Yeah, I don't have it in my queue anymore :)
Can you resend it just as a single patch?
Do you mean squash the documentation into this tty patch? As you wish.
But the DT binding is supposed to be a separate patch - I can queue it
in my tree if you prefer.
No, just send me what ever you want me to apply to my tree. If you want
me to pick some random patch out of the middle of a series, um, that's a
bit hard for me to know what to do, right?
Make it very very obvious please :)
thanks,
greg k-h
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-19 02:26:43
Am 19.06.2017 um 04:12 schrieb Greg Kroah-Hartman:
On Mon, Jun 19, 2017 at 03:24:44AM +0200, Andreas F?rber wrote:
quoted
Am 19.06.2017 um 03:16 schrieb Greg Kroah-Hartman:
quoted
On Sun, Jun 18, 2017 at 11:45:28PM +0200, Andreas F?rber wrote:
quoted
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
quoted
This implements an earlycon for Actions Semi S500/S900 SoCs.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
The DT vendor prefix is applied to my linux-actions.git tree now, and
the serial binding has been ack'ed by Rob.
Is there anything keeping you from adding this patch, the preceding DT
binding (08/28) and the following documentation patch (10/28) to your
tree for 4.13?
Yeah, I don't have it in my queue anymore :)
Can you resend it just as a single patch?
Do you mean squash the documentation into this tty patch? As you wish.
But the DT binding is supposed to be a separate patch - I can queue it
in my tree if you prefer.
No, just send me what ever you want me to apply to my tree. If you want
me to pick some random patch out of the middle of a series, um, that's a
bit hard for me to know what to do, right?
Well, I thought that would be obvious from subject, diff stat and CC...
Only dependencies were ARCH_ACTIONS and actions vendor prefix, which
should be in linux-next by tomorrow.
Make it very very obvious please :)
I already resent the now two patches as v5 with you as only To.
Thanks,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
@@ -0,0 +1,17 @@+Actions Semi Owl Smart Power System (SPS)++Required properties:+- compatible : "actions,s500-sps" for S500+- reg : Offset and length of the register set for the device.+- #power-domain-cells : Must be 1.+ See macros in:+ include/dt-bindings/power/owl-s500-powergate.h for S500+++Example:++ sps: power-controller at b01b0100 {+ compatible = "actions,s500-sps";+ reg = <0xb01b0100 0x100>;+ #power-domain-cells = <1>;+ };
@@ -1,5 +1,6 @@menu"SOC (System On Chip) specific Drivers"+source"drivers/soc/actions/Kconfig"source"drivers/soc/atmel/Kconfig"source"drivers/soc/bcm/Kconfig"source"drivers/soc/fsl/Kconfig"
@@ -2,6 +2,7 @@# Makefile for the Linux Kernel SOC specific device drivers.#+obj-$(CONFIG_ARCH_ACTIONS)+=actions/obj-$(CONFIG_ARCH_AT91)+=atmel/obj-y+=bcm/obj-$(CONFIG_ARCH_DOVE)+=dove/
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-19 04:01:36
Am 06.06.2017 um 02:54 schrieb Andreas F?rber:
Add Smart Power System node for PM domains.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4:
* Extended commit message
* Split off association of power-domains (avoids include/dt-bindings/ dependency)
v3: new
arch/arm/boot/dts/s500.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
From: Daniel Lezcano <hidden> Date: 2017-06-19 13:53:11
On 18/06/2017 22:43, Andreas F?rber wrote:
Am 06.06.2017 um 18:33 schrieb Daniel Lezcano:
quoted
On Tue, Jun 06, 2017 at 02:54:02AM +0200, Andreas F?rber wrote:
quoted
The Actions Semi S500 SoC provides four timers, 2Hz0/1 and 32-bit TIMER0/1.
Use TIMER0 as clocksource and TIMER1 as clockevents.
Based on LeMaker linux-actions tree.
An S500 datasheet can be found on the LeMaker Guitar pages:
http://www.lemaker.org/product-guitar-download-29.html
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-19 14:31:23
Am 19.06.2017 um 15:53 schrieb Daniel Lezcano:
On 18/06/2017 22:43, Andreas F?rber wrote:
quoted
Am 06.06.2017 um 18:33 schrieb Daniel Lezcano:
quoted
On Tue, Jun 06, 2017 at 02:54:02AM +0200, Andreas F?rber wrote:
quoted
The Actions Semi S500 SoC provides four timers, 2Hz0/1 and 32-bit TIMER0/1.
Use TIMER0 as clocksource and TIMER1 as clockevents.
Based on LeMaker linux-actions tree.
An S500 datasheet can be found on the LeMaker Guitar pages:
http://www.lemaker.org/product-guitar-download-29.html
Signed-off-by: Andreas F?rber <afaerber@suse.de>
No, it is ok. In the future, submit for the clocksource tree
(tip/timers/core).
Hm, I did see that tree in MAINTAINERS, but it specifically said
"CLOCKSOURCE CORE" and it does not have any
F: drivers/clocksource/
or
F: Documentation/devicetree/bindings/timer/
entries, therefore I added the files to Actions like other SoCs did...
I can easily unqueue the patches - what does submit for the clocksource
tree mean? Just CC the two maintainers on resend or anything else?
I intend to rename my branch to v4.13/drivers on Olof's feedback anyway.
Sorry,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
On Tue, Jun 6, 2017 at 2:54 AM, Andreas F?rber [off-list ref] wrote:
Allow to bring up CPU1.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v3: new
arch/arm/mach-actions/Makefile | 3 +
arch/arm/mach-actions/headsmp.S | 68 ++++++++++++++++
arch/arm/mach-actions/platsmp.c | 166 ++++++++++++++++++++++++++++++++++++++++
I now see build errors in linux-next:
/git/arm-soc/arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
/git/arm-soc/arch/arm/mach-actions/platsmp.c:39:2: error:
'pen_release' undeclared (first use in this function); did you mean
'seq_release'?
pen_release = val;
^~~~~~~~~~~
seq_release
/git/arm-soc/arch/arm/mach-actions/platsmp.c:39:2: note: each
undeclared identifier is reported only once for each function it
appears in
/git/arm-soc/arch/arm/mach-actions/platsmp.c: In function
's500_wakeup_secondary':
/git/arm-soc/arch/arm/mach-actions/platsmp.c:79:2: error: implicit
declaration of function 'dsb_sev'
[-Werror=implicit-function-declaration]
dsb_sev();
^~~~~~~
/git/arm-soc/arch/arm/mach-actions/platsmp.c: In function
's500_smp_boot_secondary':
/git/arm-soc/arch/arm/mach-actions/platsmp.c:108:7: error:
'pen_release' undeclared (first use in this function); did you mean
'seq_release'?
+static DEFINE_SPINLOCK(boot_lock);
+
+static void write_pen_release(int val)
+{
+ pen_release = val;
+ smp_wmb();
+ __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
+ outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+}
+
+static void s500_smp_secondary_init(unsigned int cpu)
+{
+ /*
+ * let the primary processor know we're out of the
+ * pen, then head off into the C entry point
+ */
+ write_pen_release(-1);
+
+ spin_lock(&boot_lock);
+ spin_unlock(&boot_lock);
+}
+
+void owl_secondary_startup(void);
+
+static int s500_wakeup_secondary(unsigned int cpu)
+{
+ if (cpu > 3)
+ return -EINVAL;
+
+ switch (cpu) {
+ case 2:
+ case 3:
+ /* CPU2/3 are power-gated */
+ return -EINVAL;
+ }
+
+ /* wait for CPUx to run to WFE instruction */
+ udelay(200);
+
+ writel(virt_to_phys(owl_secondary_startup),
+ timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4);
+ writel(OWL_CPUx_FLAG_BOOT,
+ timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4);
+
+ dsb_sev();
+ mb();
+
+ return 0;
+}
+
+static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+ unsigned long timeout;
+ int ret;
+
+ ret = s500_wakeup_secondary(cpu);
+ if (ret)
+ return ret;
+
+ udelay(10);
+
+ spin_lock(&boot_lock);
+
+ /*
+ * The secondary processor is waiting to be released from
+ * the holding pen - release it, then wait for it to flag
+ * that it has been released by resetting pen_release.
+ */
+ write_pen_release(cpu_logical_map(cpu));
+ smp_send_reschedule(cpu);
+
+ timeout = jiffies + (1 * HZ);
+ while (time_before(jiffies, timeout)) {
+ if (pen_release == -1)
+ break;
+ }
+
+ writel(0, timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4);
+ writel(0, timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4);
+
+ spin_unlock(&boot_lock);
+
+ return pen_release != -1 ? -ENOSYS : 0;
+}
This looks more complicated than necessary. Why do you need the holding
pen when you have a register to start up the CPU?
Arnd
On Wed, Jun 21, 2017 at 10:16 AM, Arnd Bergmann [off-list ref] wrote:
On Tue, Jun 6, 2017 at 2:54 AM, Andreas F?rber [off-list ref] wrote:
quoted
Allow to bring up CPU1.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v3: new
arch/arm/mach-actions/Makefile | 3 +
arch/arm/mach-actions/headsmp.S | 68 ++++++++++++++++
arch/arm/mach-actions/platsmp.c | 166 ++++++++++++++++++++++++++++++++++++++++
I now see build errors in linux-next:
/git/arm-soc/arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
/git/arm-soc/arch/arm/mach-actions/platsmp.c:39:2: error:
'pen_release' undeclared (first use in this function); did you mean
I have a fix and tested it now. Please fold this into your patch:
Arnd
Subject: [PATCH] ARM: owl: fix non-SMP build
arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
arch/arm/mach-actions/platsmp.c:39:2: error: 'pen_release' undeclared
(first use in this function); did you mean 'seq_release'?
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
From: Daniel Lezcano <hidden> Date: 2017-06-21 11:57:48
On Mon, Jun 19, 2017 at 04:31:18PM +0200, Andreas F?rber wrote:
Am 19.06.2017 um 15:53 schrieb Daniel Lezcano:
quoted
On 18/06/2017 22:43, Andreas F?rber wrote:
quoted
Am 06.06.2017 um 18:33 schrieb Daniel Lezcano:
quoted
On Tue, Jun 06, 2017 at 02:54:02AM +0200, Andreas F?rber wrote:
quoted
The Actions Semi S500 SoC provides four timers, 2Hz0/1 and 32-bit TIMER0/1.
Use TIMER0 as clocksource and TIMER1 as clockevents.
Based on LeMaker linux-actions tree.
An S500 datasheet can be found on the LeMaker Guitar pages:
http://www.lemaker.org/product-guitar-download-29.html
Signed-off-by: Andreas F?rber <afaerber@suse.de>
No, it is ok. In the future, submit for the clocksource tree
(tip/timers/core).
Hm, I did see that tree in MAINTAINERS, but it specifically said
"CLOCKSOURCE CORE" and it does not have any
F: drivers/clocksource/
or
F: Documentation/devicetree/bindings/timer/
entries, therefore I added the files to Actions like other SoCs did...
You probably missed the entry:
CLOCKSOURCE, CLOCKEVENT DRIVERS
M: Daniel Lezcano [off-list ref]
M: Thomas Gleixner [off-list ref]
L: linux-kernel at vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
S: Supported
F: drivers/clocksource
I can easily unqueue the patches - what does submit for the clocksource
tree mean? Just CC the two maintainers on resend or anything else?
I intend to rename my branch to v4.13/drivers on Olof's feedback anyway.
I could have directly picked the clocksource/clockevent changes to my tree but
I decided to let them go through the ARM's tree. I meant, as the patches are
acked (by me), it is ok they are merged through arm's tree. From my POV, it is
somewho acceptable when a new SoC support is added.
In the future, when the clockevent/clocksource drivers are merged and if there
are more changes, at this time, send the patches to Thomas and me as stated in
the maintainer file entry, I will take care of them.
IOW, everything is fine ;)
-- Daniel
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
From: Andreas Färber <afaerber@suse.de> Date: 2017-06-21 16:48:30
Am 21.06.2017 um 12:25 schrieb Arnd Bergmann:
quoted hunk
On Wed, Jun 21, 2017 at 10:16 AM, Arnd Bergmann [off-list ref] wrote:
quoted
On Tue, Jun 6, 2017 at 2:54 AM, Andreas F?rber [off-list ref] wrote:
quoted
Allow to bring up CPU1.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v3: new
arch/arm/mach-actions/Makefile | 3 +
arch/arm/mach-actions/headsmp.S | 68 ++++++++++++++++
arch/arm/mach-actions/platsmp.c | 166 ++++++++++++++++++++++++++++++++++++++++
I now see build errors in linux-next:
/git/arm-soc/arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
/git/arm-soc/arch/arm/mach-actions/platsmp.c:39:2: error:
'pen_release' undeclared (first use in this function); did you mean
I have a fix and tested it now. Please fold this into your patch:
Arnd
Subject: [PATCH] ARM: owl: fix non-SMP build
arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
arch/arm/mach-actions/platsmp.c:39:2: error: 'pen_release' undeclared
(first use in this function); did you mean 'seq_release'?
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Sorry. Fixed up the two patches, thanks!
Interestingly the below issue had been found by automatic patch testing,
but the above wasn't. Maybe you can contribute your non-SMP config for
the bots, to help catch this earlier?
AFLAGS_headsmp.o := -Wa,-march=armv7-a
Cheers,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
On Wed, Jun 21, 2017 at 6:48 PM, Andreas F?rber [off-list ref] wrote:
Am 21.06.2017 um 12:25 schrieb Arnd Bergmann:
quoted
On Wed, Jun 21, 2017 at 10:16 AM, Arnd Bergmann [off-list ref] wrote:
quoted
On Tue, Jun 6, 2017 at 2:54 AM, Andreas F?rber [off-list ref] wrote:
quoted
Allow to bring up CPU1.
Based on LeMaker linux-actions tree.
Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
v3 -> v4: Unchanged
v3: new
arch/arm/mach-actions/Makefile | 3 +
arch/arm/mach-actions/headsmp.S | 68 ++++++++++++++++
arch/arm/mach-actions/platsmp.c | 166 ++++++++++++++++++++++++++++++++++++++++
I now see build errors in linux-next:
/git/arm-soc/arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
/git/arm-soc/arch/arm/mach-actions/platsmp.c:39:2: error:
'pen_release' undeclared (first use in this function); did you mean
I have a fix and tested it now. Please fold this into your patch:
Arnd
Subject: [PATCH] ARM: owl: fix non-SMP build
arch/arm/mach-actions/platsmp.c: In function 'write_pen_release':
arch/arm/mach-actions/platsmp.c:39:2: error: 'pen_release' undeclared
(first use in this function); did you mean 'seq_release'?
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Sorry. Fixed up the two patches, thanks!
Interestingly the below issue had been found by automatic patch testing,
but the above wasn't. Maybe you can contribute your non-SMP config for
the bots, to help catch this earlier?
This was just a randconfig build. On ARM32, we do test
"multi_v7_defconfig+CONFIG_SMP=n"
in kernelci, but that only tests mach-actions after that gets added to
multi_v7_defconfig. Not sure if it's worth adding an allmodconfig+CONFIG_SMP=n"
build, the allmodconfig builds are rather expensive.
Arnd
+static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+ unsigned long timeout;
+ int ret;
+
+ ret = s500_wakeup_secondary(cpu);
+ if (ret)
+ return ret;
+
+ udelay(10);
+
+ spin_lock(&boot_lock);
+
+ /*
+ * The secondary processor is waiting to be released from
+ * the holding pen - release it, then wait for it to flag
+ * that it has been released by resetting pen_release.
+ */
+ write_pen_release(cpu_logical_map(cpu));
+ smp_send_reschedule(cpu);
+
+ timeout = jiffies + (1 * HZ);
+ while (time_before(jiffies, timeout)) {
+ if (pen_release == -1)
+ break;
+ }
+
+ writel(0, timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4);
+ writel(0, timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4);
+
+ spin_unlock(&boot_lock);
+
+ return pen_release != -1 ? -ENOSYS : 0;
+}
This looks more complicated than necessary. Why do you need the holding
pen when you have a register to start up the CPU?
It seems you missed my question here. Can you please follow up, and
if possible send a patch to remove the pen_release logic that appears
to be unnecessary here?
Arnd