Sunday, March 24, 2024

Re: porting OpenBSD to Ox64


On 3/24/24 14:09, Slava Voronzoff wrote:
On Fri, 22 Mar 2024 04:28:15 +0100  "Peter J. Philipp" <pjp@delphinusdns.org> wrote:       
No I didn't try a newer OBSD, I will soon though. :-)  And no I didn't   change anything in the DTB.  
  While this is an EXTREMELY dirty attempt to add it can you try somehow this patch for OpenBS-current kernel?   OR try to decompile dtb, edit dts file to change "bflb,bl808-uart" to something supported generic like ns16550a, recompile it back to dtb and load from OpenBSD's boot loader    Index: sys/dev/fdt/com_fdt.c  ===================================================================  RCS file: /cvs/src/sys/dev/fdt/com_fdt.c,v  retrieving revision 1.9  diff -u -p -r1.9 com_fdt.c  --- sys/dev/fdt/com_fdt.c	31 Jan 2024 01:01:10 -0000	1.9  +++ sys/dev/fdt/com_fdt.c	24 Mar 2024 13:04:37 -0000  @@ -59,7 +59,8 @@ com_fdt_init_cons(void)   	    (node = fdt_find_cons("ns16550a")) == NULL &&   	    (node = fdt_find_cons("snps,dw-apb-uart")) == NULL &&   	    (node = fdt_find_cons("ti,omap3-uart")) == NULL &&  -	    (node = fdt_find_cons("ti,omap4-uart")) == NULL)  +	    (node = fdt_find_cons("ti,omap4-uart")) == NULL &&  +	    (node = fdt_find_cons("bflb,bl808-uart")) == NULL)	   			return;   	if (fdt_get_reg(node, 0, &reg))   		return;  @@ -101,7 +102,8 @@ com_fdt_match(struct device *parent, voi   	    OF_is_compatible(faa->fa_node, "ns16550a") ||   	    OF_is_compatible(faa->fa_node, "snps,dw-apb-uart") ||   	    OF_is_compatible(faa->fa_node, "ti,omap3-uart") ||  -	    OF_is_compatible(faa->fa_node, "ti,omap4-uart"));  +	    OF_is_compatible(faa->fa_node, "ti,omap4-uart") ||  +	    OF_is_compatible(faa->fa_node, "bflb,bl808-uart"));   }      void    


Hi,

I don't know if it's so simple... but I just finished a bflbuart.c

driver. It is based on the sfuart.c driver and I used the

linux sources, and the bl808 reference manual to guide me.

https://github.com/pbug44/openbsd-src/commit/996f961786d17399d68ef8aef547a10ef22ca82b

However I noticed that there is no PLIC/INTR activity. Does

anyone know if this is due to no clock driver? If so that's

my next thing to do unless someone beats me to it. I have

another question. I added the bflbuart to the files.riscv64

and the Makefile doesn't update in /sys/arch/riscv64/compile/RAMDISK/obj/Makefile.. I don't know what I have to do it..for

now I manually updated this file.

Please excuse for the weird formatting. I'm still on thunderbird on OpenBSD and I'm not fully comfy with it.

Best Regards,

-pjp

--   Over thirty years experience on UNIX-like Operating Systems starting with QNX.

No comments:

Post a Comment