Browse Source

tidying

pull/7/head
Andrea Barisani 10 months ago
parent
commit
42f45357fe
  1. 2
      arm/cache.go
  2. 8
      bits/bits.go
  3. 5
      board/f-secure/usbarmory/mark-two/ble.go
  4. 5
      board/nxp/mx6ullevk/usdhc.go
  5. 1
      dma/dma.go
  6. 5
      soc/imx6/dcp.go
  7. 6
      soc/imx6/imx6.go
  8. 1
      soc/imx6/imx6q/mem.go
  9. 3
      soc/imx6/rngb.go
  10. 1
      soc/imx6/uart.go
  11. 2
      soc/imx6/usb/bus.go
  12. 2
      soc/imx6/usb/descriptor.go
  13. 4
      soc/imx6/usdhc/usdhc.go

2
arm/cache.go

@ -47,7 +47,7 @@ func (cpu *CPU) CacheFlushData() {
cache_flush_data()
}
// CacheFlushData flushes the ARM instruction cache.
// CacheFlushInstruction flushes the ARM instruction cache.
func (cpu *CPU) CacheFlushInstruction() {
cache_flush_instruction()
}

8
bits/bits.go

@ -9,18 +9,26 @@
// Package bits provides primitives for bitwise operations on uint32 values.
package bits
// Get returns the pointed value at a specific bit position and with a bitmask
// applied.
func Get(addr *uint32, pos int, mask int) uint32 {
return uint32((int(*addr) >> pos) & mask)
}
// Set modifies the pointed value by setting an individual bit at the position
// argument.
func Set(addr *uint32, pos int) {
*addr |= (1 << pos)
}
// Clear modifies the pointed value by clearing an individual bit at the
// position argument.
func Clear(addr *uint32, pos int) {
*addr &= ^(1 << pos)
}
// SetN modifies the pointed value by setting a value at a specific bit
// position and with a bitmask applied.
func SetN(addr *uint32, pos int, mask int, val uint32) {
*addr = (*addr & (^(uint32(mask) << pos))) | (val << pos)
}

5
board/f-secure/usbarmory/mark-two/ble.go

