Re: armv7: banana pi, Allwinner A20 board

2014-10-02 Thread Patrick Wildt
Hi, I remember that there has been an issue, only seen on Cortex-A7/A15, like the Allwinner A20. The fix for that issue is somewhere here[0]. Try this[1] kernel and have a look if it has the same issue or not. I do not have an A20, so I can’t test it, sorry. But I’ll probably buy this[2][3]

Re: armv7: banana pi, Allwinner A20 board

2014-10-02 Thread Patrick Wildt
)) /* AP */ \Patrick Am 02.10.2014 um 21:16 schrieb Patrick Wildt m...@patrick-wildt.de: Hi, I remember that there has been an issue, only seen on Cortex-A7/A15, like the Allwinner A20. The fix for that issue is somewhere here[0]. Try this[1] kernel and have a look if it has

Re: armv7: banana pi, Allwinner A20 board

2014-10-16 Thread Patrick Wildt
I do believe that this is a pmap issue. I just got hands on an Allwinner A20 and suffered the same issues: pool_setlowat crashing randomly, same for ahci and so on. I believe we are not syncing the PTEs correctly. Here’s the snippet from PTE_SYNC(), but PTE_SYNC_RANGE() has the same issue:

Re: Allwinner wip

2013-07-20 Thread Patrick Wildt
Am 20.07.2013 um 14:20 schrieb Martin Pieuchot mpieuc...@nolizard.org: On 20/07/13(Sat) 14:10, Artturi Alm wrote: Hi, work-in-progress-quality 'port' to add support for Allwinner A10, tested on cubieboard only. Nice work. For what I've seen this port is really similar to the beagle

Re: Allwinner

2013-10-11 Thread Patrick Wildt
Am 11.10.2013 um 22:46 schrieb Artturi Alm artturi@gmail.com: On 10/11/13 20:39, Markus Hennecke wrote: On Sat, 5 Oct 2013, Artturi Alm wrote: Current version attached, extract to /sys/arch/armv7 and read the short notes file, no more out of allwinner/ patches needed thanks to armv7.

ntpd(8) option to provide time even when not being synced

2012-08-24 Thread Patrick Wildt
the diff below adds an option to the ntpd(8), which has him provide time, even though he's not synced. ok? Index: ntpd.8 === RCS file: /cvs/src/usr.sbin/ntpd/ntpd.8,v retrieving revision 1.31 diff -u -r1.31 ntpd.8 --- ntpd.8

fix log_err() messages in sasyncd(8)

2012-09-04 Thread Patrick Wildt
I think those were log_msg()s before, as log_msg() has to be called with a debug level as first argument. As log_err() doesn't take a debug level, just call it with the string. Index: monitor.c === RCS file:

Re: ntpd(8) option to provide time even when not being synced

2012-09-07 Thread Patrick Wildt
schrieb Eric P. Mangold e...@teratorn.org: Could I ask what your use-case is? -E On Fri, Aug 24, 2012 at 01:41:21PM +0200, Patrick Wildt wrote: the diff below adds an option to the ntpd(8), which has him provide time, even though he's not synced. ok? Index: ntpd.8

Re: beaglebone

2013-04-26 Thread Patrick Wildt
Am 26.04.2013 um 17:09 schrieb Raphael Graf i...@undefined.ch: On Thu, April 25, 2013 7:30 pm, Alexey E. Suslikov wrote: Raphael Graf r at undefined.ch writes: I have a beaglebone (AM3359) running OpenBSD, see below. Is there any interest in such code? Diffs are interesting. Teasers are

Re: restore all the psr bits on arm

2015-01-14 Thread Patrick Wildt
Am 15.01.2015 um 02:51 schrieb Jonathan Gray j...@jsg.id.au: The '_all' PSR mask ends up being treated as 'fc' so switch 'msr' instructions with '_all' to '_fsxc' so bits 23-8 are restored. In older arm cores these bits were reserved now they are used. While here fix 'mrs' instructions

remove unnecessary comparisons

2015-01-08 Thread Patrick Wildt
Hi, the following diff removes two unnecessary comparisons. In dsdt.c, pdata-pnpid is an array embedded in a struct, not a pointer, so if pdata is not NULL, which is checked a few lines above, pdata-pnpid probably isn't either. A similar issue also occurs in ti.c for ti_event_ring and

clang warning in sys/scsi/st.c

