Commit Graph

98 Commits

Author SHA1 Message Date
liwenxiang1 8a1743d0a6 arch/x86_64: Resolving NUC Boot Failure Issue
The segment of the Xen PVH boot protocol was not specified during linking and was placed before .loader.text, causing the boot to fail

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-16 13:53:11 +08:00
cuiziwei 68e25dcee6 nuttx/x86_64:Add _sinit and _einit initialization.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:57:31 +08:00
liwenxiang1 8b86f5de60 arch/x86_64: add support for thread_local
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 17:58:01 +08:00
ouyangxiangzhen edd7d718eb arch/x86_64: Reimplement the NuttX32 multiboot1 wrapper.
This commit reimplemented the NuttX32 multiboot1 wrapper:
1. Fixed the issue of SMP AP booting.
2. Reduced memory copy overhead. We only need to copy .realmode section
   now.
3. Move the multiboot1 header to intel64_head.S.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-30 15:35:41 +08:00
p-szafonimateusz 60b0f44369 boards/x86_64/qemu-intel64: add configs with PCI serial console
add configs with PCI serial console for qemu-intel64 so we can run NuttX on bare
metal Intel HW with serial port card

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz c7e8fd43a4 drivers/uart_16550: configure MCR_OUT2 bit from Kconfig
move MCR_OUT2 configuration from qemu-intel64/src/qemu_boot.c to common code
also leave this option disabled for qemu-intel64 as it's not required

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz a0e00b993a intel64: register PCI controller early but postpone PCI drivers init
Some of PCI drivers require OS interfaces that can't be executed in the INIT context.
In that case we have to postpone PCI drivers probing and call it for example
in board initialization logic.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz 53d0425ae3 boards/x86_64/qemu-intel64: enable debug messages for PCI test configs
enable debug messages for PCI configuration in qemu-intel64
so we know exactly what happen during execution

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-12 18:10:46 +08:00
p-szafonimateusz e58efb17cc qemu-intel64: simplify linker script
simplify linker script for qemu-intel64 - remove not needed AT instructions

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-06 21:01:28 +08:00
lipengfei28 5c119b4a03 refresh the pci test config
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
p-szafonimateusz 3c05da536a arch/intel64: add support for HPET as system clock
HPET can be used as system clock for x86_64

