#########################################################################
# File...: /boot/platform/hwm_bw/config.txt
# Purpose: Configuration file for the RPi 2nd stage Boot Loader.
# Date...: 19-Oct-2025
#########################################################################
# Changes
# 22-Dec-2021: Initial version
# 19-Oct-2025: Migrated from U-Boot to the RPi Native Boot Loader.
#########################################################################
# Notes
# [1] This file is not actively managed by the Slackware OS.
# [2] The Linux kernel command line settings can be found in the file
#     'cmdline.txt' within this directory.
# [3] For detailed information about this configuration file and the possible
#     configuration directives, see:-
#     https://www.raspberrypi.com/documentation/computers/config_txt.html
# [4] The Boot Loader selects the correct DTB automatically, hence why
#     they are not configured here. Some are commented out from previous
#     testing, and remain as examples should you specifically want to
#     use one.
#########################################################################

####################################################
# Raspberry Pi Hardware Model settings
####################################################

# Raspberry Pi5 settings:
[pi5]
# Enable DRM VC4 V3D driver:
dtoverlay=vc4-kms-v3d-pi5
#dtoverlay=vc4-kms-v3d,audio=on
max_framebuffers=2
# Charge the battery?
# Read this page first before setting this - you MUST have a rechargeable battery:
# https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#enable-battery-charging
#dtparam=rtc_bbat_vchg=3000000
# Disable WiFi:
#dtoverlay=disable-wifi-pi5
# Disable BlueTooth:
#dtoverlay=disable-bt-pi5

# Raspberry Pi4/400 settings:
[pi4]
arm_64bit=1
# For the RPi Kernel fork, uncomment these two directives:
# Assign 128MB of RAM to the GPU:
#gpu_mem=128
#dtoverlay=vc4-kms-v3d
# For the mainline Kernel (Slackware AArch64 standard):
dtoverlay=vc4-kms-v3d-pi4
max_framebuffers=2
#hdmi_enable_4kp60=1
# Interested in overclocking options?
# See: https://www.raspberrypi.com/news/introducing-turbo-mode-up-to-50-more-performance-for-free/
#
# Experimental for RPi4 model B:
#device_tree=bcm2711-rpi-4-b.dtb

# Enable audio (loads snd_bcm2835)
# Not for Linux 6.18:
#dtparam=audio=on

# Raspberry Pi400 settings. These would override those configured
# for all RPi4 models.
#[pi400]

# Raspberry Pi3 settings:
[pi3]
arm_64bit=1
#device_tree=bcm2837-rpi-3-b.dtb
# Raspberry Pi3+ settings:
[pi3+]
#device_tree=bcm2837-rpi-3-b-plus.dtb
arm_64bit=1

####################################################
# General settings for Raspberry Pi Hardware Models
####################################################
[all]
# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1

# Serial settings:
#init_uart_baud=115200
enable_uart=1
# Enable visibility of boot loader & Linux Kernel messages:
enable_rp1_uart=1
uart_2ndstage=1
# Note: If you need to use BlueTooth, you should disable the UART:
#enable_uart=0

# Additional overlays and parameters are documented
# /boot/firmware/overlays/README

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# For the VC4 driver (according to the help text within the
# Kernel configuration!)
avoid_warnings=2

# To debug the RPi native Boot Loader:
#uart_2ndstage=1
#dtdebug=1

# Help with using KVM's:
#hdmi_force_hotplug=1

# This configuration file contains the parameters that will boot the Kernel
# and Initial RAM disk.
# Breaking these settings into a separate configuration enables divergence
# between RPi Hardware Models where necessary.
include slk_config.txt

# Enable Device Tree debugging:
dtdebug=on

#########################################################################
# Device Tree Overlays
# See the README /boot/platform/hwm_bw/overlays/README
# (Note: this 'README' is from the RPi Bootware repository)
#########################################################################

# Real Time Clocks on the I2C bus (connected to the GPIO pins):
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
#dtoverlay=i2c-rtc,ds1307
#dtoverlay=i2c-rtc,pcf85063

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