2015-01-08 Thread Patrick Wildt
Hi, while compiling a kernel with a newer clang version it stumbled upon the following code starting line 1020 in sys/scsi/st.c: struct scsi_rw_tape *cmd; ... /* * Handle fixed-block-mode tape drives by using the * block count instead of the length.

[PATCH] dwc2: re-establish default pipe after setting MPS/address

2015-03-18 Thread Patrick Wildt
Hi, similar to ehci/ohci, the default pipe has to be re-established after setting the new MaxPacketSize and address. Also, the following diff makes dwc2 actually set the address by setting a setaddr() function in the bus method struct. This makes the raspberry Pi 2's USB properly enumerate all

Re: support em(4) i210/i211 OTP chips

2015-03-18 Thread Patrick Wildt
Any updates on this? Am 09.03.2015 um 07:32 schrieb Patrick Wildt m...@patrick-wildt.de: Hi, this diff adds support for a special configuration of i210/i211 chips. Those can have a OTP chip instead of the usual EEPROM, so this diff adds the infrastructure to read needed data from OTP

[PATCH] dwc2: abort is of task type abort

2015-03-18 Thread Patrick Wildt
Hi, running an abort task should be done using the abort task type. Best regards, Patrick diff --git a/sys/dev/usb/dwc2/dwc2.c b/sys/dev/usb/dwc2/dwc2.c index afa749d..133c311 100644 --- sys/dev/usb/dwc2/dwc2.c +++ sys/dev/usb/dwc2/dwc2.c @@ -438,7 +438,7 @@ dwc2_timeout(void *addr)

support em(4) i210/i211 OTP chips

2015-03-09 Thread Patrick Wildt
Hi, this diff adds support for a special configuration of i210/i211 chips. Those can have a OTP chip instead of the usual EEPROM, so this diff adds the infrastructure to read needed data from OTP and have it not bail out when there's no EEPROM. \Patrick diff --git a/sys/dev/pci/if_em.c

iked: fix iked_cp_fixaddr()

2016-06-01 Thread Patrick Wildt
Hi, iked_cp_fixaddr() is called to replace unspecified (e.g. 0.0.0.0) addresses by specified (e.g. 192.0.2.1) ones. The function should return if the address is already set. The check is wrong for the IPv6 case, as it returns if it's not set. This causes the address to never be fixed. ok?

iked: address pools for both families

2016-06-01 Thread Patrick Wildt
Hi, Currently there is only one address pool which is either v4 or v6. This means that we cannot have dual-stack VPNs via iked. Clients then might tunnel all IPv4 traffic, but IPv6 traffic is still using the non-encrypted default route, which might be a security issue. To enable dual-stack

Re: iked: fix ipv6 address pool assignment

2016-06-01 Thread Patrick Wildt
On Wed, Jun 01, 2016 at 03:47:45PM +0200, Mike Belopuhov wrote: > On 1 June 2016 at 13:33, Patrick Wildt <patr...@blueri.se> wrote: > > Hi, > > > > The IPv6 address assignment was basically copied from the IPv4 > > code. Instead of working on the last 32-bits, it

sunxi: fix sxipio func mask

2016-02-01 Thread Patrick Wildt
Hi, in sxipio the mask is incorrect for get- and setcfg. If bit is 1, off is (1 & 7) << 2, which is 4. That means each cfg is 4 bits wide, so the mask is 0xf and not 0x7. I cross-checked it with NetBSD and Linux. As far as I know it does not fix any known issue for me, it's just something that

Re: sunxi: fix sxipio func mask

2016-02-01 Thread Patrick Wildt
On Mon, Feb 01, 2016 at 10:51:40PM +0200, Artturi Alm wrote: > On Mon, Feb 01, 2016 at 09:06:35PM +0100, Patrick Wildt wrote: > > Hi, > > > > in sxipio the mask is incorrect for get- and setcfg. > > > > If bit is 1, off is (1 & 7) << 2, which is 4.

Re: fix armv7 long descriptor second level bits

2016-01-31 Thread Patrick Wildt
On Sun, Jan 31, 2016 at 06:19:59PM +1100, Jonathan Gray wrote: > The AP bits are the same place as in the small descriptor second level > format. > > Expanded version of a diff from Patrick. Looks good to me, works for me. > > Index: arm/pmap.c >

Re: sunxi: don't use sxitimer on the sun7i/A20

2016-02-03 Thread Patrick Wildt
On Wed, Feb 03, 2016 at 01:10:57PM -0200, Daniel Bolgheroni wrote: > On Wed, Feb 03, 2016 at 12:31:33PM +1100, Jonathan Gray wrote: > > You'll want a kernel with the sxidog patch that was committed earlier today. > > That's right. Thank you. However, stressing it out a little further, sometimes >

Re: arm: don't unnecessarily call pmap_extract()

2016-01-30 Thread Patrick Wildt
On Tue, Jan 26, 2016 at 07:32:40PM +1100, Jonathan Gray wrote: > On Sun, Jan 24, 2016 at 01:02:49AM +0100, Patrick Wildt wrote: > > Hi, > > > > there are two code points in the v7 pmap where we need the physical > > address (to flush secondary cache) and use pmap_ex

sunxi: don't use sxitimer on the sun7i/A20

2016-01-30 Thread Patrick Wildt
Hi, one of the reasons Allwinner A20/sun7i-based boards, like the Cubieboard 2 or Banana Pi, don't boot is that the sxitimer does not work for us. We are getting no hardclock ticks and so the system can't work. There's a simple fix for that. We can just not use the sxitimer and instead use the

Re: arm: don't unnecessarily call pmap_extract()

2016-01-30 Thread Patrick Wildt
On Sun, Jan 31, 2016 at 02:53:57PM +1100, Jonathan Gray wrote: > On Sat, Jan 30, 2016 at 08:01:00PM +0100, Patrick Wildt wrote: > > On Tue, Jan 26, 2016 at 07:32:40PM +1100, Jonathan Gray wrote: > > > On Sun, Jan 24, 2016 at 01:02:49AM +0100, Patrick Wildt

arm: support Allwinner A20 Ethernet

2016-02-27 Thread Patrick Wildt
/arch/armv7/sunxi/sxiccmuvar.h index cf68e7c..15a07bf 100644 --- sys/arch/armv7/sunxi/sxiccmuvar.h +++ sys/arch/armv7/sunxi/sxiccmuvar.h @@ -25,6 +25,7 @@ enum CCMU_MODULES { CCMU_OHCI1, CCMU_AHCI, CCMU_EMAC, + CCMU_GMAC, CCMU_DMA, CCMU_UART0,

Re: properly inject UDP header for udpencap over IPv6

2016-02-26 Thread Patrick Wildt
On Fri, Feb 26, 2016 at 08:25:02PM +0100, Alexander Bluhm wrote: > On Fri, Feb 26, 2016 at 04:56:49PM +0100, Mike Belopuhov wrote: > > I think your revised diff should be committed. Any objections? > > OK bluhm@ > > > > uh->uh_sum = 0; > > > +#ifdef INET6 > > > + if

socppc/fdt: fix end signature check (again)

2016-02-28 Thread Patrick Wildt
Hi, unfortunately the end signature check is still not correct. Consulting the spec cleared the confusion of why the check does not work on my ARM machines. The FDT tree contains a "structure block". The FDT header contains information, on which offset that block starts. Since version 17 of

socppc/fdt: fix fdt_find_node for the case we don't find a node

2016-02-28 Thread Patrick Wildt
Hi, If we're calling fdt_find_node() and do not actually find the node we're looking for, we call strncmp with a NULL value. What happens is that we use fdt_child_node(node) to retrieve a child and then use fdt_next_node(child) to go through the list of children. If we do not find a child that

Re: arm: store curcpu pointer in thread id register

2016-02-26 Thread Patrick Wildt
Bump, now that the tree is unlocked again. Patrick On Sat, Feb 20, 2016 at 10:49:36PM +0100, Patrick Wildt wrote: > Hi, > > since ARMv6 the coprocessor provides special registers to store software > defined values. Those registers are: > > * TPIDRURW -> kernel RW, u

Re: arm: store curcpu pointer in thread id register

2016-02-27 Thread Patrick Wildt
On Fri, Feb 26, 2016 at 08:59:41PM -0800, Philip Guenther wrote: > On Sat, Feb 20, 2016 at 1:49 PM, Patrick Wildt <patr...@blueri.se> wrote: > > since ARMv6 the coprocessor provides special registers to store software > > defined values. Those registers are: > > &g

Re: properly inject UDP header for udpencap over IPv6

2016-02-26 Thread Patrick Wildt
phlen); +#endif /* INET6 */ espstat.esps_udpencout++; } On Sun, Feb 21, 2016 at 09:14:13PM +0100, Patrick Wildt wrote: > Hi, > > debugging my setup at home I realized that NAT-T on IPv6 is broken. > I know that NAT in IPv6 sucks, but apparently my dsl modem does no