to set HPET as system clock you have to enable:
  CONFIG_ONESHOT=y
  CONFIG_ALARM_ARCH=y
  CONFIG_INTEL64_ONESHOT=y
  CONFIG_ARCH_INTEL64_HPET_ALARM=y

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-08-01 17:49:41 +08:00
p-szafonimateusz 53d112fa95 x86_64: add ELF support
add arch_elf64.c for x86_64, ported from sim/x86

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-07-03 17:40:53 +08:00
p-szafonimateusz 0083ae1b2c boards/qemu-intel64: simplify STACKSIZE configuration
simplify STACKSIZE configuration by using CONFIG_DEFAULT_TASK_STACKSIZE

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-07-01 13:27:33 +08:00
p-szafonimateusz 5ad03c833f boards/qemu-intel64: add SMP config
add SMP configuration with NCPUS=2 for qemu-intel64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-29 22:37:48 +08:00
simbit18 fde641fac9 Fix Kconfig style
correct block name board
Remove extra TABs
Add comments
2024-05-29 17:15:57 -03:00
simbit18 d1789d84e8 fix nxstyle
fix Relative file path does not match actual file.
2024-05-13 22:24:36 +02:00
simbit18 09bfaa7292 fix nxstyle
fix Relative file path does not match actual file.
2024-05-11 01:19:06 +08:00
p-szafonimateusz 0fe777abd4 arch/intel64: move timer frequency configuration to common files
this logic can be common for intel64 chips

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-09 11:52:29 +08:00
p-szafonimateusz 636b2309e4 arch/intel64: cosmetic changes for TSC
cosmetic changes for TSC:
- remove unused variables
- add g_ prefix to global variables

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-09 11:52:29 +08:00
p-szafonimateusz 0a24f60e1b arch/intel64: select the system clock source with choice option
this will make it easier to add other sources as system clock

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-09 11:52:29 +08:00
p-szafonimateusz 7d95bec148 qemu-intel64: move PCI initialization back to board logic
this partly revert 4123615621 which works OK for PCI serial and network cards
but breaks QEMU EDU due to usage of sem and usleep in IDLE thread context.
Another solution will be provided later.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-07 15:03:40 -03:00
p-szafonimateusz d4b17f963d arch/intel64: add HPET timer support as oneshot timer
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-03 02:24:40 +08:00
p-szafonimateusz 4123615621 x86_64: move PCI bus initialization from qemu-intel64 to common x86_64 and initialize PCI in up_initialize()
many PCI devices must be initialized early during boot process (e.g. PCI serial port)

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-02-27 10:30:54 -03:00
p-szafonimateusz b634798bd6 qemu-intel64: add .note.gnu.* to linker script
this prevents section overlap linker errors which sometimes occurs:

  ld: section .rodata LMA [0000000000990000,00000000009c1f27] overlaps section .note.gnu.property LMA [000000000098ffe0,000000000099000f]
  make[1]: *** [Makefile:114: nuttx.elf] Error 1

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-02-26 18:18:48 -03:00
p-szafonimateusz b14c3e1e2e arch/intel64: add software reset support
This adds a software reset for intel64, enables the use of
the reboot command from NSH
2024-02-26 23:55:14 +08:00
p-szafonimateusz 743bbfcd7e arch/intel64/Kconfig: add chip choice option
this will be useful for auto selecting CPU features
2024-02-26 20:06:35 +08:00
p-szafonimateusz 3e5d558f4c qemu-intel64/ostest: enable DEBUG_FULLOPT
DEBUG_FULLOPT enables many x86 related optimizations which can
be broken in many ways (eg. not aligned stack).
With this change it's easier to catch changes that breaks x86_64.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-02-23 12:04:54 -03:00
p-szafonimateusz 53fcaede28 qemu-intel64/qemu.ld: align _ebss to 16
Align _ebss to 16, otherwise g_idle_topstack is not correctly aligned.
For some reason the previous alignment worked with make buit but in case
of cmake with optimization enabled, the IDLE stack was misaligned which
caused vector instruction misalignment exception.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-02-23 12:04:54 -03:00
p-szafonimateusz 9b0017659c arch/x86_64: add cmake support
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-02-23 07:45:57 +08:00
Bowen Wang de61a8e009 intel64/Toolchain.defs: move toolchain releated option to Toolchain.defs
Follow other arch does, move common toolchain option to Toolchain.defs

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-02-18 05:34:53 -08:00
Bowen Wang 415f13372d x86_64_netinitialize: support CONFIG_NETDEV_LATEINIT for x86_64
Now x86_64 can use config CONFIG_NETDEV_LATEINIT

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-02-18 05:34:53 -08:00
raiden00pl a12fdd8876 cosmetic changes after pci code rebase 2024-01-25 09:09:30 -08:00
raiden00pl 2e758f33ee fix various compilation errors after pci code rebase 2024-01-25 09:09:30 -08:00
raiden00pl 50f7e96e5e boards/x86_64: refresh earlyfb and pcitest configurations 2024-01-25 09:09:30 -08:00
Brennan Ashton 0ed4123326 x86_64: Early framebuffer console
This adds support for creating an early frame buffer and primatives for
writing to this frame buffer as a console. This does require the font
infrastructure as well as multiboot2.

Additionally this can now be used with a UEFI bootloader long as it
boots NuttX via Multiboot2.  There does seem to be a PCI interrupt
issue when running in UEFI mode.

I was able to boot my laptop using this and see PCI devices enumerate.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

x86_64: Add conditionals around the multiboot framebuffer
2024-01-25 09:09:30 -08:00
Brennan Ashton 69ed5bb67d Various fixes for PCI work
Squashed commits:

1. Porting prior PCI work in place of jailhouse code

At this point the PCI enumeration works for x86_64 including over
pci-pci bridges.

Running QEMU with this configuration we see the bridge and the
device on the bridge.  It also detected the qemu test device

qemu-system-x86_64 \
  -cpu host,+pcid,+x2apic,+tsc-deadline,+xsave,+rdrand \
  --enable-kvm -smp 1 -m 2G -cdrom boot.iso --nographic -no-reboot \
  -device pci-testdev \
  -device pci-bridge,id=bridge0,chassis_nr=2 \
  -device e1000,bus=bridge0,addr=0x3

