qemu ppc bsp, which one?

Karel Gardas karel.gardas at centrum.cz
Wed Aug 5 22:36:30 UTC 2020


>     - rsb's rtems/config/5/bsps does not contain any qemu*.bset. From PPC,
>     only qoriq_e*.bset are there. I've checked qoriq_e6500_64 in qemu very
>     lightly but so far no success. If, there is any receipt how to get that
>     bsp running inside qemu, then I would appreciate it.

I'm lightly investigating this option. I've tried both:

 ~/sfw/qemu-4.2.1/bin/qemu-system-ppc64 -s -S -cpu e6500 -nographic -m
2g -M ppce500 -kernel hello.exe -D log -d in_asm,cpu,int

and

~/sfw/qemu-4.2.1/bin/qemu-system-ppc64 -s -S -cpu e6500 -nographic
-serial mon:stdio -m 2g -M mpc8544ds -kernel hello.exe -D log -d
in_asm,cpu,int

E.g. machines either ppce500 or mpc8544ds and in both case the code hang
up in bsps/shared/dev/serial/ns16550-context.c:534 which is:

    532     /* Wait for transmitter holding register to be empty */
    533     do {
    534       status = get( port, NS16550_LINE_STATUS);
    535     } while ((status & SP_LSR_THOLD) == 0);
    536   }


so I'm hitting infinite loop here since serial is badly configured
probably. Otherwise I think this stacktrace shows a bit of hope that
something is really working:

Program received signal SIGINT, Interrupt.
0x0000000000018a58 in ns16550_polled_putchar (base=0x50004f0
<qoriq_uart_context_0>, out=<optimized out>)
    at
../../../../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/lib/libbsp/powerpc/qoriq/../../../../../../bsps/shared/dev/serial/ns16550-context.c:534
534
../../../../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/lib/libbsp/powerpc/qoriq/../../../../../../bsps/shared/dev/serial/ns16550-context.c:
No such file or directory.
(gdb) where
#0  0x0000000000018a58 in ns16550_polled_putchar (base=0x50004f0
<qoriq_uart_context_0>, out=<optimized out>)
    at
../../../../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/lib/libbsp/powerpc/qoriq/../../../../../../bsps/shared/dev/serial/ns16550-context.c:534
#1  0x0000000000018914 in output_char (c=<optimized out>)
    at
../../../../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/lib/libbsp/powerpc/qoriq/../../../../../../bsps/powerpc/qoriq/console/console-config.c:312
#2  0x0000000000009b88 in rtems_putc (c=<optimized out>)
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/libcsupport/src/rtems_putc.c:31
#3  0x0000000000009a18 in fprintf_putc_write (ptr=<optimized out>,
cookie=<optimized out>, buf=<optimized out>, n=<optimized out>)
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/libcsupport/src/printerfprintfputc.c:40
#4  0x000000000001ee04 in __sflush_r (ptr=0x50128b0
<_RTEMS_tasks_Objects+1496>, fp=0x501bfd0)
    at ../../../../../../../gcc-7.5.0/newlib/libc/stdio/fflush.c:224
#5  0x000000000001f03c in _fflush_r (ptr=0x50128b0
<_RTEMS_tasks_Objects+1496>, fp=0x501bfd0)
    at ../../../../../../../gcc-7.5.0/newlib/libc/stdio/fflush.c:278
#6  0x000000000001cdd0 in __sbprintf (rptr=0x50128b0
<_RTEMS_tasks_Objects+1496>, fp=0x5015b20 <fprintf_putc_file>,
    fmt=0x4041780 "\n\n*** BEGIN OF TEST %s ***\n*** TEST VERSION:
%s\n*** TEST STATE: %s\n*** TEST BUILD: RTEMS_POSIX_API\n*** TEST TOOLS:
7.5.0 20191114 (RTEMS 5, RSB 5 (9b1545f1461a), Newlib 7947581)\n",
ap=0x501c3b0 "")
    at ../../../../../../../gcc-7.5.0/newlib/libc/stdio/vfprintf.c:477
