Регистры Allwinner H616

Сокращения  |  Дерево шин  |  Карта памяти


O_HcRhPortStatus
9.5.3. OHCI Root Hub Port Status Register - адрес: 0x5200454 0x5310454 0x5311454 (смещение: 0x0454)

Хост-контроллер USB2.0: список регистров



31 ||||||||||||||||| 16
15 ||||||||||||||||| 00

  Unused

Bits 31 : 21

  PORT_RESET_STATUS_CHANGE

Bit 20
R/W
0x0

This bit is set at the end of the 10-ms port reset signal.
The HCD writes a 1 to clear this bit. Writing a '0' has no effect.
0: port reset is not complete
1: port reset is complete


  PORT_OVER_CURRENT_INDICATOR_CHANGE

Bit 19
R/W
0x0

This bit is valid only if overcurrent conditions are reported on a per-port basis.
This bit is set when Root Hub changes the PortOverCurrentIndicator bit.
The HCD writes a 1 to clear this bit. Writing a '0' has no effect.
0: no change in PortOverCurrentIndicator
1: PortOverCurrentIndicator has changed


  PORT_SUSPEND_STATUS_CHANGE

Bit 18
R/W
0x0

This bit is set when the full resume sequence has been completed.
This sequence includes the 20-s resume pulse,LS EOP, and 3-ms resychronization delay.
The HCD writes a 1 to clear this bit.
Writing a ‘0’ has no effect.
This bit is also cleared when ResetStatusChange is set.

0: resume is not completed
1: resume completed


  PORT_ENABLE_STATUS_CHANGE

Bit 17
R/W
0x0

This bit is set when hardware events cause the PortEnableStatus bit to be cleared.
Changes from HCD writes do not set this bit.
The HCD writes a 1 to clear this bit.
Writing a '0' has no effect.
0: no change in PortEnableStatus
1: change in PortEnableStatus


  CONNECT_STATUS_CHANGE

Bit 16
R/W
0x0

This bit is set whenever a connect or disconnect event occurs.
The HCD writes a 1 to clear this bit.
Writing a '0' has no effect.
If CurrentConnectStatus is cleared when a SetPortReset,SetPortEnable, or SetPortSuspend write occurs,
this bit is set to force the driver to re-evaluate the connection status since these writes should not occur if the port is disconnected.
0: no change in PortEnableStatus
1: change in PortEnableStatus
Note: If the DeviceRemovable[NDP] bit is set, this bit is set only after a Root Hub reset to inform the system that the device is attached.


  Unused

Bits 15 : 10

  LOW_SPEED_DEVICE_ATTACHED

Bit 9
R/W
0x0

Low Speed Device Attached - read
This bit indicates the speed of the device attached to this port.
When set, a Low Speed device is attached to this port. When clear, a Full Speed device is attached to this port.
This field is valid only when the CurrentConnectStatus is set.
0: full speed device attached
1: low speed device attached

Clear Port Power - write
The HCD clears the PortPowerStatus bit by writing a 1 to this bit.
Writing a '0' has no effect.


  PORT_POWER_STATUS

Bit 8
R/W
0x1

Port Power Status - read


This bit reflects the port's power status, regardless of the type of power switching implemented.
This bit is cleared if an overcurrent condition is detected.
HCD sets this bit by writing SetPortPower or SetGlobalPower.
HCD clears this bit by writing ClearPortPower or ClearGlobalPower.
Which power control switches are enabled is determined by PowerSwitchingMode and PortPortControlMask[NumberDownstreamPort].
In global switching mode(PowerSwitchingMode=0), only Set/ClearGlobalPower controls this bit.
In per-port power switching (PowerSwitchingMode=1), if the PortPowerControlMask[NDP] bit for the port is set, only Set/ClearPortPower commands are enabled.
If the mask is not set, only Set/ClearGlobalPower commands are enabled.
When port power is disabled, CurrentConnectStatus, PortEnableStatus, PortSuspendStatus, and PortResetStatus should be reset.
0: port power is off
1: port power is on

Set Port Power - write
The HCD writes a 1 to set the PortPowerStatus bit. Writing a '0' has no effect.
Note: This bit is always reads '1b' if power switching is not supported.


  Unused

Bits 7 : 5

  PORT_RESET_STATUS

Bit 4
R/W
0x0

