> Hello Miod,
> 
> Thank you for your reply.
> 
> It would appear that, at least in my case, /dev/tty00 is not mapped to
> any driver.

Oops, my had, I hadn't looked carefully enough. It turns out that there
are no device nodes created for pluart at the moment.

The following diff takes care of it; you will need to build a new kernel
with the conf.c change and also need to use the updated MAKEDEV to
create the /dev/ttyP0 node.

Index: etc//MAKEDEV.common
===================================================================
RCS file: /OpenBSD/src/etc/MAKEDEV.common,v
retrieving revision 1.120
diff -u -p -r1.120 MAKEDEV.common
--- etc//MAKEDEV.common 28 Jan 2023 11:04:47 -0000      1.120
+++ etc//MAKEDEV.common 21 Dec 2023 13:26:21 -0000
@@ -167,6 +167,7 @@ target(all, bpf)dnl
 target(all, kcov)dnl
 target(all, dt)dnl
 target(all, kstat)dnl
+twrget(all, pluart, ttyP0, 0, 1)dnl
 dnl
 _mkdev(all, {-all-}, {-dnl
 show_target(all)dnl
@@ -535,3 +536,8 @@ __devitem(kstat, kstat, Kernel Statistic
 _mkdev(kstat, kstat, {-M kstat c major_kstat_c 0 640-})dnl
 __devitem(efi, efi, EFI runtime services)dnl
 _mkdev(efi, efi, {-M efi c major_efi_c 0 600-})dnl
+__devitem({-pluart-}, {-ttyP[0-1]-}, serial ports)dnl
+_mkdev(com, {-ttyP[0-1]-}, {-U=${i#ttyP*}
+       o=$(h2d $U)
+       M ttyP$U c major_pluart_c $o 660 dialer root
+       M cuaP$U c major_pluart_c Add($o, 128) 660 dialer root-})dnl
Index: etc//etc.arm64/MAKEDEV
===================================================================
RCS file: /OpenBSD/src/etc/etc.arm64/MAKEDEV,v
retrieving revision 1.27
diff -u -p -r1.27 MAKEDEV
--- etc//etc.arm64/MAKEDEV      28 Jan 2023 11:47:25 -0000      1.27
+++ etc//etc.arm64/MAKEDEV      21 Dec 2023 13:26:21 -0000
@@ -39,6 +39,7 @@
 #      ch*     SCSI media changers
 # Terminal ports:
 #      tty[0-7][0-9a-f]        NS16x50 serial ports
+#      ttyP[0-1]       serial ports
 # Pseudo terminals:
 #      ptm     pty master device
 #      pty*    Set of 62 master pseudo terminals
@@ -511,12 +512,12 @@ all)
        R efi ipmi0 dri gpio0 gpio1 gpio2 bktr0 vnd0 vnd1 vnd2 vnd3
        R sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 sd8 sd9 cd0 cd1 rd0 tap0
        R tap1 tap2 tap3 tun0 tun1 tun2 tun3 bio pty0 diskmap vscsi0
-       R ch0 audio0 audio1 audio2 audio3 kstat dt bpf fuse pppac pppx
-       R hotplug ptm local wscons pci0 pci1 pci2 pci3 uall rmidi0
-       R rmidi1 rmidi2 rmidi3 rmidi4 rmidi5 rmidi6 rmidi7 tuner0
-       R radio0 video0 video1 uk0 random tty00 tty01 tty02 tty03
-       R tty04 tty05 tty06 tty07 tty08 tty09 tty0a tty0b apm pf wd0
-       R wd1 wd2 wd3 std fd
+       R ch0 audio0 audio1 audio2 audio3 ttyP00 ttyP01 kstat dt bpf
+       R fuse pppac pppx hotplug ptm local wscons pci0 pci1 pci2 pci3
+       R uall rmidi0 rmidi1 rmidi2 rmidi3 rmidi4 rmidi5 rmidi6 rmidi7
+       R tuner0 radio0 video0 video1 uk0 random tty00 tty01 tty02
+       R tty03 tty04 tty05 tty06 tty07 tty08 tty09 tty0a tty0b apm pf
+       R wd0 wd1 wd2 wd3 std fd
        ;;
 
 wd*|sd*)
Index: etc//etc.arm64/MAKEDEV.md
===================================================================
RCS file: /OpenBSD/src/etc/etc.arm64/MAKEDEV.md,v
retrieving revision 1.16
diff -u -p -r1.16 MAKEDEV.md
--- etc//etc.arm64/MAKEDEV.md   14 Jan 2023 12:15:12 -0000      1.16
+++ etc//etc.arm64/MAKEDEV.md   21 Dec 2023 13:26:21 -0000
@@ -34,6 +34,7 @@ _TITLE(tap)
 _DEV(ch, 17)
 _TITLE(term)
 _DEV(com, 8)
+_DEV(pluart, 10)
 _TITLE(pty)
 _DEV(ptm, 81)
 _DEV(pty, 6)
Index: etc//etc.armv7/MAKEDEV
===================================================================
RCS file: /OpenBSD/src/etc/etc.armv7/MAKEDEV,v
retrieving revision 1.42
diff -u -p -r1.42 MAKEDEV
--- etc//etc.armv7/MAKEDEV      28 Jan 2023 11:47:25 -0000      1.42
+++ etc//etc.armv7/MAKEDEV      21 Dec 2023 13:26:21 -0000
@@ -40,6 +40,7 @@
 #      st*     SCSI tape drives
 # Terminal ports:
 #      tty[0-7][0-9a-f]        NS16x50 serial ports
+#      ttyP[0-1]       serial ports
 # Pseudo terminals:
 #      ptm     pty master device
 #      pty*    Set of 62 master pseudo terminals
@@ -494,12 +495,12 @@ all)
        R gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7 gpio8 vnd0
        R vnd1 vnd2 vnd3 sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 sd8 sd9 cd0
        R cd1 rd0 tap0 tap1 tap2 tap3 tun0 tun1 tun2 tun3 bio pty0
-       R diskmap vscsi0 ch0 audio0 audio1 audio2 kstat dt bpf fuse
-       R pppac pppx hotplug ptm local wscons pci0 pci1 pci2 pci3 uall
-       R rmidi0 rmidi1 rmidi2 rmidi3 rmidi4 rmidi5 rmidi6 rmidi7
-       R tuner0 radio0 video0 video1 uk0 random tty00 tty01 tty02
-       R tty03 tty04 tty05 tty06 tty07 tty08 tty09 tty0a tty0b apm pf
-       R wd0 wd1 wd2 wd3 std st0 st1 fd
+       R diskmap vscsi0 ch0 audio0 audio1 audio2 ttyP00 ttyP01 kstat
+       R dt bpf fuse pppac pppx hotplug ptm local wscons pci0 pci1
+       R pci2 pci3 uall rmidi0 rmidi1 rmidi2 rmidi3 rmidi4 rmidi5
+       R rmidi6 rmidi7 tuner0 radio0 video0 video1 uk0 random tty00
+       R tty01 tty02 tty03 tty04 tty05 tty06 tty07 tty08 tty09 tty0a
+       R tty0b apm pf wd0 wd1 wd2 wd3 std st0 st1 fd
        ;;
 
 wd*|sd*)
