Abstract:
Methods, systems, apparatuses and program products are disclosed for communications such as may be used for debugging computers and similar electronic products at a level suitable for low level firmware. This may find application, for example, in environments after cache initialization around the time of memory bring up or motherboard device enumeration but including durability into and beyond software loading. 
     GPIO (General Purpose input/output) connections may be used for communication that may, for some purposes, be regarded as half-duplex but without necessarily being anisochronous.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention generally relates to personal computers and devices sharing similar architectures, and, more particularly relates to a system and method for debugging such as for firmware, for example computer BIOS (Basic Input/Output System). The methods and systems make use of a debugger application executing on a host computer and configured to communicate with a debugger module executing on a target electronic device under test via a GPIO (General Purpose Input/Output) and/or similar and other means such as, for example, serial/parallel/USB (Universal Serial Bus) of host computer(s), adapter and Bus of the electronic device. Provision for multipoint operation may be made. Typically, the electronic device will be a laptop computer, but embodiments of the invention find application on a broader range of device. 
       BACKGROUND OF THE INVENTION 
       [0002]    Modernly, turn-on and bring-up of a commonplace electronic device such as a computer is complex, far more so than was the case in earlier generations of commonly available computers. Much of the complexity is hidden from the causal user and from a majority of software developers. 
         [0003]    During early computer start-up the main semiconductor memory is typically not available, and a cache memory (which may be on or off the CPU (Central Processor Unit)) chip(s) is used by firmware as general purpose memory (e.g. for stack) in order execute instruction codes to determine the presence and characteristics of any RAM (Random Access Memory) present. This is commonly performed by means of a dialog on an I2C (Inter-Integrated Circuit) which is a slow, multi-master serial computer bus. This is an early part of a complex many-stage process by which a computer pulls itself up by its (metaphorical) bootstraps, commonly referred to simply as booting. Having located any RAM present the RAM can be configured in and the loading process may advance to a next step and, in due course, to a POST (Power-On Self Test). 
         [0004]    SMBus (System Management Bus) is a two-signal bus, a subset of I2C and used for communication with low-bandwidth devices on a motherboard, especially power-related chips such as a laptop rechargeable battery subsystem. One purpose of deploying SMBus is to promote robustness with interoperability. 
         [0005]    I2C and/or SMBus have been proposed for communication between a debugging station (host) and a target. Inter alia, so doing avoids problems of using communications facilities which may be so rich as to preclude simple code support within the target device and/or which may be trampled on by software loaded later in a typical booting process. Such an arrangement might be needed, for example, for debugging a POST (Power-On Self Test) firmware routine however there are disadvantages pursuant to using I2C and/or SMBus in this way. Such previously developed solutions may, for example, adversely interact with the very I2C circuits that comprise the test-target feature within the code under test. Also SMBus requires at least two wires (in addition to reference ground); one each for clock and for data. The term “wire” is used (herein) as commonly understood in the well-known VHDL (very high speed integrated circuit hardware definition language) arts and does not necessary refer to a cabled metallic conductor. 
         [0006]    Single-wire UART (Universal Asynchronous Receiver-Transmitter) has also been used for communications where performance criteria are relatively modest, including debugging station connection. Single wire UART is well-known in the art but, as compared with single-wire UART, embodiments of the invention offer at least two significant advantages: firstly a single master, multiple slaves multipoint communications topology may be used. Previously developed solutions using single-wire UART have provided point-to-point communication. Secondly, the communication speed and protocol can be readily be adjusted by firmware and/or software adjustable settings. Single-wire UART implementations are lack sufficient flexibility in that regard, in part because of standards constraints. 
         [0007]    In summary, single-wire GPIO communication has the advantages as I2C, and has the low cost as single-wire UART. 
         [0008]    The present invention may overcome certain disadvantages of using resources visible to OS (operating system) and also the disadvantages of using SMBus for debugging communication. At the same time it can be more cost effective than more traditional previously developed solutions such as ICE (In-circuit Emulation). That is not to suggest that the only problem with using ICE and the like is the cost thereof. 
         [0009]    Thus, the disclosed improved computer designs include embodiments of the present invention enable superior tradeoffs in regards to the problems and shortcomings outlined above, and more. 
       SUMMARY OF THE INVENTION 
       [0010]    The present invention provides a system, apparatus and method for operating a computer for communications such as may be used for debugging computers and similar electronic products at a level suitable for low level firmware. 
         [0011]    GPIO (General Purpose input/output) connections may be used for communication that may, for some purposes, be regarded as half-duplex but without necessarily being anisochronous. 
         [0012]    According to an aspect of the present invention an embodiment of the invention may provide for a method of communicating through a GPIO connected data line by interpreting computer coded instructions to transmit a start signal, then a series of isochronous signals to form a header and turning the data line around to receive still isochronously after a predetermined delay. 
         [0013]    According to another aspect of the present invention similar and/or comparable multipoint communication may be effected through a GPIO line, again using and anisochronous start signal and isochronous header and data information. 
         [0014]    In each embodiment, the receiver clock may be free running after synchronization to an edge of the start signal. 
         [0015]    Several variants of these aspects are also discussed together with alternative exemplary embodiments. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0016]    The aforementioned and related advantages and features of the present invention will become better understood and appreciated upon review of the following detailed description of the invention, taken in conjunction with the following drawings, which are incorporated in and constitute a part of the specification, illustrate an embodiment of the invention and wherein like numerals represent like elements, and in which: 
           [0017]      FIG. 1  is a schematic block diagram of an electronic device under test according to an embodiment of the invention of the present invention. 
           [0018]      FIG. 2  is a block diagram of a debug system according to an embodiment of the invention. 
           [0019]      FIGS. 3A ,  3 B and  3 C are timing diagrams that illustrates various aspects of certain embodiments of the invention. 
           [0020]      FIG. 4  is a flow chart illustrating the steps performed in a debug messaging according to an embodiment of the invention of the present invention. 
           [0021]      FIG. 5  shows how an exemplary embodiment of the invention may be encoded onto a computer medium or media. 
           [0022]      FIG. 6  shows how an exemplary embodiment of the invention may be encoded, transmitted, received and decoded using electromagnetic waves. 
       
    
    
       [0023]    For convenience in description, identical components have been given the same reference numbers in the various drawings. 
       DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0024]    In the following description, for purposes of clarity and conciseness of the description, not all of the numerous components shown in the schematics and/or drawings are described. The numerous components are shown in the drawings to provide a person of ordinary skill in the art a thorough, enabling disclosure of the present invention. The operation of many of the components would be understood and apparent to one skilled in the art. 
         [0025]    The description of well known components is not included within this description so as not to obscure the disclosure or take away or otherwise reduce the novelty of the present invention and the main benefits provided thereby. 
         [0026]    An exemplary embodiment of the present invention will now be described with reference to the figures. 
         [0027]      FIG. 1  is a schematic block diagram of an electronic device under test  10  according to an embodiment of the invention of the present invention. 
         [0028]    In an exemplary embodiment, the electronic device  10  is implemented as a personal computer, for example, a desktop computer, a laptop computer, a tablet PC or other suitable computing device. Although the description outlines the operation of a personal computer, it will be appreciated by those of ordinary skill in the art, that the electronic device  10  may be implemented as a PDA, wireless communication device, for example, a cellular telephone, embedded controllers or devices, for example, set top boxes, printing devices or other suitable devices or combination thereof and suitable for operating or interoperating with the invention. 
         [0029]    The electronic device  10  may include at least one processor or CPU (Central Processing Unit)  12 , configured to control the overall operation of the electronic device  10 . Similar controllers or MPUs (Microprocessor Units) are commonplace. 
         [0030]    The processor  12  may typically be coupled to a bus controller  14  such as a Northbridge chip by way of a bus  13  such as a FSB (Front-Side Bus). The bus controller  14  may typically provide an interface for read-write system memory  16  such as RAM (random access memory). 
         [0031]    The bus controller  14  may also be coupled to a system bus  18 , for example a DMI (Direct Media Interface) in typical Intel® style embodiments. Coupled to the DMI  18  may be a so-called Southbridge chip such as an Intel® ICH8 (Input/Output Controller Hub type 8) chip  24   
         [0032]    The Southbridge chip  24 , may interface to an NVRAM  33  (Non-volatile Random Access Memory) which may be used to store configuration parameters and a firmware such as a BIOS (Basic Input-Output System), as is well-known in the art. 
         [0033]    In a typical embodiment of the invention, the Southbridge chip  24  may be provided with a GPIO (General Purpose Input-Output) port  25  that connects to a 2-wire (signal and ground reference) connection  22  to a host computer, system or adapter (none shown in  FIG. 1 ). 
         [0034]    In using a mobile PC, such as the electronic computing device of  FIG. 1 , commonly a mobile PC user will start an active session by bringing his or her PC to an operating state; then cause or allow a connection to Internet to be activated; perform various computer oriented task and then, later, end the active session by causing or allowing the computer to enter one or other form of standby or shutdown state or similarly comparable condition. 
         [0035]      FIG. 2  is a block diagram of a debug system  200  using GPIO communication  250  according to an embodiment of the invention. The debug system comprises host computer hardware  240  with an attached communications adapter  245  and a hardware electronic device-under-test  210 . 
         [0036]    The target computer may execute a firmware BIOS  220  that may be debugged by the system  200  using the host computer  240 . The debug engine  230  may be a firmware component module of the BIOS  220  that provides at least a debug function and interacts with the transport layer  235 . The transport layer  235  may be another firmware component module of the BIOS  220  that provides a communication function using a GPIO port  211  and a GPIO wire  250 . 
         [0037]    As is well-known in the art, firmware such as BIOS  220  may be loaded from ROM (Read-Only Memory) into a shadow RAM (Random Access Memory), and executed as if it were software (not shown in  FIG. 2 ). Target device software  215  may also be present and may or may not participate in the debugging process, for example by facilitating the stimulation of fault conditions to be trapped, analyzed and debugged. 
         [0038]    The adapter  245  may be a communication protocol converter. Typically, it connects a host computer in any of various ways and connects to GPIO communications. Adapter  245  may connect to host computer using any of a number of traditional communication channel interfaces, for example using USB (Universal Series Bus) or a serial port conforming to the well-known EIA-RS-232 (Electrical Industries Association Recommended Standard number 232) interface. This adapter  245  may be responsible for receiving data from the electronic device under test  210  and sending it to the host computer  240 , and conversely for data travelling in the reverse direction. In an embodiment, the adapter may comprise an MCU (Micro-Controller Unit), RAM (Random Access Memory), ROM (Read-Only Memory), GPIO and USB/serial port and/etc. In other embodiments of the invention, the adapter may be entirely omitted for reason that it becomes unnecessary when the host computer  240  supports a use of GPIO natively. Nonetheless, some form of isolation may be needed, such as to avoid ground loop problems. 
         [0039]    The host computer  240  may run a debug software stack under an operating system. Typically this includes a debug presentation and user interface  260  to the debug user and/or a debug software console feature. A transport layer  250  may be a software module that provides communication functions for debug software. Typically the Transport Layer  250  in the host computer may be more fully featured than the minimal version  235  provided within the BIOS  220  of the hardware electronic device-under-test  210 . Other comparable arrangements may be used as will be apparent to persons of ordinary skill in the debugging arts. 
         [0040]    In debug system embodiments  200  as described, the host computer  240  need only provide one GPIO wire for digital signal (and a second ground wire for reference voltage). GPIO signals are essentially electrically baseband and unbalanced and may include a 0 Hz (DC—direct current) component. The electronic device-under-test  210  and adapter  245  may thus communicate each with the other through GPIO communication protocols. In embodiments of the invention, the electronic device-under-test  210  may act as the communication master, and adapter acts as the communication slave, or vice versa, or they may continually exchange roles during normal operation. The debug system  200  may rely entirely on half-duplex, point to point communication. Higher level software modules may also add additional features such as CRC (Cyclical Redundancy Check) and/or re-send etc. to provide enhanced communication reliability. 
         [0041]      FIGS. 3A ,  3 B and  3 C are timing diagrams that illustrates various aspects of certain embodiments of the invention. 
         [0042]    Referring to  FIG. 3A , line  30 A represents a series of time slots. Data transmission and reception proceeds isochronously within frames and anisochronously between frames. Line  31 A represents data at the master end of a GPIO transmission link and lines  32 A and  33 A represent alternative versions of data seen at the corresponding slave end of the same link. The timing diagram of  FIG. 3A  is not sufficiently fine in scale that propagation time across the link is shown, it is assumed to be negligible for the purposes of  FIG. 3A , moreover rise time of edges is assumed to be of negligible duration at both transmitter and receiver ends. 
         [0043]    Still referring to  FIG. 3A , the communication is initiated by master end of the GPIO link. For the purposes of the figure the Y axis relates to voltage and the X axis to elapsed time. Also positive logic is assumed with reference zero. Thus data may be encoded according to commonplace industry usage of the well-known NRZ1 (non-return to zero for a binary one). Although it is certainly feasible to use, complex transceivers and encodings such as Manchester encoding may be used to remove all significant 0 Hz (direct current) component from the signal, however such techniques may be appropriate in the event that it is important to electrically isolate systems (for example to prevent ground loop currents) or to use extended distance (proportionate to data rate) (tele)communication. Other encodings may be used. Commonly found in the industry are NRZ0 (non-return to zero for a zero) which is basically the negative logic version of NRZ1, and also NRZ1 (non-return to zero for an inversion). NRZ1 is, in practice seldom used in baseband circuits but will effectively limit the lower bound of bandwidth in HDLC (high-level data link control) channels. 
         [0044]    Referring again to  FIG. 3A , in line  31 A, a start signal is sent first. The falling edge of the start signal provides the receiver with bit synchronization in much the same way as is done with traditional Asynchronous transmission, however the one bit synchronization is not for just one character but serves for an entire communication frame. 
         [0045]    Next in line  31 A comes a single bit of direction indicator. This is used to signal whether the frame is simplex or half-duplex. Line  32 A shows a receiver view of a communication for a simplex frame, line  33 A shows a receiver view of a communication for a half-duplex frame. 
         [0046]    At line  31 A, the next seven bits may be used for salve address, which is significant mostly in a context of multi-point half-duplex operation. Then follows eight bits of transmission data length. In this exemplary embodiment of the invention this limits the data portion to 256 bytes if the length is simply encoded. However other arrangements, such as with longer data lengths are possible within the general scope of the invention. 
         [0047]    In the case of a simplex transmission, line  32 A is followed and the master may continue uninterrupted with data transmission and the receiver likewise. Usual communications techniques such as CRC (cyclic redundancy check) and even higher-level protocols such as IP (Internet Protocol) may be used to improve integrity, performance and the like. 
         [0048]    In the case of a half-duplex transmission, the master ceases to impress signals on the communications line and turns it around to a receive mode. The time-base or data clock continues free-running so that bit synchronization is not lost. Conversely, the slave turns the line around to transmit and begins sending transmitted data as shown in line  33 A. This line turnaround may be accomplished in exactly two bit times (or some small but greater number of bit times). Thus transmitted data is isochronous with the received data in the same frame (and conversely for the master end of the link). 
         [0049]      FIG. 3B  is a timing diagram for a half-duplex frame. It shows that there is a finite, and can even be a significant time between the transmitter impressing a baseband level on the communication link and the corresponding bit being optimally sampled at the receiving end of the link. Line  311  represents the internal clock signal at the master end of the GPIO link. Line  300  represents the signal seen on the GPIO wire at the master end. Line  315  represents the direction signal, this may be an actual voltage at a half-duplex transceiver or it may simply be a status bit in a GPIO controller register. 
         [0050]    Line  320  represents the corresponding internal clock signal at the slave end of the link and line  321  the signal seen at the slave end. Line  325  is the slave end direction signal. 
         [0051]    In the timing example, the start signal is shown as a rising edge near the left end of line  300 , it could equally be implemented as a falling edge. The start signal is used to synchronize the receiver clock  320 . Line  315  shows the master direction is low around the time of the start signal, low indicating output according to a common but arbitrary convention (O or 0=output, I or 1=input). Continuing with the example, at time 150 us (microseconds) the master sends the header (shown as abbreviated two bits to simplify the diagram to the point of manageability but the principle is the same for a two byte header as described elsewhere herein). In the example, at time 155 us the receiver latches the corresponding received bit half a bit time (or one clock edge) later than it was impressed on the link, as shown in line  321 . As shown line turnaround is accomplished in two bit period. 
         [0052]      FIG. 3C  is a timing diagram for a simplex frame. Overall operation is simpler than using half duplex frames. In point-to-point implementations it is entirely feasible to provide a duplex data path by arranging that each end of the link is alternately master and slave thus providing a higher-level form of half-duplex operation wherein each frame is simplex only. Line  351  represents the internal clock signal at the master end of the GPIO link. Line  350  represents the signal seen on the GPIO wire at the master end. Line  355  represents the direction signal, this may be an actual voltage at a half-duplex transceiver or it may simply be a status bit in a GPIO controller register. 
         [0053]    Line  360  represents the corresponding internal clock signal at the slave end of the link and line  361  the signal seen at the slave end. Line  365  is the slave end direction signal 
         [0054]      FIG. 4  is a flow chart illustrating the steps performed in a debug messaging according to an embodiment of the invention of the present invention.  FIG. 4  is purely exemplary and many alternative embodiments are possible within the general scope of the invention. 
         [0055]    At ref.  400  the method starts. Within an electronic device under test, at ref.  410  instruction codes are fetched by a CPU from memory, such as a ROM, and interpreted by the CPU of the electronic device as executable computer code. This allows the CPU to direct operation of the electronic device 
         [0056]    At ref.  420 , codes are executed which caused the GPIO port to be set to output. This allows the electronic device under test to transmit data using the GPIO port. Typically this will involve clearing a status register bit in a controller such as a Southbridge chip although many variations are possible within the general scope of the invention. 
         [0057]    Still referring to  FIG. 4 , at Ref.  430  the start signal is impressed onto the GPIO port. Typically this may cause the pulling of the voltage on the GPIO circuit low, to a near zero voltage state. Equivalent implementations are possible, for example using negative logic on the data signal. 
         [0058]    At Ref.  440 , one bit of R/W (Read or Write) direction indicator value and seven bits of address are transmitted onto to GPIO. Serialize and Transmit 7 bits of slave address and 1 bit of direction indicator. The slave address bits are primarily used in multipoint arrangements by which the master on a connection can designate a slave device. Such arrangements (multiple slaves and one master device) would more typically have the host computer as the master and electronic devices under test as the slaves for reason that the master code would be more complex and hence more easily accommodated within the software of the host computer than within the firmware of the electronic device under test. However, it is entirely feasible to operate with the host computer as a slave and a designated electronic device under test as a master communications device within the general scope of the invention. 
         [0059]    At Ref.  450  the electronic device under test can then serialize and transmit  8  bits of data size. This gives the size of the data to follow. At Ref.  460  a decision is made, such as by testing a direction indicator to determine whether the data direction is a read (data flows towards the master station) or a write (data flows away from the master station). Accordingly control is transferred to either Ref.  490  or Ref.  460  as shown in  FIG. 4 . 
         [0060]    Assuming that the data direction is determined to be the write direction the at Ref.  490  the remainder of the outgoing message is transmitted and the process ends at Ref.  499 . 
         [0061]    Alternatively, the line is to be turned around and at Ref.  460  the GPIO port is set to be input, such as by setting a certain status register bit in a controller. The use and control of GPIO by means of controller registers is well-known in the art. 
         [0062]    At Ref.  470  there is a wait for two bit times, this at least serves the purpose of allowing both ends of the communications link to turn the line around (from transmit to receive or vice versa). Because the bit spacings are isochronous and the clocks are restartable with synchronization but free-running, it is not necessary to regain bit sync. Two bit times is not a crucial amount of time, a greater number could be used. 
         [0063]    At Ref.  480  the incoming message is received and at Ref.  499  the process ends. 
         [0064]      FIG. 5  shows how an exemplary embodiment of the invention may be encoded onto a computer medium or media. 
         [0065]    With regards to  FIG. 5 , computer instructions to be incorporated into in an electronic device  10  may be distributed as manufactured firmware and/or software computer products  510  using a variety of possible media  530  having the instructions recorded thereon such as by using a storage recorder  520 . Often in products as complex as those that deploy the invention, more than one medium may be used, both in distribution and in manufacturing relevant product. Only one medium is shown in  FIG. 5  for clarity but more than one medium may be used and a single computer product may be divided among a plurality of media. 
         [0066]      FIG. 6  shows how an exemplary embodiment of the invention may be encoded, transmitted, received and decoded using electro-magnetic waves. 
         [0067]    With regard to  FIG. 6 , additionally, and especially since the rise in Internet usage, computer products  610  may be distributed by encoding them into signals modulated as a wave. The resulting waveforms may then be transmitted by a transmitter  640 , propagated as tangible modulated electromagnetic carrier waves  650  and received by a receiver  660 . Upon reception they may be demodulated and the signal decoded into a further version or copy of the computer product  611  in a memory or other storage device that is part of a second electronic device  11  and typically similar in nature to electronic device  10 . 
         [0068]    Other topologies devices could also be used to construct alternative embodiments of the invention. 
         [0069]    The embodiments described above are exemplary rather than limiting and the bounds of the invention should be determined from the claims. Although preferred embodiments of the present invention have been described in detail hereinabove, it should be clearly understood that many variations and/or modifications of the basic inventive concepts herein taught which may appear to those skilled in the present art will still fall within the spirit and scope of the present invention, as defined in the appended claims.