Port Reset Status - read
When this bit is set by a write to SetPortReset, port reset signaling is
asserted. When reset is completed, this bit is cleared when
PortResetStatusChange is set. This bit cannot be set if
CurrentConnectStatus is cleared.
0: port reset signal is not active
1: port reset signal is active
Set Port Reset - write

The HCD sets the port reset signaling by writing a 1 to this bit.
Writing a '0' has no effect.
If CurrentConnectStatus is cleared, this write does not set PortResetStatus, but instead sets ConnectStatusChange.
This informs the driver that it attempted to reset a disconnected port.


  ORT_OVER_CURRENT_INDICATOR

Bit 3
R/W
0x0

Port Over Current Indicator - read
This bit is only valid when the Root Hub is configured in such a way that overcurrent conditions are reported on a per-port basis.
If per-port overcurrent reporting is not supported, this bit is set to 0.
If cleared, all power operations are normal for this port.
If set, an overcurrent condition exists on this port.
This bit always reflects the overcurrent input signal.
0: no overcurrent condition.
1: overcurrent condition detected.

Clear Suspend Status - write
The HCD writes a 1 to initiate a resume. Writing a '0' has no effect.
A resume is initiated only if PortSuspendStatus is set.


  PORT_SUSPEND_STATUS

Bit 2
R/W
0x0

Port Suspend Status - read
This bit indicates the port is suspended or in the resume sequence.
It is set by a SetSuspendState write and cleared when PortSuspendStatusChange is set at the end of the resume interval.
This bit cannot be set if CurrentConnectStatus is cleared.
This bit is also cleared when PortResetStatusChange is set at the end of the port reset or when
the HC is placed in the USBRESUME state.
If an upstream resume is in progress, it should propagate to the HC.

0: port is not suspended
1: port is suspended

Set Port Suspend - write
The HCD sets the PortSuspendStatus bit by writing a 1 to this bit.
Writing a '0' has no effect.
If CurrentConnectStatus is cleared, this write does not set PortSuspendStatus; instead it sets ConnectStatusChange.
This informs the driver that it attempted to suspend a disconnected port.


  PORT_ENABLE_STATUS

Bit 1
R/W
0x0

Port Enable Status - read
This bit indicates whether the port is enabled or disabled.
The Root Hub may clear this bit when an overcurrent condition, disconnect event,
switched-off power, or operational bus error such as babble is detected.
This change also causes PortEnabledStatusChange to be set.
HCD sets this bit by writing SetPortEnable and clears it by writing ClearPortEnable.
This bit cannot be set when CurrentConnectStatus is cleared.
his bit is also set, if not already, at the completion of a port reset when ResetStatusChange is set or port suspend when SuspendStatusChange is set.
0: port is disabled
1: port is enabled

Set Port Enable - write
The HCD sets PortEnableStatus by writing a 1 .
Writing a '0' has no effect.
If CurrentConnectStatus is cleared, this write does not set PortEnableStatus, but instead sets ConnectStatusChange.
This informs the driver that it attempted to enable a disconnected Port.


  CURRENT_CONNECT_STATUS

Bit 0
R/W
0x0

Current Connect Status - read
This bit reflects the current state of the downstream port.
0: No device connected
1: Device connected
ClearPortEnable - write
The HCD writes a 1 to clear the PortEnableStatus bit. Writing '0' has no effect.
The CurrentConnectStatus is not affected by any write.
Note:
This bit is always read 1 when the attached device is nonremovalble(DviceRemoveable[NumberDownstreamPort]).



Команда U-Boot для чтения регистра

md 5200454 1
md 5310454 1
md 5311454 1



Bit fields structure

typedef union  o_hcrhportstatus
{
  struct
  {
   unsigned current_connect_status : 1;
   unsigned port_enable_status : 1;
   unsigned port_suspend_status : 1;
   unsigned ort_over_current_indicator : 1;
   unsigned port_reset_status : 1;
   unsigned unused0 : 3;
   unsigned port_power_status : 1;
   unsigned low_speed_device_attached : 1;
   unsigned unused1 : 6;
   unsigned connect_status_change : 1;
   unsigned port_enable_status_change : 1;
   unsigned port_suspend_status_change : 1;
   unsigned port_over_current_indicator_change : 1;
   unsigned port_reset_status_change : 1;
   unsigned unused2 : 11;
  } b;
   unsigned long w;
} O_HcRhPortStatus
   

Allwinner H616 Manual