diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2009-03-20 21:59:43 +0000 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2009-03-20 21:59:43 +0000 |
commit | 9611fd600bbc2e6458c3a7bad1ca651b34940cc6 (patch) | |
tree | 1eab9fc055e2cf152beab5997a9cb584363f7814 | |
parent | bf1ccf16a25a4ef07ab4862e3e94446b2c372386 (diff) | |
download | buildroot-novena-9611fd600bbc2e6458c3a7bad1ca651b34940cc6.tar.gz buildroot-novena-9611fd600bbc2e6458c3a7bad1ca651b34940cc6.zip |
target/generic: add kconfig for serial getty config (port + baudrate)
These are the settings people most often want to tweak for embedded boards,
so add kconfig variables to make it easy to do.
-rw-r--r-- | target/generic/Config.in | 124 | ||||
-rw-r--r-- | target/generic/Makefile.in | 12 | ||||
-rw-r--r-- | target/generic/target_busybox_skeleton/etc/inittab | 3 | ||||
-rw-r--r-- | target/generic/target_skeleton/etc/inittab | 2 |
4 files changed, 138 insertions, 3 deletions
diff --git a/target/generic/Config.in b/target/generic/Config.in index 319bd4f31..f19ecc3a9 100644 --- a/target/generic/Config.in +++ b/target/generic/Config.in @@ -59,3 +59,127 @@ config BR2_TARGET_GENERIC_DEV_SYSTEM comment "Generic development system requires a toolchain with WCHAR and PROGRAM_INVOCATION support" depends on !(BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION) + +menuconfig BR2_TARGET_GENERIC_GETTY + bool "Generic serial port config" + depends on !(BR2_TARGET_ATMEL||BR2_TARGET_KWIKBYTE||BR2_TARGET_VALKA) + +if BR2_TARGET_GENERIC_GETTY + +choice + prompt "Serial port to run a getty on" + default BR2_TARGET_GENERIC_GETTY_TTYSO + help + Select a port to run a getty (login prompt) on. + +config BR2_TARGET_GENERIC_GETTY_NONE + bool "none" +config BR2_TARGET_GENERIC_GETTY_TTYSO + bool "ttyS0" +config BR2_TARGET_GENERIC_GETTY_TTYS1 + bool "ttyS1" +config BR2_TARGET_GENERIC_GETTY_TTYS2 + bool "ttyS2" +config BR2_TARGET_GENERIC_GETTY_TTYS3 + bool "ttyS3" +config BR2_TARGET_GENERIC_GETTY_TTYAMA0 + bool "ttyAMA0" + depends on BR2_arm +config BR2_TARGET_GENERIC_GETTY_TTYAMA1 + bool "ttyAMA1" + depends on BR2_arm +config BR2_TARGET_GENERIC_GETTY_TTYAMA2 + bool "ttyAMA2" + depends on BR2_arm +config BR2_TARGET_GENERIC_GETTY_TTYAMA3 + bool "ttyAMA3" + depends on BR2_arm +config BR2_TARGET_GENERIC_GETTY_TTYUL0 + bool "ttyUL0" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYUL1 + bool "ttyUL1" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYUL2 + bool "ttyUL2" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYUL3 + bool "ttyUL3" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYPSC0 + bool "ttyPSC0" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYPSC1 + bool "ttyPSC1" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYPSC2 + bool "ttyPSC2" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYPSC3 + bool "ttyPSC3" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYCPM0 + bool "ttyCPM0" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYCPM1 + bool "ttyCPM1" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYCPM2 + bool "ttyCPM2" + depends on BR2_powerpc +config BR2_TARGET_GENERIC_GETTY_TTYCPM3 + bool "ttyCPM3" + depends on BR2_powerpc +endchoice + +config BR2_TARGET_GENERIC_GETTY_PORT + string + default "#ttyS0" if BR2_TARGET_GENERIC_GETTY_NONE + default "ttyS0" if BR2_TARGET_GENERIC_GETTY_TTYS0 + default "ttyS1" if BR2_TARGET_GENERIC_GETTY_TTYS1 + default "ttyS2" if BR2_TARGET_GENERIC_GETTY_TTYS2 + default "ttyS3" if BR2_TARGET_GENERIC_GETTY_TTYS3 + default "ttyAMA0" if BR2_TARGET_GENERIC_GETTY_TTYAMA0 + default "ttyAMA1" if BR2_TARGET_GENERIC_GETTY_TTYAMA1 + default "ttyAMA2" if BR2_TARGET_GENERIC_GETTY_TTYAMA2 + default "ttyAMA3" if BR2_TARGET_GENERIC_GETTY_TTYAMA3 + default "ttyUL0" if BR2_TARGET_GENERIC_GETTY_TTYUL0 + default "ttyUL1" if BR2_TARGET_GENERIC_GETTY_TTYUL1 + default "ttyUL2" if BR2_TARGET_GENERIC_GETTY_TTYUL2 + default "ttyUL3" if BR2_TARGET_GENERIC_GETTY_TTYUL3 + default "ttyPSC0" if BR2_TARGET_GENERIC_GETTY_TTYPSC0 + default "ttyPSC1" if BR2_TARGET_GENERIC_GETTY_TTYPSC1 + default "ttyPSC2" if BR2_TARGET_GENERIC_GETTY_TTYPSC2 + default "ttyPSC3" if BR2_TARGET_GENERIC_GETTY_TTYPSC3 + default "ttyCPM0" if BR2_TARGET_GENERIC_GETTY_TTYCPM0 + default "ttyCPM1" if BR2_TARGET_GENERIC_GETTY_TTYCPM1 + default "ttyCPM2" if BR2_TARGET_GENERIC_GETTY_TTYCPM2 + default "ttyCPM3" if BR2_TARGET_GENERIC_GETTY_TTYCPM3 + +choice + prompt "Baudrate to use" + default BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200 + help + Select a baudrate to use. + +config BR2_TARGET_GENERIC_GETTY_BAUDRATE_9600 + bool "9600" +config BR2_TARGET_GENERIC_GETTY_BAUDRATE_19200 + bool "19200" +config BR2_TARGET_GENERIC_GETTY_BAUDRATE_38400 + bool "38400" +config BR2_TARGET_GENERIC_GETTY_BAUDRATE_57600 + bool "57600" +config BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200 + bool "115200" +endchoice + +config BR2_TARGET_GENERIC_GETTY_BAUDRATE + string + default "9600" if BR2_TARGET_GENERIC_GETTY_BAUDRATE_9600 + default "19200" if BR2_TARGET_GENERIC_GETTY_BAUDRATE_19200 + default "38400" if BR2_TARGET_GENERIC_GETTY_BAUDRATE_38400 + default "57600" if BR2_TARGET_GENERIC_GETTY_BAUDRATE_57600 + default "115200" if BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200 + +endif diff --git a/target/generic/Makefile.in b/target/generic/Makefile.in index 4ea0b6a6b..3541264c8 100644 --- a/target/generic/Makefile.in +++ b/target/generic/Makefile.in @@ -7,3 +7,15 @@ TARGET_SKELETON=target/generic/target_busybox_skeleton TARGET_DEVICE_TABLE=target/generic/mini_device_table.txt endif +TARGET_GENERIC_GETTY:=$(strip $(subst ",, $(BR2_TARGET_GENERIC_GETTY_PORT))) +#")) +TARGET_GENERIC_GETTY_BAUDRATE:=$(strip $(subst ",, $(BR2_TARGET_GENERIC_GETTY_BAUDRATE))) +#")) + +target-generic-getty: + $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(TARGET_GENERIC_GETTY)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY) $(TARGET_GENERIC_GETTY_BAUDRATE) vt100 #~' \ + $(TARGET_DIR)/etc/inittab + +ifeq ($(BR2_TARGET_GENERIC_GETTY),y) +TARGETS += target-generic-getty +endif diff --git a/target/generic/target_busybox_skeleton/etc/inittab b/target/generic/target_busybox_skeleton/etc/inittab index fc59c6ba2..7c7bf7a5a 100644 --- a/target/generic/target_busybox_skeleton/etc/inittab +++ b/target/generic/target_busybox_skeleton/etc/inittab @@ -32,10 +32,9 @@ # Set up a couple of getty's tty1::respawn:/sbin/getty 38400 tty1 tty2::respawn:/sbin/getty 38400 tty2 -#ttyAMA0::respawn:/sbin/getty -L ttyAMA0 115200 vt100 # Put a getty on the serial port -#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 +#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL # Logging junk null::sysinit:/bin/touch /var/log/messages diff --git a/target/generic/target_skeleton/etc/inittab b/target/generic/target_skeleton/etc/inittab index a6c014e75..7aa654f8a 100644 --- a/target/generic/target_skeleton/etc/inittab +++ b/target/generic/target_skeleton/etc/inittab @@ -28,7 +28,7 @@ tty1::respawn:/sbin/getty 38400 tty1 tty2::respawn:/sbin/getty 38400 tty2 # Put a getty on the serial port -#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 +#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL # Logging junk null::sysinit:/bin/touch /var/log/messages |