Index: etc//etc.armv7/MAKEDEV.md
===================================================================
RCS file: /OpenBSD/src/etc/etc.armv7/MAKEDEV.md,v
retrieving revision 1.22
diff -u -p -r1.22 MAKEDEV.md
--- etc//etc.armv7/MAKEDEV.md   9 Nov 2022 19:35:23 -0000       1.22
+++ etc//etc.armv7/MAKEDEV.md   21 Dec 2023 13:26:21 -0000
@@ -42,9 +42,9 @@ _DEV(wd, 16, 16)
 _TITLE(tap)
 _DEV(st, 25)
 _TITLE(term)
-dnl _DEV(com, 12)
 dnl _DEV(fcom, 54)
 _DEV(com, 12)
+_DEV(pluart, 10)
 _TITLE(pty)
 _DEV(ptm, 98)
 _DEV(pty, 5)
Index: share/man/man4/pluart.4
===================================================================
RCS file: /OpenBSD/src/share/man/man4/pluart.4,v
retrieving revision 1.2
diff -u -p -r1.2 pluart.4
--- share/man/man4/pluart.4     2 Jul 2018 15:39:33 -0000       1.2
+++ share/man/man4/pluart.4     21 Dec 2023 13:26:21 -0000
@@ -27,6 +27,13 @@
 The
 .Nm
 driver supports the ARM PrimeCell PL011 UART.
