github.com/f-secure-foundry/tamago@v0.0.0-20220307101044-d73fcdd7f11b/board/f-secure/usbarmory/mark-two/console.go (about)

     1  // USB armory Mk II support for tamago/arm
     2  // https://github.com/f-secure-foundry/tamago
     3  //
     4  // Copyright (c) F-Secure Corporation
     5  // https://foundry.f-secure.com
     6  //
     7  // Use of this source code is governed by the license
     8  // that can be found in the LICENSE file.
     9  
    10  // +build !linkprintk
    11  
    12  package usbarmory
    13  
    14  import (
    15  	_ "unsafe"
    16  
    17  	"github.com/f-secure-foundry/tamago/soc/imx6"
    18  )
    19  
    20  // On the USB armory Mk II the serial console is UART2, therefore standard
    21  // output is redirected there.
    22  //
    23  // The console is exposed through the USB Type-C receptacle and available only
    24  // in debug accessory mode (see EnableDebugAccessory()).
    25  
    26  //go:linkname printk runtime.printk
    27  func printk(c byte) {
    28  	imx6.UART2.Tx(c)
    29  }