Re: arm: handle hypervisor mode

2016-01-23 Thread Patrick Wildt
On Sun, Jan 24, 2016 at 12:33:42AM +1100, Jonathan Gray wrote: > On Fri, Jan 22, 2016 at 09:36:49PM +0100, Patrick Wildt wrote: > > Hi, > > > > the hypervisor mode, which virtualization-enabled boards might boot in, > > is basically a privilege level above th

Re: arm: handle hypervisor mode

2016-01-23 Thread Patrick Wildt
On Sun, Jan 24, 2016 at 03:02:29AM +1100, Jonathan Gray wrote: > On Sat, Jan 23, 2016 at 02:54:58PM +0100, Patrick Wildt wrote: > > On Sun, Jan 24, 2016 at 12:33:42AM +1100, Jonathan Gray wrote: > > > On Fri, Jan 22, 2016 at 09:36:49PM +0100, Patrick Wildt

arm: don't unnecessarily call pmap_extract()

2016-01-23 Thread Patrick Wildt
Hi, there are two code points in the v7 pmap where we need the physical address (to flush secondary cache) and use pmap_extract() instead of just reading it from the vm page. This diff removes those. Patrick diff --git sys/arch/arm/arm/pmap7.c sys/arch/arm/arm/pmap7.c index 5bcc67b..78969bd

arm: update processor mode defines