+.Sh FILES
+.Bl -tag -width Pa -compact
+.It Pa /dev/ttyP0
+.It Pa /dev/ttyP1
+.It Pa /dev/cuap0
+.It Pa /dev/cuaP1
+.El
 .Sh SEE ALSO
 .Xr tty 4
 .Rs
Index: sys/arch/arm/arm/conf.c
===================================================================
RCS file: /OpenBSD/src/sys/arch/arm/arm/conf.c,v
retrieving revision 1.59
diff -u -p -r1.59 conf.c
--- sys/arch/arm/arm/conf.c     2 Sep 2022 20:06:55 -0000       1.59
+++ sys/arch/arm/arm/conf.c     21 Dec 2023 13:26:21 -0000
@@ -142,6 +142,9 @@ cdev_decl(wsmouse);
 #include "radio.h"
 cdev_decl(radio);
 
+#include "pluart.h"
+cdev_decl(pluart);
+
 #include <arm/conf.h>
 
 /* Block devices */
@@ -275,7 +278,7 @@ struct cdevsw cdevsw[] = {
        cdev_fd_init(1,filedesc),               /*  7: file descriptor 
pseudo-device */
        cdev_ksyms_init(NKSYMS,ksyms),          /*  8: Kernel symbols device */
        cdev_lpt_init(NLPT,lpt),                /*  9: parallel printer */
-       cdev_notdef(),                          /* 10: */
+       cdev_tty_init(NPLUART,pluart),          /* 10: serial port */
        cdev_notdef(),                          /* 11: */
        cdev_tty_init(NCOM,com),                /* 12: serial port */
        cdev_gpio_init(NGPIO,gpio),             /* 13: GPIO interface */
Index: sys/arch/arm64/arm64/conf.c
===================================================================
RCS file: /OpenBSD/src/sys/arch/arm64/arm64/conf.c,v
retrieving revision 1.22
diff -u -p -r1.22 conf.c
--- sys/arch/arm64/arm64/conf.c 6 Mar 2023 17:20:06 -0000       1.22
+++ sys/arch/arm64/arm64/conf.c 21 Dec 2023 13:26:21 -0000
@@ -101,6 +101,8 @@ cdev_decl(lpt);
 #include "radio.h"
 #include "drm.h"
 cdev_decl(drm);
+#include "pluart.h"
+cdev_decl(pluart);
 
 #include "wsdisplay.h"
 #include "wskbd.h"
@@ -135,7 +137,7 @@ struct cdevsw       cdevsw[] =
        cdev_log_init(1,log),           /* 7: /dev/klog */
        cdev_tty_init(NCOM,com),        /* 8: serial port */
        cdev_notdef(),                  /* 9: was floppy disk */
-       cdev_notdef(),                  /* 10 */
+       cdev_tty_init(NPLUART,pluart),  /* 10: serial port */
        cdev_notdef(),                  /* 11: Sony CD-ROM */
        cdev_wsdisplay_init(NWSDISPLAY, /* 12: frame buffers, etc. */
            wsdisplay),

Reply via email to