PWM Frequency Ramp-Up for Stepper Driver

At 16 MHz, if you turn off interrupts, you can get as precise a timing as you want -- but then the chip can do nothing else at the same time (this includes counting time, receiving serial bytes, etc.)

Why do you need the 90 kHz? The motor probably doesn't step that often, so is this for current regulation? If so, why would a fixed, or just coarsely switched, frequency not be enough?

You could, for example, each time in loop, check the current time, and set the frequency to what you want it to be for that time. There will be slight stair-stepping in the actual frequency being output, but I doubt the motor will care much at all.

bool isRamping;
unsigned long targetTime;
unsigned long startTime;
unsigned long targetFreq;
unsigned long startFreq;
unsigned long curFreq;

void setToSpeedInTime(unsigned long toFreq, unsigned long durMs) {
  startTime = millis();
  targetTime = startTime + durMs;
  startFreq = curFreq; // whever I targeted before
  targetFreq = toFreq;
  isRamping = true;
}

void maybeDoRamping() {
  if (isRamping) {
    unsigned long now = millis();
    if ((long)(now - targetTime) >= 0) {
      isRamping = false;
      curFreq = targetFreq;
    }
    else {
      curFreq = startFreq + (targetFreq - startFreq) * (now - startTime) / (targetTime - startTime);
    }
    set_pwm_frequency(curFreq); // your function here
  }
}

void loop() {
  maybeDoRamping();
  if (whatever_condition()) {
    setToSpeedInTime(90000, 770);
  }
  else if (some_other_condition()) {
    setToSpeedInTime(0, 1440);
  }
}