2016-01-22 Thread Patrick Wildt
Hi, ARM(v7) has gained two new processor modes: Hyp and Monitor. The Hyp mode is especially interesting as it is part of the Virtualization Extensions. On boards that support it, the kernel is usually booted in HYP mode. Currently HYP mode is not handled, which means that

socppc/fdt: broken end signature check

2016-02-19 Thread Patrick Wildt
Hi, there seems to be a broken check in socppc's fdt code. I think this should not be a binary AND. I have no hardware to verify that diff. Patrick diff --git sys/arch/socppc/socppc/fdt.c sys/arch/socppc/socppc/fdt.c index 9dae7e2..7423988 100644 --- sys/arch/socppc/socppc/fdt.c +++

socppc/fdt: useless code in fdt init

2016-02-19 Thread Patrick Wildt
Hi, in socppc's fdt init code there's a path that is always run but never produces anything valid, as it's overridden directly after. tree.strings_size is always set to fh_strings_size at the end. So in reality that whole version block might run, but in the end is completely useless. As no one

socppc/fdt: convert big endian to host endian

2016-02-19 Thread Patrick Wildt
Hi, FDT is spread widely in the embedded market. Especially those ARM machines make heavy use of it. FDT is always stored in big endian, like socppc. To be able to use this code on little endian machines, like those ARMs, this diff modifies the code to convert the binary data from big endian

Re: socppc/fdt: broken end signature check

2016-02-19 Thread Patrick Wildt
On Sat, Feb 20, 2016 at 01:32:20AM +0100, Patrick Wildt wrote: > Hi, > > there seems to be a broken check in socppc's fdt code. I think this > should not be a binary AND. > > I have no hardware to verify that diff. > > Patrick > > diff --git sys/arch/socppc/socpp

arm: store curcpu pointer in thread id register

2016-02-20 Thread Patrick Wildt
Hi, since ARMv6 the coprocessor provides special registers to store software defined values. Those registers are: * TPIDRURW -> kernel RW, user RW * TPIDRURO -> kernel RW, user RO * TPIDRPRW -> kernel RW TPIDRPRW is typically used to store the pointer to the curcpu struct, while TPIDRURO

properly inject UDP header for udpencap over IPv6

2016-02-21 Thread Patrick Wildt
Hi, debugging my setup at home I realized that NAT-T on IPv6 is broken. I know that NAT in IPv6 sucks, but apparently my dsl modem does not reliably forward ESP packets, so I use NAT-T instead... *sigh* Moving that setup from IPv4 to IPv6 I noticed that pf was blocking outgoing packets and its

arm: remove xscale 80200

2016-03-18 Thread Patrick Wildt
Hi, armish and zaurus use the XSCALE 80321 and PXA2X0. 80200 is unused and basically dead code, too, so I think we should remove that, too. This diff is based on the SA1 and IXP425 diffs. Patrick diff --git sys/arch/arm/arm/cpu.c sys/arch/arm/arm/cpu.c index 5c7e385..edb47cd 100644 ---

Re: arm: purge arm8 - and maybe more?

2016-03-14 Thread Patrick Wildt
On Wed, Mar 09, 2016 at 09:14:06AM +0100, Patrick Wildt wrote: > On Wed, Mar 09, 2016 at 01:28:55PM +1100, Jonathan Gray wrote: > > On Tue, Mar 08, 2016 at 10:59:42PM +0100, Patrick Wildt wrote: > > > Hi, > > > > > > I'd like to get some opinions on this. ARM

Re: sdhc: don't always compile the pci attachment driver

2016-03-14 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 10:32:18PM +0100, Patrick Wildt wrote: > Hi, > > if you attach sdhc, you automatically compile the pci attachment driver, > even if there's no "sdhc* at pci?" in the config. This might fail on > architectures that don't have pci compiled in. &

arm: purge arm8 - and maybe more?

2016-03-08 Thread Patrick Wildt
Hi, I'd like to get some opinions on this. ARM8 has probably never ever been used with OpenBSD, and I doubt it will ever be. I think it also makes sense to remove more, like ARM9, ARM9E, ARM10, ARM11. All the cruft that is not used, apart from armish, armv7 and zaurus. In the end it will

arm: remove ixp425

