PG&E has secured $5.5 billion in credit as it braces for a bankruptcy process that the embattled California utility believes will last two years.

Shares of PG&E were up about 9 percent to just under $8 on Tuesday. The stock price has plunged since the company announced it plans to pursue Chapter 11 bankruptcy by the end of the month.

The company, California's largest utility, is facing at least $30 billion in liabilities related to wildfires in 2017 and 2018. Investigators have not yet determined whether PG&E equipment was at fault for sparking last year's Camp Fire, which killed 86 people.

On Monday, PG&E signed a commitment letter with several large banks to obtain debtor-in-possession financing, a type of funding for companies in financial distress. A rough timeline provided by the company in a filing with the Securities and Exchange Commission on Tuesday sees the bankruptcy process lasting through roughly the start of 2021.

"PG&E expects that the DIP Facilities will provide it with sufficient liquidity to fund its ongoing operations, including its ability to provide safe service to customers during the Chapter 11 cases. PG&E currently expects the Chapter 11 cases to take, subject to satisfaction of certain terms and conditions, approximately two years," the company said in the SEC filing.

The last time the company filed for bankruptcy, it took about three years to complete the process. PG&E sought Chapter 11 protection in 2001 amid the California energy crisis.

The DIP facilities include $3.5 billion in revolving credit, $1.5 billion in term loans and an additional $500 million in delayed draw term loans. The banks providing the credit and loans include J. P. Morgan Chase, Bank of America, Barclays and Citigroup.