@ -137,6 +137,7 @@ type ANNA struct {
// BLE module instance
var BLE = &ANNA{}
// Init initializes, in normal mode, a BLE module instance.
func (ble *ANNA) Init() (err error) {
ble.Lock()
defer ble.Unlock()
@ -301,7 +302,7 @@ func (ble *ANNA) Reset() (err error) {
return
}
// Enter bootloader mode by driving low SWITCH_1 and SWITCH_2 during a module
// Enter normal mode by driving high SWITCH_1 and SWITCH_2 during a module
// reset cycle.
func (ble *ANNA) NormalMode() (err error) {
ble.Lock()
@ -317,7 +318,7 @@ func (ble *ANNA) NormalMode() (err error) {
return ble.Reset()
}
// Enter normal mode by driving high SWITCH_1 and SWITCH_2 during a module
// Enter bootloader mode by driving low SWITCH_1 and SWITCH_2 during a module
// reset cycle.
func (ble *ANNA) BootloaderMode() (err error) {
ble.Lock()

5
board/nxp/mx6ullevk/usdhc.go

@ -14,10 +14,10 @@ import (
"github.com/f-secure-foundry/tamago/soc/imx6/usdhc"
)
// Base board full size SD instance
// SD1 is the base board full size SD instance
var SD1 = usdhc.USDHC1
// CPU board microSD instance
// SD2 is the CPU board microSD instance
var SD2 = usdhc.USDHC2
// SD1/SD2 configuration constants.
@ -25,7 +25,6 @@ var SD2 = usdhc.USDHC2
// On the MCIMX6ULL-EVK the following uSDHC interfaces are connected:
// * uSDHC1: base board full size SD slot (SD1)
// * uSDHC2: CPU board microSD slot (SD2)
const (
IOMUXC_SW_MUX_CTL_PAD_CSI_DATA04 = 0x020e01f4
IOMUXC_SW_PAD_CTL_PAD_CSI_DATA04 = 0x020e0480

1
dma/dma.go

@ -33,6 +33,7 @@ type block struct {
res bool
}
// Region represents a memory region allocated form DMA purposes.
type Region struct {
sync.Mutex

5
soc/imx6/dcp.go

@ -83,7 +83,7 @@ const (
UNIQUE_KEY = 0xfe
)
// DCP work packet
// WorkPacket represents a DCP work packet
// (p1067, 13.2.6.4 Work Packet Structure, MCIMX28RM).
type WorkPacket struct {
NextCmdAddr uint32
@ -115,11 +115,12 @@ func (pkt *WorkPacket) Bytes() []byte {
return buf.Bytes()
}
// Dcp represents a DCP module instance
type Dcp struct {
sync.Mutex
}
// Data Co-Processor (DCP) instance
// DCP (Data Co-Processor) module instance
var DCP = &Dcp{}
// Init initializes the DCP module.

6
soc/imx6/imx6.go

@ -48,8 +48,10 @@ const (
SCR_WARM_RESET_ENABLE = 0
)
// Timer register (p178, Table 2-3, IMX6ULLRM)
const SYS_CNT_BASE = 0x021dc000
// Timer registers (p178, Table 2-3, IMX6ULLRM)
const (
SYS_CNT_BASE = 0x021dc000
)
// i.MX processor families
const (

1
soc/imx6/imx6q/mem.go

@ -11,7 +11,6 @@
// Package imx6q provides hardware initialization, automatically on import, for
// the i.MX6Q family of System-on-Chip components.
package imx6q
import (

3
soc/imx6/rngb.go

@ -40,11 +40,12 @@ const (
RNG_OUT = RNG_BASE + 0x14
)
// Rng represents a Random number generator instance
type Rng struct {
sync.Mutex
}
// Random Number Generator (RNGB) instance
// RNGB (Random Number Generator) module instance
var RNGB = &Rng{}
var lcg uint32

1
soc/imx6/uart.go

@ -122,6 +122,7 @@ const (
UTS_TXEMPTY = 6
)
// UART represents a serial port instance
type UART struct {
sync.Mutex

2
soc/imx6/usb/bus.go

@ -19,8 +19,8 @@ import (
"log"
"sync"
"github.com/f-secure-foundry/tamago/soc/imx6"
"github.com/f-secure-foundry/tamago/internal/reg"
"github.com/f-secure-foundry/tamago/soc/imx6"
)
// USB registers

2
soc/imx6/usb/descriptor.go

@ -404,7 +404,7 @@ func (d *Device) SetLanguageCodes(codes []uint16) (err error) {
return
}
// AddStrings adds a string descriptor to a USB device. The returned index can
// AddString adds a string descriptor to a USB device. The returned index can
// be used to fill string descriptor index value in configuration descriptors
// (p274, Table 9-16. UNICODE String Descriptor, USB2.0).
func (d *Device) AddString(s string) (uint8, error) {

4
soc/imx6/usdhc/usdhc.go

@ -29,8 +29,8 @@ import (
"github.com/f-secure-foundry/tamago/bits"
"github.com/f-secure-foundry/tamago/dma"
"github.com/f-secure-foundry/tamago/soc/imx6"
"github.com/f-secure-foundry/tamago/internal/reg"
"github.com/f-secure-foundry/tamago/soc/imx6"
)
// USDHC registers (p4012, 58.8 uSDHC Memory Map/Register Definition, IMX6ULLRM).
@ -188,7 +188,7 @@ type CardInfo struct {
Blocks int
}
// USHDC represents a controller instance.
// USDHC represents a controller instance.
type USDHC struct {
sync.Mutex

Loading…
Cancel
Save