#7  0x000000000001a6e4 in _vfprintf_r (data=0x50128b0
<_RTEMS_tasks_Objects+1496>, fp=0x5015b20 <fprintf_putc_file>,
    fmt0=0x4041780 "\n\n*** BEGIN OF TEST %s ***\n*** TEST VERSION:
%s\n*** TEST STATE: %s\n*** TEST BUILD: RTEMS_POSIX_API\n*** TEST TOOLS:
7.5.0 20191114 (RTEMS 5, RSB 5 (9b1545f1461a), Newlib 7947581)\n",
ap=0x501c3b0 "")
    at ../../../../../../../gcc-7.5.0/newlib/libc/stdio/vfprintf.c:864
#8  0x00000000000099b8 in fprintf_putc_printer (context=<optimized out>,
fmt=<optimized out>, ap=<optimized out>)
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/libcsupport/src/printerfprintfputc.c:59
#9  0x0000000000019028 in rtems_printf (printer=<optimized out>,
format=<optimized out>)
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/libcsupport/src/print_printf.c:46
#10 0x0000000000018738 in rtems_test_begin (name=0x40000e0
<rtems_test_name> "HELLO WORLD", state=<optimized out>)
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/libtest/testbeginend.c:40
#11 0x000000000000578c in Init (ignored=<optimized out>)
    at
../../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../testsuites/samples/hello/init.c:24
#12 0x0000000000010458 in _Thread_Entry_adaptor_numeric
(executing=<optimized out>)
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/score/src/threadentryadaptornumeric.c:25
#13 0x000000000000fbb4 in _Thread_Handler ()
    at
../../../../../rtems-46c23871813618e7a16050068041b3d33551cd0d/c/src/../../cpukit/score/src/threadhandler.c:139
#14 0x000000000000fb10 in ?? ()


Now, the question is how to make serial to work well. Qemu supplied
device tree text representation is also attached.

Thanks,
Karel




-------------- next part --------------
/dts-v1/;

