Changing Arduino Zero PWM Frequency

Yes, it'll break analogWrite(), because it's also trying to use timer TCC0.

The pin mapping for the TCC0, TCC1 and TCC2 are as follows:

REG_TCC0_CCB0 – digital output D2 (Zero Pro/M0 Pro/M0 – digital pin D4)
REG_TCC0_CCB1 – digital output D5
REG_TCC0_CCB2 – digital output D6
REG_TCC0_CCB3 – digital output D7
REG_TCC1_CCB0 – digital output D4 (Zero Pro/M0 Pro/M0 – digital pin D2)
REG_TCC1_CCB1 – digital output D3
REG_TCC2_CCB0 – digital output D11
REG_TCC2_CCB1 – digital output D13

Note: On Arduino.org's Zero Pro/M0 Pro/M0, D2 and D4 are reversed.

Note that first you'll also have to enable TCC1 and TCC2 in a similar manner to TCC0. You can connect TCC2 to GCLK4 using the lines:

// Feed GCLK4 to TCC2 (and TC3)
  REG_GCLK_CLKCTRL = GCLK_CLKCTRL_CLKEN |         // Enable GCLK4 to TCC2 (and TC3)
                     GCLK_CLKCTRL_GEN_GCLK4 |     // Select GCLK4
                     GCLK_CLKCTRL_ID_TCC2_TC3;    // Feed GCLK4 to TCC2 (and TC3)
  while (GCLK->STATUS.bit.SYNCBUSY);              // Wait for synchronization

To connect the timers to their output pins, first enable the port multiplexer on each timer pin:

// Enable the port multiplexer for the 8 PWM channels: timer TCC0, TCC1 and TCC2 outputs
  const uint8_t CHANNELS = 8;
  const uint8_t pwmPins[] = { 2, 3, 4, 5, 6, 7, 11, 13 };
  for (uint8_t i = 0; i < CHANNELS; i++)
  {
     PORT->Group[g_APinDescription[pwmPins[i]].ulPort].PINCFG[g_APinDescription[pwmPins[i]].ulPin].bit.PMUXEN = 1;
  }

Then connect all the timer outputs (TCC0, TCC1 & TCC2) to their respective output pins:

// Connect the TCC timers to the port outputs - port pins are paired odd PMUO and even PMUXE
  // F & E specify the timers: TCC0, TCC1 and TCC2
  PORT->Group[g_APinDescription[2].ulPort].PMUX[g_APinDescription[2].ulPin >> 1].reg = PORT_PMUX_PMUXO_F | PORT_PMUX_PMUXE_F; 
  PORT->Group[g_APinDescription[4].ulPort].PMUX[g_APinDescription[4].ulPin >> 1].reg = PORT_PMUX_PMUXO_F | PORT_PMUX_PMUXE_F;
  PORT->Group[g_APinDescription[6].ulPort].PMUX[g_APinDescription[6].ulPin >> 1].reg = PORT_PMUX_PMUXO_F | PORT_PMUX_PMUXE_F;
  PORT->Group[g_APinDescription[11].ulPort].PMUX[g_APinDescription[11].ulPin >> 1].reg = PORT_PMUX_PMUXO_E | PORT_PMUX_PMUXE_E;

The PMUX registers are arranged in pin pairs odd and even. So for example Arduino's digital pin 13 (D13) is actually the SAMD21 port A, pin 17, or PA17. An odd pin. (See Arduino Zero's schematic diagram). This is paired with its neighboring even pin PA16, (actually digital pin 11). To connect the TCC2 timer to the D13 we have to specify the even SAMD21 pin, in this case PA16 (D11), then connect the timer to D13 using the odd PORT_PMUX_PMUXO_E mask. PMUXO stands for: port multiplexer odd. The E and F suffixes specify that the timers are to be connected.

By the way, the >>1 shift left is actually divide by 2, because there is one PMUX register for each odd and even pair of pins, there's only 16 PMUX registers for 32 pins on a given port.

The g_APinDesciription() function simply converts the Arduino pin numbers into the SAMD21's port and pin representation.