summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm
AgeCommit message (Collapse)Author
2025-05-14kernel: get rid of Proc.kstackglenda
The kernel stack is now above the Proc structure, so the explicit kstack pointer can be eliminated.
2022-08-129: compute available kernel pages using sizeof(Proc*)Ori Bernstein
procs come from the dynamic pools, so we don't need to remove the memory used by possible procs from the total available.
2022-08-109/port: allow kiloprocs -- allocate procs lazilyOri Bernstein
Treallocate the small data structures around procs eagerly, but use malloc to allocate the large proc data structures when we need them, which allows us to scale to many more procs. There are still many scalability bottlenecks, so we only crank up the nproc limit by a little bit this time around, and crank it up more as we optimize more.
2022-07-18kernel: consistently add devbridge and netdevmedium to kernel configscinap_lenrek
2022-02-05bcm: fix rebootcode linkagecinap_lenrek
2022-02-05devgpio: make reading ctl file return 0 bytescinap_lenrek
2022-01-16kernel: make Page.txtflush into an arraycinap_lenrek
To avoid a MAXMACH limit of 32 and make txtflush into an array for the bitmap. Provide portable macros for testing and clearing the bits: needtxtflush(), donetxtflush(). On pc/pc64, define inittxtflush()/settxtflush() as no-op macros, avoiding the storage overhead of the txtflush array alltogether.
2021-12-13devssl, cpu, import, oexportfs: deleteOri Bernstein
SSL is implemented by devssl. It's extremely obsolete by now, and is not used anywhere but cpu, import, and oexportfs. This change strips out the devssl bits, but does not (yet) remove the code from libsec.
2021-11-07bcm64: parse the emmc2bus/dma-ranges device-tree property and provide ↵cinap_lenrek
*emmc2bus kernel parameter /* * emmc2 has different DMA constraints based on SoC revisions. It was * moved into its own bus, so as for RPi4's firmware to update them. * The firmware will find whether the emmc2bus alias is defined, and if * so, it'll edit the dma-ranges property below accordingly. */ emmc2bus: emmc2bus { compatible = "simple-bus"; ranges = <0x0 0x7e000000 0x0 0xfe000000 0x01800000>; dma-ranges = <0x0 0xc0000000 0x0 0x00000000 0x40000000>; emmc2: mmc@7e340000 { compatible = "brcm,bcm2711-emmc2"; reg = <0x0 0x7e340000 0x100>; interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clocks BCM2711_CLOCK_EMMC2>; status = "disabled"; }; };
2021-11-07bcm/emmc: remove unused cardr wakeup(), use MACHP(0) as tick referencecinap_lenrek
2021-10-11kernel: move waserror() macro to port/portfns.hcinap_lenrek
2021-07-25kernel: page counts a ulong, not usizecinap_lenrek
2021-04-25kernel: clean up Mach structurecinap_lenrek
Remove unused fields and factor common fields into a new PMach struct in port/portdat.h. The fields machno, splpc and proc are not moved to PMach as they are part of the known offsets from assembly (l.s).
2021-04-25bcm: try ATAGS/DTB pointer from R2 on entrycinap_lenrek
2021-02-28bcm: change color chan to RGB24 (thanks p.kosyh)cinap_lenrek
p.kosyh writes: Hello! I finally bought rpi4 4Gb specially for 9front. It seems, that default bpp of framebuffer is 16. I changed it to 24 (via cmdline.txt and config.txt) and found, that rendering is much faster! (May be due removing overheads in 16->24 conversions?) But on rpi4 r and b channels are swapped. So, i changed BGR24 to RGB24 in bcm/screen.c and now it works fine!
2021-02-06bcm64: get inbound and outbound pci window base address from device treecinap_lenrek
On the pi400, the xhci reset firmware mailbox request assumes that the pci windows match the ones specified in the device tree. The inbound window (pcidmawin) also varies now depending on the amount of memory installed. It is all pretty ridiculous, as the firmware could as well just read the pci controllers hardware register to determine the window configuration and the os could keep a nice simple 1:1 mapping (with pci dma addresses == physical addresses).
2020-12-22kernel: avoid palloc lock during mmurelease()cinap_lenrek
Previously, mmurelease() was always called with palloc spinlock held. This is unneccesary for some mmurelease() implementations as they wont release pages to the palloc pool. This change removes pagechainhead() and pagechaindone() and replaces them with just freepages() call, which aquires the palloc lock internally as needed. freepages() avoids holding the palloc lock while walking the linked list of pages, avoding some lock contention.
2020-12-21kernel: update procsave() comment, we'r not holding up->rlock anymorecinap_lenrek
2020-12-20kernel: handle tos and per process pcycle counters in port/cinap_lenrek
we might as well handle the per process cycle counter in the portable part instead of duplicating the code in every arch and have inconsistent implementations. we now have a portable kenter() and kexit() function, that is ment to be used in trap/syscall from user, which updates the counters. some kernels missed initializing Mach.cyclefreq.
2020-07-02bcm64: fix usb xhci controller on pi4 8GB variant (thanks richard miller)cinap_lenrek
On the 8GB variant of the raspberry pi 4, the eeprom chip for the xhci controller is missing and instead loaded from sdram (by the gpu firmware). for this, the gpu firmware needs to be notified of the xhci controllers pci bus address (after reset) that was assigned by our pci enumeration code.
2020-04-22bcm, bcm64: dancing to the drum of the linux clowns for device tree memory ↵cinap_lenrek
size detection (thanks kenji) looks like linux changed the device tree names for the memory node: https://github.com/raspberrypi/linux/commit/4b17654f51fd87c42cda3217b0863e6aa1df49b9#diff-ac03c9402b807c11d42edc9e8d03dfc7 this fixes the memory size detection with latest firmware on raspberry pi4-b (4GB) for kenji.
2020-04-10kernel: cleanup the software mouse cursor messcinap_lenrek
The swcursor used a 32x32 image for saving/restoring screen contents for no reason. Add a doflush argument to swcursorhide(), so that disabling software cursor with a double buffered softscreen is properly hidden. The doflush parameter should be set to 0 in all other cases as swcursordraw() will flushes both (current and previours) locations. Make sure swcursorinit() and swcursorhide() clear the visibility flag, even when gscreen is nil. Remove the cursor locking and just do everything within the drawlock. All cursor functions such as curson(), cursoff() and setcursor() will be called drawlock locked. This also means &cursor can be read. Fix devmouse cursor reads and writes. We now have the global cursor variable that is only modified under the drawlock. So copy under drawlock. Move the pc software cursor implementation into vgasoft driver, so screen.c does not need to handle it as a special case. Remove unused functions such as drawhasclients().
2020-04-04kernel: remove scheddump() comment for delay() in */fns.hcinap_lenrek
2020-02-09bcm: change ARGB32 to XRGB32 for framebuffer to avoid slow drawingRoberto E. Vargas Caballero
2020-02-02kernel: cleanup makefile for $CONF.$O targetcinap_lenrek
2020-01-26kernel: implement portable userinit() and simplify process creationcinap_lenrek
replace machine specific userinit() by a portable implemntation that uses kproc() to create the first process. the initcode text is mapped using kmap(), so there is no need for machine specific tmpmap() functions. initcode stack preparation should be done in init0() where the stack is mapped and can be accessed directly. replacing the machine specific userinit() allows some big simplifications as sysrfork() and kproc() are now the only callers of newproc() and we can avoid initializing fields that we know are being initialized by these callers. rename autogenerated init.h and reboot.h headers. the initcode[] and rebootcode[] blobs are now in *.i files and hex generation was moved to portmkfile. the machine specific mkfile only needs to specify how to build rebootcode.out and initcode.out.
2019-12-04bcm: use extended small pages so XN bit can workcinap_lenrek
the change to support no-execute bits broke the original raspberry pi1, as it uses backwards compatible page table format. to use the XN bit, subpage AP bits have to be disabled using the XP bit in CP15 Control Register c1 Bit 23.
2019-10-27bcm: fix software cursor avoidance for loadimage() case (thanks bitmapper)cinap_lenrek
2019-08-27kernel: catch execution read fault on SG_NOEXEC segmentcinap_lenrek
fault() now has an additional pc argument that is used to detect fault on a non-executable segment. that is, we check on read fault if the segment has the SG_NOEXEC attribute and the program counter is within faulting page.
2019-08-26kernel: expose no execute bit to portable mmu code as SG_NOEXEC / PTENOEXEC, ↵cinap_lenrek
add PTECACHED bits a portable SG_NOEXEC segment attribute was added to allow non-executable (physical) segments. which will set the PTENOEXEC bits for putmmu(). in the future, this can be used to make non-executable stack / bss segments. the SG_DEVICE attribute was added to distinguish between mmio regions and uncached memory. only matterns on arm64. on arm, theres the issue that PTEUNCACHED would have no bits set when using the hardware bit definitions. this is the reason bcm, kw, teg2 and omap kernels use arteficial PTE constants. on zynq, the XN bit was used as a hack to give PTEUNCACHED a non-zero value and when the bit is clear then cache attributes where added to the pte. to fix this, PTECACHED constant was added. the portable mmu code in fault.c will now explicitely set PTECACHED bits for cached memory and PTEUNCACHED for uncached memory. that way the hardware bit definitions can be used everywhere.
2019-08-25emmc: 50MHz highspeed support (from richard miller)cinap_lenrek
2019-08-23bcm64: deal with discontinuous memory regions, avoid virtual memory ↵cinap_lenrek
aliasing, implement vmap() proper on the 2GB and 4GB raspberry pi 4 variants, there are two memory regions for ram: [0x00000000..0x3e600000) [0x40000000..0xfc000000) the framebuffer is somewhere at the end of the first GB of memory. to handle these, we append the region base and limit of the second region to *maxmem= like: *maxmem=0x3e600000 0x40000000 0xfc000000 the mmu code has been changed to have non-existing ram unmapped and mmukmap() now uses small 64K pages instead of 512GB pages to avoid aliasing (framebuffer). the VIRTPCI mapping has been removed as we now have a proper vmap() implementation which assigns vritual addresses automatically.
2019-08-22bcm: invalidate cache on Fbinfo after firmware completioncinap_lenrek
2019-08-22bcm: flush out early boot messages on uart and screen initializationcinap_lenrek
make early boot messages available by writing out kmesg.buf after uart and screen initialization.
2019-08-21bcm: set XN bits for kernel device mappingscinap_lenrek
2019-08-18bcm64: add driver for emmc2 controllercinap_lenrek
2019-08-16bcm: fix typo in gpio.c on unused AFedge0 constantcinap_lenrek
2019-07-28bcm, bcm64: add vcore support for raspberry pi 3 GPIO expandercinap_lenrek
2019-07-27bcm, bcm64: add BCM2711 support for gpiopull(), fix gpiomeminit(), cleanupcinap_lenrek
according to the following linux change, BCM2711 uses a different method for changing pullup/down mode: https://github.com/raspberrypi/linux/commit/abcfd092860760087b87acbdda0963fe7906839c#diff-cf078559c38543ac72c5db99323e236d gpiomeminit() was broken, using virtual address for the gpio physseg instead of the physical one. cleanup the code, avoid repetition by declaring static u32int *regs variable. make local variable names consistent.
2019-07-25bcm, bcm64: clean dma destination buffer before issuing dma in case of non ↵cinap_lenrek
cache-line-size aligned buffer
2019-07-25bcm, bcm64: make irq.$O optional and add intrdisable(), use intrenable()cinap_lenrek
the raspberry pi 4 has a new interrupt controller and pci support, so get rid of intrenable() macro and properly make intrenable function with tbdf argument.
2019-07-25bcm, bcm64: add dmaflush() function and make virtio size and virtual address ↵cinap_lenrek
configurable in Soc.virtio and Soc.iosize
2019-07-25bcm, bcm64: add support for device tree parameter passingcinap_lenrek
the new raspberry pi 4 firmware for arm64 seems to have broken atag support. so we now parse the device tree structure to get the bootargs and memory configuration.
2019-06-20bcm, kw, omap, teg2: implement setregisters()cinap_lenrek
2019-05-19bcm, bcm64: fix cache operations for dma and emmccinap_lenrek
always clean AND invalidate caches before dma read, never just invalidate as the buffer might not be aligned to cache lines... we have to invalidate caches again *AFTER* the dma read has completed. the processor can bring in data speculatively into the cache while the dma in in flight.
2019-05-13bcm: add cache invalidate before accessing prop buffercinap_lenrek
2019-05-13bcm, bcm64: preserve memsize across reboots, avoid trashing atags while ↵cinap_lenrek
parsing cmdline we override atag memory on reboot, so preserve the memsize learned from atag as *maxmem plan9 variable. the global memsize variable is not needed anymore. avoid trashing the following atag when zero terminating the cmdline string. zero memory after plan9.ini variables.
2019-05-05bcm: make sure fiq is on enabled on cpu0cinap_lenrek
2019-05-05usbdwc: enable Slowbuilkin workarround, improve split transaction timing, ↵cinap_lenrek
handle erroring sleep(), debugging i'v been seeing the error condition described above in the Slowbulkin comment. so i'm enabling the work arround which seems to fix the lockup. in the split transaction case where we want to start the transaction at frame start, acquire the ctlr lock *before* checking if we are in the right frame number. so the start will happen atomically. checking the software ctlr->sofchan instead of checking the interrupt mask register seems to be quicker. setting the haint mask bit for the chan under ctlr lock in chanio() instead of chanwait() avoids needing to acquire the ctlr lock twice. mask wakechan bits with busychan bitmap in interrupt handlers so we will not try to wake up released chans by accident. sleep() and tsleep() might get interrupted so we have to release the split qlock in the split transaction case and in all cases, make sure to halt the channel before release. add some common debug functions to dump channel and controller registers.
2019-05-03bcm: don't call nil on PADDR() in dmaaddr(), return busdram dummy addresscinap_lenrek