/ {
	compatible = "fsl,qemu-e500";
	model = "QEMU ppce500";
	#size-cells = <0x2>;
	#address-cells = <0x2>;

	platform at f00000000 {
		interrupt-parent = <0x8003>;
		ranges = <0x0 0xf 0x0 0x8000000>;
		#address-cells = <0x1>;
		#size-cells = <0x1>;
		compatible = "qemu,platform", "simple-bus";
	};

	pci at fe0008000 {
		#address-cells = <0x3>;
		#size-cells = <0x2>;
		#interrupt-cells = <0x1>;
		clock-frequency = <0x3f940aa>;
		reg = <0xf 0xe0008000 0x0 0x1000>;
		ranges = <0x2000000 0x0 0xe0000000 0xc 0x0 0x0 0x20000000 0x1000000 0x0 0x0 0xf 0xe1000000 0x0 0x10000>;
		fsl,msi = <0x8004>;
		bus-range = <0x0 0xff>;
		interrupts = <0x18 0x2>;
		interrupt-parent = <0x8003>;
		interrupt-map = <0x800 0x0 0x0 0x1 0x8003 0x2 0x1 0x800 0x0 0x0 0x2 0x8003 0x3 0x1 0x800 0x0 0x0 0x3 0x8003 0x4 0x1 0x800 0x0 0x0 0x4 0x8003 0x1 0x1 0x1000 0x0 0x0 0x1 0x8003 0x3 0x1 0x1000 0x0 0x0 0x2 0x8003 0x4 0x1 0x1000 0x0 0x0 0x3 0x8003 0x1 0x1 0x1000 0x0 0x0 0x4 0x8003 0x2 0x1 0x1800 0x0 0x0 0x1 0x8003 0x4 0x1 0x1800 0x0 0x0 0x2 0x8003 0x1 0x1 0x1800 0x0 0x0 0x3 0x8003 0x2 0x1 0x1800 0x0 0x0 0x4 0x8003 0x3 0x1 0x2000 0x0 0x0 0x1 0x8003 0x1 0x1 0x2000 0x0 0x0 0x2 0x8003 0x2 0x1 0x2000 0x0 0x0 0x3 0x8003 0x3 0x1 0x2000 0x0 0x0 0x4 0x8003 0x4 0x1 0x2800 0x0 0x0 0x1 0x8003 0x2 0x1 0x2800 0x0 0x0 0x2 0x8003 0x3 0x1 0x2800 0x0 0x0 0x3 0x8003 0x4 0x1 0x2800 0x0 0x0 0x4 0x8003 0x1 0x1 0x3000 0x0 0x0 0x1 0x8003 0x3 0x1 0x3000 0x0 0x0 0x2 0x8003 0x4 0x1 0x3000 0x0 0x0 0x3 0x8003 0x1 0x1 0x3000 0x0 0x0 0x4 0x8003 0x2 0x1 0x3800 0x0 0x0 0x1 0x8003 0x4 0x1 0x3800 0x0 0x0 0x2 0x8003 0x1 0x1 0x3800 0x0 0x0 0x3 0x8003 0x2 0x1 0x3800 0x0 0x0 0x4 0x8003 0x3 0x1 0x4000 0x0 0x0 0x1 0x8003 0x1 0x1 0x4000 0x0 0x0 0x2 0x8003 0x2 0x1 0x4000 0x0 0x0 0x3 0x8003 0x3 0x1 0x4000 0x0 0x0 0x4 0x8003 0x4 0x1 0x4800 0x0 0x0 0x1 0x8003 0x2 0x1 0x4800 0x0 0x0 0x2 0x8003 0x3 0x1 0x4800 0x0 0x0 0x3 0x8003 0x4 0x1 0x4800 0x0 0x0 0x4 0x8003 0x1 0x1 0x5000 0x0 0x0 0x1 0x8003 0x3 0x1 0x5000 0x0 0x0 0x2 0x8003 0x4 0x1 0x5000 0x0 0x0 0x3 0x8003 0x1 0x1 0x5000 0x0 0x0 0x4 0x8003 0x2 0x1 0x5800 0x0 0x0 0x1 0x8003 0x4 0x1 0x5800 0x0 0x0 0x2 0x8003 0x1 0x1 0x5800 0x0 0x0 0x3 0x8003 0x2 0x1 0x5800 0x0 0x0 0x4 0x8003 0x3 0x1 0x6000 0x0 0x0 0x1 0x8003 0x1 0x1 0x6000 0x0 0x0 0x2 0x8003 0x2 0x1 0x6000 0x0 0x0 0x3 0x8003 0x3 0x1 0x6000 0x0 0x0 0x4 0x8003 0x4 0x1 0x6800 0x0 0x0 0x1 0x8003 0x2 0x1 0x6800 0x0 0x0 0x2 0x8003 0x3 0x1 0x6800 0x0 0x0 0x3 0x8003 0x4 0x1 0x6800 0x0 0x0 0x4 0x8003 0x1 0x1 0x7000 0x0 0x0 0x1 0x8003 0x3 0x1 0x7000 0x0 0x0 0x2 0x8003 0x4 0x1 0x7000 0x0 0x0 0x3 0x8003 0x1 0x1 0x7000 0x0 0x0 0x4 0x8003 0x2 0x1 0x7800 0x0 0x0 0x1 0x8003 0x4 0x1 0x7800 0x0 0x0 0x2 0x8003 0x1 0x1 0x7800 0x0 0x0 0x3 0x8003 0x2 0x1 0x7800 0x0 0x0 0x4 0x8003 0x3 0x1 0x8000 0x0 0x0 0x1 0x8003 0x1 0x1 0x8000 0x0 0x0 0x2 0x8003 0x2 0x1 0x8000 0x0 0x0 0x3 0x8003 0x3 0x1 0x8000 0x0 0x0 0x4 0x8003 0x4 0x1 0x8800 0x0 0x0 0x1 0x8003 0x2 0x1 0x8800 0x0 0x0 0x2 0x8003 0x3 0x1 0x8800 0x0 0x0 0x3 0x8003 0x4 0x1 0x8800 0x0 0x0 0x4 0x8003 0x1 0x1 0x9000 0x0 0x0 0x1 0x8003 0x3 0x1 0x9000 0x0 0x0 0x2 0x8003 0x4 0x1 0x9000 0x0 0x0 0x3 0x8003 0x1 0x1 0x9000 0x0 0x0 0x4 0x8003 0x2 0x1 0x9800 0x0 0x0 0x1 0x8003 0x4 0x1 0x9800 0x0 0x0 0x2 0x8003 0x1 0x1 0x9800 0x0 0x0 0x3 0x8003 0x2 0x1 0x9800 0x0 0x0 0x4 0x8003 0x3 0x1 0xa000 0x0 0x0 0x1 0x8003 0x1 0x1 0xa000 0x0 0x0 0x2 0x8003 0x2 0x1 0xa000 0x0 0x0 0x3 0x8003 0x3 0x1 0xa000 0x0 0x0 0x4 0x8003 0x4 0x1 0xa800 0x0 0x0 0x1 0x8003 0x2 0x1 0xa800 0x0 0x0 0x2 0x8003 0x3 0x1 0xa800 0x0 0x0 0x3 0x8003 0x4 0x1 0xa800 0x0 0x0 0x4 0x8003 0x1 0x1 0xb000 0x0 0x0 0x1 0x8003 0x3 0x1 0xb000 0x0 0x0 0x2 0x8003 0x4 0x1 0xb000 0x0 0x0 0x3 0x8003 0x1 0x1 0xb000 0x0 0x0 0x4 0x8003 0x2 0x1 0xb800 0x0 0x0 0x1 0x8003 0x4 0x1 0xb800 0x0 0x0 0x2 0x8003 0x1 0x1 0xb800 0x0 0x0 0x3 0x8003 0x2 0x1 0xb800 0x0 0x0 0x4 0x8003 0x3 0x1 0xc000 0x0 0x0 0x1 0x8003 0x1 0x1 0xc000 0x0 0x0 0x2 0x8003 0x2 0x1 0xc000 0x0 0x0 0x3 0x8003 0x3 0x1 0xc000 0x0 0x0 0x4 0x8003 0x4 0x1 0xc800 0x0 0x0 0x1 0x8003 0x2 0x1 0xc800 0x0 0x0 0x2 0x8003 0x3 0x1 0xc800 0x0 0x0 0x3 0x8003 0x4 0x1 0xc800 0x0 0x0 0x4 0x8003 0x1 0x1 0xd000 0x0 0x0 0x1 0x8003 0x3 0x1 0xd000 0x0 0x0 0x2 0x8003 0x4 0x1 0xd000 0x0 0x0 0x3 0x8003 0x1 0x1 0xd000 0x0 0x0 0x4 0x8003 0x2 0x1 0xd800 0x0 0x0 0x1 0x8003 0x4 0x1 0xd800 0x0 0x0 0x2 0x8003 0x1 0x1 0xd800 0x0 0x0 0x3 0x8003 0x2 0x1 0xd800 0x0 0x0 0x4 0x8003 0x3 0x1 0xe000 0x0 0x0 0x1 0x8003 0x1 0x1 0xe000 0x0 0x0 0x2 0x8003 0x2 0x1 0xe000 0x0 0x0 0x3 0x8003 0x3 0x1 0xe000 0x0 0x0 0x4 0x8003 0x4 0x1 0xe800 0x0 0x0 0x1 0x8003 0x2 0x1 0xe800 0x0 0x0 0x2 0x8003 0x3 0x1 0xe800 0x0 0x0 0x3 0x8003 0x4 0x1 0xe800 0x0 0x0 0x4 0x8003 0x1 0x1 0xf000 0x0 0x0 0x1 0x8003 0x3 0x1 0xf000 0x0 0x0 0x2 0x8003 0x4 0x1 0xf000 0x0 0x0 0x3 0x8003 0x1 0x1 0xf000 0x0 0x0 0x4 0x8003 0x2 0x1 0xf800 0x0 0x0 0x1 0x8003 0x4 0x1 0xf800 0x0 0x0 0x2 0x8003 0x1 0x1 0xf800 0x0 0x0 0x3 0x8003 0x2 0x1 0xf800 0x0 0x0 0x4 0x8003 0x3 0x1>;
		interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
		device_type = "pci";
		compatible = "fsl,mpc8540-pci";
		cell-index = <0x0>;
	};

	soc at fe0000000 {
		bus-frequency = <0x0>;
		ranges = <0x0 0xf 0xe0000000 0x100000>;
		#size-cells = <0x1>;
		#address-cells = <0x1>;
		compatible = "fsl,mpc8544-immr", "simple-bus";
		device_type = "soc";

		power-off {
			gpios = <0x8005 0x0 0x0>;
			compatible = "gpio-poweroff";
		};

		gpio at ff000 {
			linux,phandle = <0x8005>;
			phandle = <0x8005>;
			gpio-controller;
			#gpio-cells = <0x2>;
			interrupt-parent = <0x8003>;
			interrupts = <0x2f 0x2>;
			reg = <0xff000 0x1000>;
			compatible = "fsl,qoriq-gpio";
		};

		msi at 41600 {
			linux,phandle = <0x8004>;
			phandle = <0x8004>;
			interrupts = <0xe0 0x0 0xe1 0x0 0xe2 0x0 0xe3 0x0 0xe4 0x0 0xe5 0x0 0xe6 0x0 0xe7 0x0>;
			interrupt-parent = <0x8003>;
			msi-available-ranges = <0x0 0x100>;
			reg = <0x41600 0x200>;
			compatible = "fsl,mpic-msi";
		};

		global-utilities at e0000 {
			fsl,has-rstcr;
			reg = <0xe0000 0x1000>;
			compatible = "fsl,mpc8544-guts";
		};

		i2c at 3000 {
			interrupt-parent = <0x8003>;
			interrupts = <0x2b 0x2>;
			cell-index = <0x0>;
			reg = <0x3000 0x14>;
			compatible = "fsl-i2c";
			device_type = "i2c";

			rtc at 68 {
				reg = <0x68>;
				compatible = "pericom,pt7c4338";
			};
		};

		serial at 4500 {
			interrupt-parent = <0x8003>;
			interrupts = <0x2a 0x2>;
			clock-frequency = <0x0>;
			cell-index = <0x0>;
			reg = <0x4500 0x100>;
			compatible = "ns16550";
			device_type = "serial";
		};

		pic at 40000 {
			interrupt-controller;
			linux,phandle = <0x8003>;
			phandle = <0x8003>;
			#interrupt-cells = <0x2>;
			#address-cells = <0x0>;
			reg = <0x40000 0x40000>;
			compatible = "fsl,mpic";
			device_type = "open-pic";
		};
	};

	aliases {
		pci0 = "/pci at fe0008000";
		rtc = "i2c/rtc at 68";
		i2c = "/soc at fe0000000/i2c at 3000";
		serial0 = "/soc at fe0000000/serial at 4500";
	};

	cpus {
		#size-cells = <0x0>;
		#address-cells = <0x1>;

		PowerPC,8544 at 0 {
			status = "okay";
			bus-frequency = <0x0>;
			i-cache-size = <0x8000>;
			d-cache-size = <0x8000>;
			i-cache-line-size = <0x20>;
			d-cache-line-size = <0x20>;
			reg = <0x0>;
			device_type = "cpu";
			timebase-frequency = <0x17d78400>;
			clock-frequency = <0x17d78400>;
		};
	};

	chosen {
		stdout-path = "/soc at fe0000000/serial at 4500";
		linux,stdout-path = "/soc at fe0000000/serial at 4500";
		bootargs = [00];
		qemu,boot-kernel = <0x0 0x0 0x0 0x1f022d9c>;
	};

	memory {
		reg = <0x0 0x0 0x0 0x80000000>;
		device_type = "memory";
	};
};


More information about the users mailing list