2016-03-19 Thread Patrick Wildt
Hi, based on the SA1 diff, this change also removes IXP425. Patrick diff --git sys/arch/arm/arm/cpu.c sys/arch/arm/arm/cpu.c index 593bdac..5c7e385 100644 --- sys/arch/arm/arm/cpu.c +++ sys/arch/arm/arm/cpu.c @@ -146,13 +146,6 @@ static const char * const pxa27x_steppings[16] = { "rev

arm: remove sa1/ixp12x0

2016-03-19 Thread Patrick Wildt
Hi, next up on the list is the StrongARM and IXP12x0. This diff removes most, but keeps the SA1100 headers, which are still used by zaurus. Patrick diff --git sys/arch/arm/arm/bus_space_asm_generic.S sys/arch/arm/arm/bus_space_asm_generic.S index b96ca4a..5e610e2 100644 ---

fdt: rename file to prepare for fdt bus

2016-04-07 Thread Patrick Wildt
Hi, after a bit of talking with jsg@ we have found a way forward on how to integrate FDT into ARM. An aspect of this is having an MI FDT bus residing in sys/dev/ofw/, where the fdt subroutines currently already are. Then we'll convert the vexpress platform to use FDT and continue with Exynos

Re: fdt: rename file to prepare for fdt bus

2016-04-07 Thread Patrick Wildt
On Thu, Apr 07, 2016 at 06:00:25PM +0200, Mark Kettenis wrote: > > Date: Thu, 7 Apr 2016 16:54:19 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > Hi, > > > > after a bit of talking with jsg@ we have found a way forward on how to >

Re: fdt: translate memory addresses

2016-04-05 Thread Patrick Wildt
On Sun, Apr 03, 2016 at 06:56:52PM +0200, Mark Kettenis wrote: > > Date: Sun, 3 Apr 2016 16:57:10 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > Hi, > > > > now we're able to get a node's memory address. Though, a device tree > > may im

arm: fix cortex bus match function

2016-04-08 Thread Patrick Wildt
Hi, with the feedback received on the fdt bus, the fdt stuff will now be replacing the mainbus. While doing that I noticed that the cortex bus matches every time on config_found, which is because it doesn't check the attach args. ok? Patrick diff --git sys/arch/arm/cortex/cortex.c

fdt: implement helper to check and find compatible nodes

2016-04-08 Thread Patrick Wildt
Hi, so that we can easily check if a node is compatible or to find nodes that are compatible, I would like to add helpers to the fdt routines. This way the drivers can check if they "match" to a node by simply calling: if (fdt_node_compatible(ma->ma_node, "samsung,exynos4210-ehci"))

Re: arm/fdt: ... to prepare for fdt bus

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 03:29:05PM +0300, Artturi Alm wrote: > On Fri, Apr 08, 2016 at 01:44:11PM +0200, Patrick Wildt wrote: > > Hi, > > > > with the feedback received on the fdt bus, the fdt stuff will now be > > replacing the mainbus. [..snip..] > > > &

arm: new FDT-enabled mainbus

2016-04-08 Thread Patrick Wildt
GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE P

Re: fdt: implement helper to check and find compatible nodes

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 06:09:38PM +0200, Martin Pieuchot wrote: > On 08/04/16(Fri) 17:14, Patrick Wildt wrote: > > On Fri, Apr 08, 2016 at 04:34:25PM +0200, Martin Pieuchot wrote: > > > On 08/04/16(Fri) 14:46, Patrick Wildt wrote: > > > > Hi, > > > > >

Re: arm/fdt: ... to prepare for fdt bus

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 03:30:24PM +0200, Mark Kettenis wrote: > > Date: Fri, 8 Apr 2016 14:53:35 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > On Fri, Apr 08, 2016 at 03:29:05PM +0300, Artturi Alm wrote: > > > On Fri, Apr 08, 2016 at 01:44:11PM

Re: fdt: implement helper to check and find compatible nodes

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 04:34:25PM +0200, Martin Pieuchot wrote: > On 08/04/16(Fri) 14:46, Patrick Wildt wrote: > > Hi, > > > > so that we can easily check if a node is compatible or to find nodes > > that are compatible, I would like to add helpers to the fdt

Re: arm: new FDT-enabled mainbus

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 09:38:25PM +0200, Mark Kettenis wrote: > > Date: Fri, 8 Apr 2016 20:26:14 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > +void > > +mainbus_iterate(struct device *self, struct device *match, int node) > > +{ > > +

Re: arm: new FDT-enabled mainbus

2016-04-09 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 09:38:25PM +0200, Mark Kettenis wrote: > > Date: Fri, 8 Apr 2016 20:26:14 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > +void > > +mainbus_iterate(struct device *self, struct device *match, int node) > > +{ > > +

Re: arm: new FDT-enabled mainbus

2016-04-10 Thread Patrick Wildt
On Sun, Apr 10, 2016 at 08:15:08PM +0200, Mark Kettenis wrote: > > Date: Sat, 9 Apr 2016 17:32:33 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > On Fri, Apr 08, 2016 at 09:38:25PM +0200, Mark Kettenis wrote: > > > > Date: Fri, 8 Apr 2016 20:26:

fdt: convert function to return EINVAL

2016-04-06 Thread Patrick Wildt
Hi, as the new translation function makes use of errnos as return value, it probably makes sense to change the "get memory" function, too. Also I think we should check that mem is not NULL in this function, as it's exposed in the API. If node or mem is NULL, just return EINVAL. ok? Patrick

Re: arm: new FDT-enabled mainbus

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 02:00:54PM +0200, Patrick Wildt wrote: > Hi, > > this diff replaces the ARM mainbus with a new implementation. This > implementation works like the old version if there's no device tree. > > But if there is a device tree, this tree will be used to enum

Re: arm/fdt: ... to prepare for fdt bus

2016-04-08 Thread Patrick Wildt
On Fri, Apr 08, 2016 at 06:30:31PM +0200, Martin Pieuchot wrote: > On 08/04/16(Fri) 17:23, Patrick Wildt wrote: > > On Fri, Apr 08, 2016 at 03:30:24PM +0200, Mark Kettenis wrote: > > > > On Fri, Apr 08, 2016 at 03:29:05PM +0300, Artturi Alm wrote: > > > > > On F

Re: arm: remove sa1/ixp12x0

2016-03-19 Thread Patrick Wildt
On Sat, Mar 19, 2016 at 09:27:19AM +1100, Jonathan Gray wrote: > On Fri, Mar 18, 2016 at 04:43:08PM +0100, Patrick Wildt wrote: > > Hi, > > > > next up on the list is the StrongARM and IXP12x0. > > > > This diff removes most, but keeps the SA1100 headers, &

Re: make armv5te the gcc default

2016-03-19 Thread Patrick Wildt
On Sat, Mar 19, 2016 at 09:56:48AM +1100, Jonathan Gray wrote: > Instead of armv4 tuned for strongarm switch to an armv5te default to > allow additional instructions to be used (clz etc). > > armish and zaurus are both xscale (armv5te with additional extensions). > > The builtin gcc defines

arm: remove ARM10

2016-03-22 Thread Patrick Wildt
Hi, Now we only have 2 unused processor generations left: ARM10 and ARM11. This diff removes support for the ARM10. ok? Patrick diff --git sys/arch/arm/arm/cpu.c sys/arch/arm/arm/cpu.c index 6fa6bc3..df572c1 100644 --- sys/arch/arm/arm/cpu.c +++ sys/arch/arm/arm/cpu.c @@ -84,7 +84,6 @@

Re: arm: remove ARM11

2016-03-22 Thread Patrick Wildt
On Tue, Mar 22, 2016 at 12:22:55PM +0100, Patrick Wildt wrote: > Hi, > > the last one to remove would be ARM11. I forgot to mention that this diff is based on the ARM10 diff. > > ok? > > Patrick > > diff --git sys/arch/arm/arm/bus_space_asm_ge

arm: remove ARM11

2016-03-22 Thread Patrick Wildt
Hi, the last one to remove would be ARM11. ok? Patrick diff --git sys/arch/arm/arm/bus_space_asm_generic.S sys/arch/arm/arm/bus_space_asm_generic.S index 66727a2..fa8c0df 100644 --- sys/arch/arm/arm/bus_space_asm_generic.S +++ sys/arch/arm/arm/bus_space_asm_generic.S @@ -50,7 +50,7 @@

arm: purge arm9e, too

2016-03-21 Thread Patrick Wildt
Hi, I would like to get rid of even more unused CPUs, so we end up with only armish, zaurus (armv5) and armv7. This diff removes ARM9E, but I also have diffs prepared to get rid of ARM10 and ARM11. ok? Patrick diff --git sys/arch/arm/arm/cpu.c sys/arch/arm/arm/cpu.c index a3fe271..6fa6bc3

Re: more armreg.h cleanup

2016-03-20 Thread Patrick Wildt
On Mon, Mar 21, 2016 at 12:52:17AM +1100, Jonathan Gray wrote: > Remove defines for unsupported chips, add V5TEJ and remove incorrect > ARCH_V7 define. The number ARM Ltd armv7 chips set here is 0xf, > documented as 'Defined by CPUID scheme'. > > Index: armreg.h >

Re: arm: only (re)set specific bits in sctlr

2016-03-19 Thread Patrick Wildt
On Sun, Mar 20, 2016 at 03:36:45AM +1100, Jonathan Gray wrote: > On Wed, Mar 02, 2016 at 03:31:57PM +0100, Patrick Wildt wrote: > > Hi, > > > > currently we have a rather big list of bits that we remove and set in > > the System Control Register. Those differ

Re: arm: support Allwinner A20 Ethernet

2016-03-04 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 11:19:37AM -0300, Daniel Bolgheroni wrote: > On Sat, Feb 27, 2016 at 11:09:10PM +0100, Patrick Wildt wrote: > > > > + /* print interrupt state */ > > + snprintb(buf, sizeof(buf), "\177\20" > > + "b\x10""NI\0

arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Patrick Wildt
Hi, this diff makes armv7 map the FDT, if available, and uses it to read information about the machine's available memory and bootargs. I'd like to get some opinions about the way I have implemented some stuff. For instance, I need the size of the FDT so I can properly copy it. Does it make

Re: arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 09:38:18AM -0500, Brandon Mercer wrote: > On Fri, Mar 04, 2016 at 03:15:23PM +0100, Patrick Wildt wrote: > > Hi, > > > > this diff makes armv7 map the FDT, if available, and uses it to read > > information about the machine's available memory

sdhc: don't always compile the pci attachment driver

2016-03-04 Thread Patrick Wildt
Hi, if you attach sdhc, you automatically compile the pci attachment driver, even if there's no "sdhc* at pci?" in the config. This might fail on architectures that don't have pci compiled in. If I'm not completely mistaken, this can be averted by making the file depend on sdhc_pci. Tested to

Re: arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 02:35:34PM -0500, Brandon Mercer wrote: > On Fri, Mar 04, 2016 at 08:08:36PM +0100, Patrick Wildt wrote: > > On Fri, Mar 04, 2016 at 09:38:18AM -0500, Brandon Mercer wrote: > > > On Fri, Mar 04, 2016 at 03:15:23PM +0100, Patrick Wildt

Re: arm: dmamap_destroy: remove explicit unload of map

2016-03-06 Thread Patrick Wildt
On Sun, Mar 06, 2016 at 12:53:24PM +0100, Tobias Ulmer wrote: > map is passed straight into free where it gets overwritten with junk. > No other arch makes map invalid before free, and my N2100 didn't > suddenly misbehave either. Been building base with this diff, no issues. Also it doesn't seem

Re: socppc/fdt: fix fdt_find_node for the case we don't find a node

2016-03-06 Thread Patrick Wildt
On Sun, Mar 06, 2016 at 04:23:08PM +0100, Martin Pieuchot wrote: > On 28/02/16(Sun) 17:49, Patrick Wildt wrote: > > Hi, > > > > If we're calling fdt_find_node() and do not actually find the node we're > > looking for, we call strncmp with a NULL value. > >

Re: fdt: move code from socppc to sys/dev/fdt/

2016-03-02 Thread Patrick Wildt
On Thu, Mar 03, 2016 at 09:38:25AM +1000, David Gwynne wrote: > > > On 2 Mar 2016, at 20:49, Patrick Wildt <patr...@blueri.se> wrote: > > > > Hi, > > > > to allow FDT to be used on ARM I think we should move the FDT code from > > socppc to sys/dev

fdt: don't return root node as root's parent

2016-03-07 Thread Patrick Wildt
Hi, I think if we call fdt_parent_node() and give it the root node, it should return NULL, as there can't be a parent above it. It should not start searching for the node somewhere in the tree. Patrick diff --git sys/dev/ofw/fdt.c sys/dev/ofw/fdt.c index c86df3e..aa14507 100644 ---

Re: socppc/fdt: fix fdt_find_node for the case we don't find a node

2016-03-07 Thread Patrick Wildt
On Mon, Mar 07, 2016 at 01:25:01PM +0100, Martin Pieuchot wrote: > On 06/03/16(Sun) 18:42, Patrick Wildt wrote: > > On Sun, Mar 06, 2016 at 04:23:08PM +0100, Martin Pieuchot wrote: > > > On 28/02/16(Sun) 17:49, Patrick Wildt wrote: > > > > Hi, > > > &g

fdt: move code from socppc to sys/dev/fdt/

2016-03-02 Thread Patrick Wildt
Hi, to allow FDT to be used on ARM I think we should move the FDT code from socppc to sys/dev/fdt/. Opinions? Could someone test this diff for me? Patrick diff --git sys/arch/socppc/conf/files.socppc sys/arch/socppc/conf/files.socppc index d1fab5e..ade4e53 100644 ---

arm: allow Cortex-A53/A57/A72 on armv7

2016-03-02 Thread Patrick Wildt
Hi, apparently AArch32 of ARMv8 is backwards compatible to ARMv7, so we can basically run OpenBSD/armv7 on those new fancy chips. Early on set_cpufuncs() is called and makes the kernel panic if it can't find a setup routine for the processor it is running on. This diff allows set_cpufuncs() to

Re: arm: allow Cortex-A53/A57/A72 on armv7

2016-03-02 Thread Patrick Wildt
Mar 02, 2016 at 02:47:53PM +0100, Patrick Wildt wrote: > Hi, > > apparently AArch32 of ARMv8 is backwards compatible to ARMv7, > so we can basically run OpenBSD/armv7 on those new fancy chips. > > Early on set_cpufuncs() is called and makes the kernel panic if > it can't

arm: only (re)set specific bits in sctlr

2016-03-02 Thread Patrick Wildt
Hi, currently we have a rather big list of bits that we remove and set in the System Control Register. Those differ per processor, so not every armv7/armv8 processor has the same bits, although they tend to be rather similar. I think we should only reset and set a few specific ones that we

Re: arm: purge arm8 - and maybe more?

2016-03-09 Thread Patrick Wildt
On Wed, Mar 09, 2016 at 01:28:55PM +1100, Jonathan Gray wrote: > On Tue, Mar 08, 2016 at 10:59:42PM +0100, Patrick Wildt wrote: > > Hi, > > > > I'd like to get some opinions on this. ARM8 has probably never ever > > been used with OpenBSD, and I doubt it will ever be.

Re: arm: 8-byte alignment (AAPCS)

2016-04-02 Thread Patrick Wildt
On Sat, Apr 02, 2016 at 12:44:15PM -0700, Philip Guenther wrote: > On Sat, Apr 2, 2016 at 5:19 AM, Patrick Wildt <patr...@blueri.se> wrote: > > the Procedure Call Standard used in EABI requires the stack pointer to > > be 8-byte aligned by > > > > * excepti

Re: arm: 8-byte alignment (AAPCS)

2016-04-02 Thread Patrick Wildt
On Sat, Apr 02, 2016 at 01:26:18PM -0700, Philip Guenther wrote: > On Sat, Apr 2, 2016 at 12:44 PM, Philip Guenther <guent...@gmail.com> wrote: > > On Sat, Apr 2, 2016 at 5:19 AM, Patrick Wildt <patr...@blueri.se> wrote: > >> the Procedure Call Standard used in E

Re: fdt: translate memory addresses

2016-04-03 Thread Patrick Wildt
On Sun, Apr 03, 2016 at 06:56:52PM +0200, Mark Kettenis wrote: > > Date: Sun, 3 Apr 2016 16:57:10 +0200 > > From: Patrick Wildt <patr...@blueri.se> > > > > Hi, > > > > now we're able to get a node's memory address. Though, a device tree > > may im

arm: 8-byte alignment (AAPCS)

2016-04-02 Thread Patrick Wildt
Hi, the Procedure Call Standard used in EABI requires the stack pointer to be 8-byte aligned by * exception handlers, before calling AAPCS-conforming code. * the OS, before giving control to an application. This diff makes sure our kernel interfaces adhere to that requirement. Can someone

Re: arm: store curcpu pointer in thread id register

2016-04-02 Thread Patrick Wildt
ok? On Sat, Feb 20, 2016 at 10:49:36PM +0100, Patrick Wildt wrote: > Hi, > > since ARMv6 the coprocessor provides special registers to store software > defined values. Those registers are: > > * TPIDRURW -> kernel RW, user RW > * TPIDRURO -> kernel RW, user RO

Re: arm: 8-byte alignment (AAPCS)

2016-04-23 Thread Patrick Wildt
On Sat, Apr 02, 2016 at 02:19:17PM +0200, Patrick Wildt wrote: > Hi, > > the Procedure Call Standard used in EABI requires the stack pointer to > be 8-byte aligned by > > * exception handlers, before calling AAPCS-conforming code. > * the OS, before giving cont

usb: cache vendor, product and serial

2016-05-18 Thread Patrick Wildt
Hi, I had the pleasure of debugging a USB mass storage device that showed interesting behaviour when used with our stack and in combination with the blink(1) usb device. The blink(1)-tool depends on libusb. Libusb calls ioctl(USB_DEVICEINFO) plenty of times to get a map of the USB tree. Per

armv7: ampintc fdt attachment draft

2016-05-01 Thread Patrick Wildt
Hi, based on the other changes this diff is a draft to make ampintc, the generic interrupt controller code, FDT aware. It basically only needs to see if the compatible string matches and then read out two rows of regs/addresses. Still, it needs to take care of the address- and size-cell sizes,

armv7: remove unused match function

2016-05-01 Thread Patrick Wildt
Hi, the armv7_match() function is unused as every platform implements its own (e.g. imx_match(), exynos_match()). Ok to remove? Patrick diff --git sys/arch/armv7/armv7/armv7.c sys/arch/armv7/armv7/armv7.c index bf7735c..15cd592 100644 --- sys/arch/armv7/armv7/armv7.c +++

Re: arm: new FDT-enabled mainbus

2016-05-01 Thread Patrick Wildt
/fdt.h sys/arch/arm/include/fdt.h new file mode 100644 index 000..0eec567 --- /dev/null +++ sys/arch/arm/include/fdt.h @@ -0,0 +1,31 @@ +/* $OpenBSD$ */ +/* + * Copyright (c) 2016 Patrick Wildt <patr...@blueri.se> + * + * Permission to use, copy, modify, and distribute this software for

Re: arm: new FDT-enabled mainbus

2016-05-01 Thread Patrick Wildt
On Sun, May 01, 2016 at 05:32:53PM +0200, Vincent Gross wrote: > On Sun, 1 May 2016 13:27:29 +0200 > Patrick Wildt <patr...@blueri.se> wrote: > > > Hi, > > > > I updated the diff with the feedback received. This basically adds > > a tree-li

armv7: only attach platform busses if explicitly asked for

2016-05-02 Thread Patrick Wildt
Hi, currently the armv7 platform busses always match if the board id is set to something they know. This means that even with a device tree the platforms will always try to match, even though they should not. By properly checking for the ma_name member, we can find out if we're being asked to

  1   2   3   4   5   >