system76/*: Add parport logging

Add a build-time option to configure the parallel port for logging
instead of using it as a keyboard.
This commit is contained in:
Tim Crawford 2020-03-06 10:57:26 -07:00
parent 72b453ebd3
commit e5afb927b8
9 changed files with 60 additions and 0 deletions

View File

@ -22,6 +22,9 @@ CFLAGS+=-DI2C_SMBUS=I2C_0
# Set keyboard LED I2C bus
CFLAGS+=-DI2C_KBLED=I2C_1
# Enable debug logging over keyboard parallel port
#CFLAGS+=-DPARPORT_DEBUG
# Set scratch ROM parameters
SCRATCH_OFFSET=1024
SCRATCH_SIZE=1024

View File

@ -23,6 +23,10 @@
#include <common/macro.h>
#include <common/version.h>
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
void external_0(void) __interrupt(0) {}
// timer_0 is in time.c
void timer_0(void) __interrupt(1);
@ -43,7 +47,11 @@ void init(void) {
ecpm_init();
kbc_init();
kbled_init();
#ifdef PARPORT_DEBUG
parport_init();
#else
kbscan_init();
#endif
peci_init();
pmc_init();
pwm_init();
@ -105,8 +113,10 @@ void main(void) {
power_event();
break;
case 1:
#ifndef PARPORT_DEBUG
// Scans keyboard and sends keyboard packets
kbscan_event();
#endif
break;
case 2:
// Passes through touchpad packets

View File

@ -10,6 +10,10 @@
#include <ec/i2c.h>
#endif
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
int putchar(int c) {
unsigned char byte = (unsigned char)c;
smfi_debug(byte);
@ -18,6 +22,9 @@ int putchar(int c) {
#endif
#ifdef I2C_DEBUGGER
i2c_send(&I2C_SMBUS, I2C_DEBUGGER, &byte, 1);
#endif
#ifdef PARPORT_DEBUG
parport_write(&byte, 1);
#endif
return (int)byte;
}

View File

@ -19,6 +19,9 @@ CFLAGS+=-DLEVEL=4
# Set battery I2C bus
CFLAGS+=-DI2C_SMBUS=I2C_0
# Enable debug logging over keyboard parallel port
#CFLAGS+=-DPARPORT_DEBUG
# Set scratch ROM parameters
SCRATCH_OFFSET=1024
SCRATCH_SIZE=1024

View File

@ -23,6 +23,10 @@
#include <common/macro.h>
#include <common/version.h>
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
void external_0(void) __interrupt(0) {}
// timer_0 is in time.c
void timer_0(void) __interrupt(1);
@ -43,7 +47,11 @@ void init(void) {
ecpm_init();
kbc_init();
kbled_init();
#ifdef PARPORT_DEBUG
parport_init();
#else
kbscan_init();
#endif
peci_init();
pmc_init();
pwm_init();
@ -105,8 +113,10 @@ void main(void) {
power_event();
break;
case 1:
#ifndef PARPORT_DEBUG
// Scans keyboard and sends keyboard packets
kbscan_event();
#endif
break;
case 2:
// Passes through touchpad packets

View File

@ -10,6 +10,10 @@
#include <ec/i2c.h>
#endif
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
int putchar(int c) {
unsigned char byte = (unsigned char)c;
smfi_debug(byte);
@ -18,6 +22,9 @@ int putchar(int c) {
#endif
#ifdef I2C_DEBUGGER
i2c_send(&I2C_SMBUS, I2C_DEBUGGER, &byte, 1);
#endif
#ifdef PARPORT_DEBUG
parport_write(&byte, 1);
#endif
return (int)byte;
}

View File

@ -22,6 +22,9 @@ CFLAGS+=-DI2C_SMBUS=I2C_4
# Set type-c port manager I2C bus
CFLAGS+=-DI2C_TCPM=I2C_1
# Enable debug logging over keyboard parallel port
#CFLAGS+=-DPARPORT_DEBUG
# Set scratch ROM parameters
SCRATCH_OFFSET=1024
SCRATCH_SIZE=1024

View File

@ -24,6 +24,10 @@
#include <common/macro.h>
#include <common/version.h>
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
void external_0(void) __interrupt(0) {}
// timer_0 is in time.c
void timer_0(void) __interrupt(1);
@ -44,7 +48,11 @@ void init(void) {
ecpm_init();
kbc_init();
kbled_init();
#ifdef PARPORT_DEBUG
parport_init();
#else
kbscan_init();
#endif
peci_init();
pmc_init();
pwm_init();
@ -107,8 +115,10 @@ void main(void) {
power_event();
break;
case 1:
#ifndef PARPORT_DEBUG
// Scans keyboard and sends keyboard packets
kbscan_event();
#endif
break;
case 2:
// Passes through touchpad packets

View File

@ -10,6 +10,10 @@
#include <ec/i2c.h>
#endif
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
int putchar(int c) {
unsigned char byte = (unsigned char)c;
smfi_debug(byte);
@ -18,6 +22,9 @@ int putchar(int c) {
#endif
#ifdef I2C_DEBUGGER
i2c_send(&I2C_SMBUS, I2C_DEBUGGER, &byte, 1);
#endif
#ifdef PARPORT_DEBUG
parport_write(&byte, 1);
#endif
return (int)byte;
}