qemu_pci_init: Initializing PCI Bus
pci_probe_device: [00:00.0] Found 8086:1237, class/revision 06000002
pci_probe_device: [00:01.1] Found 8086:7010, class/revision 01018000
pci_probe_device: [00:01.2] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.3] Found 8086:7113, class/revision 06800003
pci_probe_device: [00:01.4] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.5] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.6] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.7] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:02.0] Found 1234:1111, class/revision 03000002
pci_probe_device: [00:03.0] Found 8086:100e, class/revision 02000003
pci_probe_device: [00:04.0] Found 1b36:0005, class/revision 00ff0000
pci_probe_device: [00:04.0] Probing
pci_check_pci_bridge: [00:05.0] Found Bridge
pci_probe_device: [01:03.0] Found 8086:100e, class/revision 02000003
pci_probe_device: [00:05.0] Found 1b36:0001, class/revision 06040000

2. Remove unused CONFIG_PCI_MAX_BDF option

3. Add a workaround for Jailhouse pci scanning

4. Extend BAR parsing and handle PIO and MMIO for pci-testdev

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

5. PCI: Add initial support for QEMU 'edu' test device

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

6. Bring up PCI later in boot process

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

7. Add ISR and DMA support to QEMU edu test pci device

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

8. Fix bad function prototype definition in qemu_edu

9. intel64:  Add a pci test configuration and instructions

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

10. PCI: Fix issue in identification of 64bit bar

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2024-01-25 09:09:30 -08:00
Yang Chung-Fan 18f97bf2f8 pcie: add framework
Squashed commits:

1. x86_64: qemu: implement pci-e functions and enumerate pci-e devices on boot

2. virt: add qemu pci-testdev driver

3. pcie: types array should be null terminated

4. pcie: enable don't take flags, hardcoded enabling flags

5. pcie: checking bar > 4 for 64bit bars are sufficient

6. pcie: qemu: remove not used header

7. pcie: qemu: return -EINVAL if buffer argument is NULL

8. pcie: make pcie enumerate routine as common instead of architecture dependent

9. pcie: cosmetic changes to fit check tools

10. pcie: create MSI/MSIX related marcos and simplify the msi/msix routines
2024-01-25 09:09:30 -08:00
SPRESENSE f3fabc5d32 Revert "make/archive: Use the full path name when matching or storing names in the archive"
This reverts commit 563125fde3.
2023-10-27 22:26:18 +08:00
raiden00pl 56529d2944 Documentation: migrate the rest boards
- migrated /README are removed from /boards

- there are a lot of READMEs that should be further converted to rst.
  At the moment they are moved to Documentation/platforms and included in rst files
2023-10-26 18:13:34 -03:00
Xiang Xiao 4aa3c9cd73 boards/x86_64: Change up_netinitialize to x86_64_netinitialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-12 15:56:36 +03:00
chao an 563125fde3 make/archive: Use the full path name when matching or storing names in the archive
This pr will avoid targets with the same name can not be archive in the same library

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-26 01:21:10 +08:00
Xiang Xiao 90f8315432 arch: Remove up_netinitialize
since this api change to xxx_netinitialize

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-20 14:33:17 +03:00
Xiang Xiao 6d30726a1b Remove the unnecessary "return;" at the end of function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:23:50 +01:00
zhangyuan21 a8fa51e6bf arch: rename arch special function name 2022-11-22 16:27:56 +08:00
Masayuki Ishikawa 07b642ae8d boards: qemu-intel64: Fix pthread_attr_setstacksize failed in ostest
Summary:
- This commit adjusts CONFIG_TESTING_OSTEST_STACKSIZE to fix
  pthread_attr_setstacksize failed error in ostest

Impact:
- None

Testing:
- Tested with ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-15 08:46:01 +02:00
Nathan Hartman 849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
Nimish Telang 4afd25b567 this flag is meaningless for the linker 2022-06-27 20:03:03 -03:00
Xiang Xiao 54e630e14d arch: Merge up_arch.h into up_internal.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-14 09:32:17 +02:00
Xiang Xiao ee931c137f boards: Remove -fno-builtin
it's more efficent to generate the machine code directly if possible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-10 19:46:01 +02:00
Xiang Xiao 9836c6be9b boards: Remove CONFIG_CLOCK_MONOTONIC from all defconfig
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:26 +08:00